]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/testdir.h
Don't allow opening the terminal if shell_access Kiosk mode is set
[dolphin.git] / src / tests / testdir.h
index bff46269064efe99d07102458138ce7c0249de4c..3f244448c165d21c7a1aa18a78177b363d02fa74 100644 (file)
 #ifndef TESTDIR_H
 #define TESTDIR_H
 
-#include <KTempDir>
-#include <KUrl>
-
+#include <QUrl>
+#include <QTemporaryDir>
 #include <QDateTime>
 
 /**
- * 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);
 
 };