Port to QTemporaryDir
This commit is contained in:
parent
135dee0367
commit
01847045ef
@ -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)
|
||||
|
12
package.cpp
12
package.cpp
@ -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);
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user