Port from KTemporaryFile to QTemporaryFile
REVIEW: 112742
This commit is contained in:
parent
a3e1635ba6
commit
d258759ac9
6 changed files with 12 additions and 11 deletions
|
@ -21,8 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "screenshot.h"
|
||||
#include <kwinglutils.h>
|
||||
#include <kwinxrenderutils.h>
|
||||
#include <KDE/KTemporaryFile>
|
||||
#include <QDebug>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtDBus/QDBusConnection>
|
||||
#include <QVarLengthArray>
|
||||
#include <QtGui/QPainter>
|
||||
|
@ -304,8 +305,7 @@ QString ScreenShotEffect::blitScreenshot(const QRect &geometry)
|
|||
#endif
|
||||
}
|
||||
|
||||
KTemporaryFile temp;
|
||||
temp.setSuffix(QStringLiteral(".png"));
|
||||
QTemporaryFile temp(QDir::tempPath() + QDir::separator() + QLatin1String("kwin_screenshot_XXXXXX.png"));
|
||||
temp.setAutoRemove(false);
|
||||
if (!temp.open()) {
|
||||
return QString();
|
||||
|
|
|
@ -26,9 +26,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kwinglplatform.h>
|
||||
// KDE
|
||||
#include <KDE/KDebug>
|
||||
#include <KDE/KTemporaryFile>
|
||||
// Qt
|
||||
#include <QSocketNotifier>
|
||||
#include <QTemporaryFile>
|
||||
// xcb
|
||||
#include <xcb/xtest.h>
|
||||
// Wayland
|
||||
|
@ -398,7 +398,7 @@ ShmPool::ShmPool(wl_shm *shm)
|
|||
, m_pool(NULL)
|
||||
, m_poolData(NULL)
|
||||
, m_size(1024 * 1024) // TODO: useful size?
|
||||
, m_tmpFile(new KTemporaryFile())
|
||||
, m_tmpFile(new QTemporaryFile())
|
||||
, m_valid(createPool())
|
||||
, m_offset(0)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// xcb
|
||||
#include <xcb/shm.h>
|
||||
|
||||
class KTemporaryFile;
|
||||
class QTemporaryFile;
|
||||
struct wl_buffer;
|
||||
struct wl_shm;
|
||||
|
||||
|
@ -89,7 +89,7 @@ private:
|
|||
wl_shm_pool *m_pool;
|
||||
void *m_poolData;
|
||||
size_t m_size;
|
||||
QScopedPointer<KTemporaryFile> m_tmpFile;
|
||||
QScopedPointer<QTemporaryFile> m_tmpFile;
|
||||
bool m_valid;
|
||||
int m_offset;
|
||||
};
|
||||
|
|
|
@ -45,6 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QPaintEngine>
|
||||
#include <QTimer>
|
||||
#include <QLabel>
|
||||
#include <QTemporaryFile>
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
#include <KIcon>
|
||||
|
|
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kcmodule.h>
|
||||
|
||||
#include <ksharedconfig.h>
|
||||
#include <ktemporaryfile.h>
|
||||
|
||||
#include "kwin_interface.h"
|
||||
|
||||
|
@ -34,6 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
class KPluginSelector;
|
||||
class KActionCollection;
|
||||
class QLabel;
|
||||
class QTemporaryFile;
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ private:
|
|||
Ui::KWinCompositingConfig ui;
|
||||
|
||||
QMap<QString, QString> mPreviousConfig;
|
||||
KTemporaryFile mTmpConfigFile;
|
||||
QTemporaryFile mTmpConfigFile;
|
||||
KSharedConfigPtr mTmpConfig;
|
||||
bool m_showConfirmDialog;
|
||||
KActionCollection* m_actionCollection;
|
||||
|
|
|
@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kconfig.h>
|
||||
#include <KDE/KXMessages>
|
||||
#include <QRegExp>
|
||||
#include <ktemporaryfile.h>
|
||||
#include <QTemporaryFile>
|
||||
#include <QFile>
|
||||
#include <ktoolinvocation.h>
|
||||
#include <QDebug>
|
||||
|
@ -86,7 +86,7 @@ Rules::Rules()
|
|||
Rules::Rules(const QString& str, bool temporary)
|
||||
: temporary_state(temporary ? 2 : 0)
|
||||
{
|
||||
KTemporaryFile file;
|
||||
QTemporaryFile file;
|
||||
if (file.open()) {
|
||||
QByteArray s = str.toUtf8();
|
||||
file.write(s.data(), s.length());
|
||||
|
|
Loading…
Reference in a new issue