X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/95cb8ffe01e0252d3a26f244e8607254200d067f..d6c086ad04:/src/tests/testdir.h diff --git a/src/tests/testdir.h b/src/tests/testdir.h index bff462690..3f244448c 100644 --- a/src/tests/testdir.h +++ b/src/tests/testdir.h @@ -20,38 +20,38 @@ #ifndef TESTDIR_H #define TESTDIR_H -#include -#include - +#include +#include #include /** - * TestDir provides a temporary directory. In addition to KTempDir, it has + * TestDir provides a temporary directory. In addition to QTemporaryDir, it has * methods that create files and subdirectories inside the directory. */ - -class TestDir : public KTempDir +class TestDir : public QTemporaryDir { public: + TestDir(const QString& directoryPrefix = QString()); + virtual ~TestDir(); - TestDir() {} - ~TestDir() {} - - KUrl url() const { return KUrl(name()); } + QUrl url() const; /** * The following functions create either a file, a list of files, or a directory. * The paths may be absolute or relative to the test directory. Any missing parent * directories will be created automatically. */ - - void createFile(const QString& path, const QByteArray& data = QByteArray("test"), const QDateTime& time = QDateTime()); + void createFile(const QString& path, + const QByteArray& data = QByteArray("test"), + const QDateTime& time = QDateTime()); void createFiles(const QStringList& files); void createDir(const QString& path, const QDateTime& time = QDateTime()); -private: + void removeFile(const QString& path); + void removeFiles(const QStringList& files); +private: void makePathAbsoluteAndCreateParents(QString& path); };