Port to QTemporaryDir

This commit is contained in:
Nicolas Lécureuil 2011-12-06 20:08:22 +01:00
parent 135dee0367
commit 01847045ef
3 changed files with 11 additions and 9 deletions

View File

@ -32,6 +32,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/qtjolie
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch
${CMAKE_SOURCE_DIR}/plasma/private/qtjolie-branch/includes
${CMAKE_SOURCE_DIR}/libinqt5/src
${CMAKE_BINARY_DIR}/libinqt5/src
)
if(NOT PLASMA_NO_KIO)

View File

@ -28,6 +28,7 @@
#include <QIODevice>
#include <QRegExp>
#include <QtNetwork/QHostInfo>
#include <qtemporarydir.h>
#include <karchive.h>
#include <kdebug.h>
@ -36,7 +37,6 @@
#include <kservicetypetrader.h>
#include <kstandarddirs.h>
#include <ktar.h>
#include <ktempdir.h>
#include <kzip.h>
#include "config-plasma.h"
@ -289,9 +289,9 @@ KPluginInfo Package::metadata() const
if (archive && archive->open(QIODevice::ReadOnly)) {
const KArchiveDirectory *source = archive->directory();
KTempDir tempdir;
source->copyTo(tempdir.name());
d->createPackageMetadata(tempdir.name());
QTemporaryDir tempdir;
source->copyTo(tempdir.path() + '/');
d->createPackageMetadata(tempdir.path() + '/');
} else {
kWarning() << "Could not open package file:" << d->path;
}
@ -730,7 +730,7 @@ bool PackagePrivate::installPackage(const QString &package, const QString &packa
}
QString path;
KTempDir tempdir;
QTemporaryDir tempdir;
bool archivedPackage = false;
if (fileInfo.isDir()) {
@ -763,7 +763,7 @@ bool PackagePrivate::installPackage(const QString &package, const QString &packa
}
archivedPackage = true;
path = tempdir.name();
path = tempdir.path() + '/';
const KArchiveDirectory *source = archive->directory();
source->copyTo(path);

View File

@ -20,11 +20,11 @@
#include "accessappletjob.h"
#include <qtimer.h>
#include <qtemporarydir.h>
#include <kdebug.h>
#include <kdesktopfile.h>
#include <kmessagebox.h>
#include <ktempdir.h>
#include <kzip.h>
#include "config-plasma.h"
@ -108,9 +108,9 @@ public:
const KArchiveDirectory *source = archive.directory();
KTempDir tempDir;
QTemporaryDir tempDir;
tempDir.setAutoRemove(false);
QString path = tempDir.name();
QString path = tempDir.path() + '/';
source->copyTo(path);
KDesktopFile metadata(path + "/metadata.desktop");