summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-03-05 08:18:27 +0100
committerMontel Laurent <[email protected]>2015-03-05 08:18:27 +0100
commit03352e866d8948ca5d637d132a29b64f21b8ef6e (patch)
tree19173318739852d90a66446558921fda40f77b33
parentb8cd411ebe18413ab9e8a5d0ae1f932f606e0f60 (diff)
Port to QTemporaryDir
-rw-r--r--tests/auto/historymodeltest.cpp20
-rw-r--r--tests/auto/importertest.cpp2
-rw-r--r--tests/auto/importertest.h4
-rw-r--r--tests/auto/placetreemodeltest.cpp2
-rw-r--r--tests/auto/placetreemodeltest.h4
-rw-r--r--tests/auto/sorteddirmodeltest.cpp2
-rw-r--r--tests/auto/testutils.cpp2
-rw-r--r--tests/auto/testutils.h4
8 files changed, 20 insertions, 20 deletions
diff --git a/tests/auto/historymodeltest.cpp b/tests/auto/historymodeltest.cpp
index 1bc1357..f95b5e4 100644
--- a/tests/auto/historymodeltest.cpp
+++ b/tests/auto/historymodeltest.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// KDE
#include <QDebug>
#include <KFilePlacesModel>
-#include <KTempDir>
+#include <QTemporaryDir>
#include <qtest.h>
// Local
@@ -59,15 +59,15 @@ void HistoryModelTest::testAddUrl()
QDateTime d1 = QDateTime::fromString("2008-02-03T12:34:56", Qt::ISODate);
QUrl u2 = QUrl::fromLocalFile("/root");
QDateTime d2 = QDateTime::fromString("2009-01-29T23:01:47", Qt::ISODate);
- KTempDir dir;
+ QTemporaryDir dir;
{
- HistoryModel model(0, dir.name());
+ HistoryModel model(0, dir.path());
model.addUrl(u1, d1);
model.addUrl(u2, d2);
testModel(model, u2, u1);
}
- HistoryModel model(0, dir.name());
+ HistoryModel model(0, dir.path());
testModel(model, u2, u1);
// Make u1 the most recent
@@ -85,9 +85,9 @@ void HistoryModelTest::testGarbageCollect()
QUrl u3 = QUrl::fromLocalFile("/usr");
QDateTime d3 = QDateTime::fromString("2009-03-24T22:42:15", Qt::ISODate);
- KTempDir dir;
+ QTemporaryDir dir;
{
- HistoryModel model(0, dir.name(), 2);
+ HistoryModel model(0, dir.path(), 2);
model.addUrl(u1, d1);
model.addUrl(u2, d2);
testModel(model, u2, u1);
@@ -97,7 +97,7 @@ void HistoryModelTest::testGarbageCollect()
// Create a model with a larger history so that if garbage collecting fails
// to remove the collected url, the size of the model won't pass
// testModel()
- HistoryModel model(0, dir.name(), 10);
+ HistoryModel model(0, dir.path(), 10);
testModel(model, u3, u2);
}
@@ -108,12 +108,12 @@ void HistoryModelTest::testRemoveRows()
QUrl u2 = QUrl::fromLocalFile("/root");
QDateTime d2 = QDateTime::fromString("2009-01-29T23:01:47", Qt::ISODate);
- KTempDir dir;
- HistoryModel model(0, dir.name(), 2);
+ QTemporaryDir dir;
+ HistoryModel model(0, dir.path(), 2);
model.addUrl(u1, d1);
model.addUrl(u2, d2);
model.removeRows(0, 1);
QCOMPARE(model.rowCount(), 1);
- QDir qDir(dir.name());
+ QDir qDir(dir.path());
QCOMPARE(qDir.entryList(QDir::Files | QDir::NoDotAndDotDot).count(), 1);
}
diff --git a/tests/auto/importertest.cpp b/tests/auto/importertest.cpp
index 5a142b9..a45a591 100644
--- a/tests/auto/importertest.cpp
+++ b/tests/auto/importertest.cpp
@@ -48,7 +48,7 @@ void ImporterTest::init()
<< urlForTestFile("import/pict0003.jpg")
;
- mTempDir.reset(new KTempDir());
+ mTempDir.reset(new QTemporaryDir());
}
void ImporterTest::testContentsAreIdentical()
diff --git a/tests/auto/importertest.h b/tests/auto/importertest.h
index 3e738e7..4ea466b 100644
--- a/tests/auto/importertest.h
+++ b/tests/auto/importertest.h
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QObject>
// KDE
-#include <KTempDir>
+#include <QTemporaryDir>
#include <QUrl>
class ImporterTest : public QObject
@@ -46,7 +46,7 @@ private Q_SLOTS:
void testRenamedCount();
private:
- std::auto_ptr<KTempDir> mTempDir;
+ std::auto_ptr<QTemporaryDir> mTempDir;
QUrl::List mDocumentList;
};
diff --git a/tests/auto/placetreemodeltest.cpp b/tests/auto/placetreemodeltest.cpp
index 64bee27..119b22c 100644
--- a/tests/auto/placetreemodeltest.cpp
+++ b/tests/auto/placetreemodeltest.cpp
@@ -71,7 +71,7 @@ const char* BOOKMARKS_XML =
void PlaceTreeModelTest::initTestCase()
{
Q_ASSERT(mTempDir.exists());
- QDir dir(mTempDir.name());
+ QDir dir(mTempDir.path());
const bool dir1created = dir.mkdir("url1");
Q_ASSERT(dir1created);
diff --git a/tests/auto/placetreemodeltest.h b/tests/auto/placetreemodeltest.h
index 5438faf..23172ea 100644
--- a/tests/auto/placetreemodeltest.h
+++ b/tests/auto/placetreemodeltest.h
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QStringList>
// KDE
-#include <KTempDir>
+#include <QTemporaryDir>
#include <QUrl>
class PlaceTreeModelTest : public QObject
@@ -41,7 +41,7 @@ private Q_SLOTS:
private:
QUrl mUrl1, mUrl2;
QStringList mUrl1Dirs;
- KTempDir mTempDir;
+ QTemporaryDir mTempDir;
};
#endif /* PLACETREEMODELTEST_H */
diff --git a/tests/auto/sorteddirmodeltest.cpp b/tests/auto/sorteddirmodeltest.cpp
index b2ccbad..dec9758 100644
--- a/tests/auto/sorteddirmodeltest.cpp
+++ b/tests/auto/sorteddirmodeltest.cpp
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// KDE
#include <qtest.h>
#include <KDirLister>
-#include <KTempDir>
+#include <QTemporaryDir>
using namespace Gwenview;
diff --git a/tests/auto/testutils.cpp b/tests/auto/testutils.cpp
index 8c8fdae..d517047 100644
--- a/tests/auto/testutils.cpp
+++ b/tests/auto/testutils.cpp
@@ -161,7 +161,7 @@ bool imageCompare(const QImage& img1, const QImage& img2)
SandBoxDir::SandBoxDir()
: mTempDir(QDir::currentPath() + "/sandbox-")
{
- setPath(mTempDir.name());
+ setPath(mTempDir.path());
}
void SandBoxDir::fill(const QStringList& filePaths)
diff --git a/tests/auto/testutils.h b/tests/auto/testutils.h
index 58c92e3..1719df8 100644
--- a/tests/auto/testutils.h
+++ b/tests/auto/testutils.h
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// KDE
#include <QDebug>
-#include <KTempDir>
+#include <QTemporaryDir>
#include <QUrl>
#include "config-gwenview.h"
@@ -102,7 +102,7 @@ public:
void fill(const QStringList& files);
private:
- KTempDir mTempDir;
+ QTemporaryDir mTempDir;
};
/**