summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold Dumas <contact@arnolddumas.fr>2014-10-14 13:17:20 (GMT)
committerArnold Dumas <contact@arnolddumas.fr>2014-10-14 13:17:20 (GMT)
commitb98cea80a97e48c1d13a3b96bb78f854d8090e29 (patch)
treed196c5f184c05ca0b0dd3605340d332b32154639
parent4ee83e6a7719da5a9c84f97b193b9155e13e1c6b (diff)
Port from KTempDir to QTemporaryDir.
-rw-r--r--generators/comicbook/unrar.cpp12
-rw-r--r--generators/comicbook/unrar.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/generators/comicbook/unrar.cpp b/generators/comicbook/unrar.cpp
index f61a4ce..0a4cdfd 100644
--- a/generators/comicbook/unrar.cpp
+++ b/generators/comicbook/unrar.cpp
@@ -13,12 +13,12 @@
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QRegExp>
+#include <QTemporaryDir>
#include <QtCore/qloggingcategory.h>
#include <kglobal.h>
#include <KLocalizedString>
#include <kstandarddirs.h>
-#include <ktempdir.h>
#if !defined(Q_OS_WIN)
#include <KPty/kptyprocess.h>
#include <KPty/kptydevice.h>
@@ -106,7 +106,7 @@ bool Unrar::open( const QString &fileName )
return false;
delete mTempDir;
- mTempDir = new KTempDir();
+ mTempDir = new QTemporaryDir();
mFileName = fileName;
@@ -116,7 +116,7 @@ bool Unrar::open( const QString &fileName )
mStdOutData.clear();
mStdErrData.clear();
- int ret = startSyncProcess( QStringList() << "e" << mFileName << mTempDir->name() );
+ int ret = startSyncProcess( QStringList() << "e" << mFileName << mTempDir->path() + '/' );
bool ok = ret == 0;
return ok;
@@ -138,7 +138,7 @@ QStringList Unrar::list()
// Extract all the files to mTempDir regardless of their path inside the archive
// This will break if ever an arvhice with two files with the same name in different subfolders
QFileInfo fi( f );
- if ( QFile::exists( mTempDir->name() + fi.fileName() ) ) {
+ if ( QFile::exists( mTempDir->path() + '/' + fi.fileName() ) ) {
newList.append( fi.fileName() );
}
}
@@ -150,7 +150,7 @@ QByteArray Unrar::contentOf( const QString &fileName ) const
if ( !isSuitableVersionAvailable() )
return QByteArray();
- QFile file( mTempDir->name() + fileName );
+ QFile file( mTempDir->path() + '/' + fileName );
if ( !file.open( QIODevice::ReadOnly ) )
return QByteArray();
@@ -162,7 +162,7 @@ QIODevice* Unrar::createDevice( const QString &fileName ) const
if ( !isSuitableVersionAvailable() )
return 0;
- std::auto_ptr< QFile> file( new QFile( mTempDir->name() + fileName ) );
+ std::auto_ptr< QFile> file( new QFile( mTempDir->path() + '/' + fileName ) );
if ( !file->open( QIODevice::ReadOnly ) )
return 0;
diff --git a/generators/comicbook/unrar.h b/generators/comicbook/unrar.h
index d0fca3c..3bdc38a 100644
--- a/generators/comicbook/unrar.h
+++ b/generators/comicbook/unrar.h
@@ -15,7 +15,7 @@
#include <QtCore/QStringList>
class QEventLoop;
-class KTempDir;
+class QTemporaryDir;
class KPtyProcess;
class Unrar : public QObject
@@ -74,7 +74,7 @@ class Unrar : public QObject
QString mFileName;
QByteArray mStdOutData;
QByteArray mStdErrData;
- KTempDir *mTempDir;
+ QTemporaryDir *mTempDir;
};
#endif