]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/testdir.cpp
Exit the deleted directory when it is removed
[dolphin.git] / src / tests / testdir.cpp
index 5d75a5343baaef7175b75993f4217e7b3b608b39..6fbc4c426aa69df2c1dbf2420820aece02ae1315 100644 (file)
@@ -96,6 +96,17 @@ void TestDir::removeFile(const QString& path)
     QFile::remove(absolutePath);
 }
 
+void TestDir::removeDir(const QString& path)
+{
+    QString absolutePath = path;
+    QFileInfo fileInfo(absolutePath);
+    if (!fileInfo.isAbsolute()) {
+        absolutePath = TestDir::path() + QLatin1Char('/') + path;
+    }
+    QDir dirToRemove = QDir(absolutePath);
+    dirToRemove.removeRecursively();
+}
+
 void TestDir::makePathAbsoluteAndCreateParents(QString& path)
 {
     QFileInfo fileInfo(path);