]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/placesitemmodeltest.cpp
Merge branch 'Applications/19.04'
[dolphin.git] / src / tests / placesitemmodeltest.cpp
index 78c5eabfe4ef36b6fd06fa802455ffa7609f4740..af466908cd8cba0c121c6b007740e4d477b80427 100644 (file)
@@ -88,6 +88,7 @@ private:
     QMap<QString, QDBusInterface *> m_interfacesMap;
     int m_expectedModelCount = 15;
     bool m_hasDesktopFolder = false;
+    bool m_hasDocumentsFolder = false;
     bool m_hasDownloadsFolder = false;
 
     void setBalooEnabled(bool enabled);
@@ -171,6 +172,10 @@ QStringList PlacesItemModelTest::initialUrls() const
             urls << QDir::homePath() + QStringLiteral("/Desktop");
         }
 
+        if (m_hasDocumentsFolder) {
+            urls << QDir::homePath() + QStringLiteral("/Documents");
+        }
+
         if (m_hasDownloadsFolder) {
             urls << QDir::homePath() + QStringLiteral("/Downloads");
         }
@@ -269,6 +274,11 @@ void PlacesItemModelTest::initTestCase()
         m_expectedModelCount++;
     }
 
+    if (QDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).exists()) {
+        m_hasDocumentsFolder = true;
+        m_expectedModelCount++;
+    }
+
     if (QDir(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).exists()) {
         m_hasDownloadsFolder = true;
         m_expectedModelCount++;
@@ -296,6 +306,9 @@ void PlacesItemModelTest::testGroups()
     if (m_hasDesktopFolder) {
         expectedRemoteIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        expectedRemoteIndex++;
+    }
     if (m_hasDownloadsFolder) {
         expectedRemoteIndex++;
     }
@@ -372,6 +385,9 @@ void PlacesItemModelTest::testDeletePlace()
     if (m_hasDesktopFolder) {
         tempDirIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        tempDirIndex++;
+    }
     if (m_hasDownloadsFolder) {
         tempDirIndex++;
     }
@@ -545,6 +561,9 @@ void PlacesItemModelTest::testSystemItems()
     if (m_hasDesktopFolder) {
         tempDirIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        tempDirIndex++;
+    }
     if (m_hasDownloadsFolder) {
         tempDirIndex++;
     }
@@ -593,6 +612,9 @@ void PlacesItemModelTest::testEditBookmark()
     if (m_hasDesktopFolder) {
         tempDirIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        tempDirIndex++;
+    }
     if (m_hasDownloadsFolder) {
         tempDirIndex++;
     }
@@ -631,6 +653,9 @@ void PlacesItemModelTest::testEditAfterCreation()
     if (m_hasDesktopFolder) {
         tempDirIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        tempDirIndex++;
+    }
     if (m_hasDownloadsFolder) {
         tempDirIndex++;
     }
@@ -668,6 +693,9 @@ void PlacesItemModelTest::testEditMetadata()
     if (m_hasDesktopFolder) {
         tempDirIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        tempDirIndex++;
+    }
     if (m_hasDownloadsFolder) {
         tempDirIndex++;
     }
@@ -707,6 +735,9 @@ void PlacesItemModelTest::testRefresh()
     if (m_hasDesktopFolder) {
         tempDirIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        tempDirIndex++;
+    }
     if (m_hasDownloadsFolder) {
         tempDirIndex++;
     }
@@ -778,6 +809,9 @@ void PlacesItemModelTest::testDragAndDrop()
     if (m_hasDesktopFolder) {
         lastIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        lastIndex++;
+    }
     if (m_hasDownloadsFolder) {
         lastIndex++;
     }
@@ -897,6 +931,9 @@ void PlacesItemModelTest::renameAfterCreation()
     if (m_hasDesktopFolder) {
         tempDirIndex++;
     }
+    if (m_hasDocumentsFolder) {
+        tempDirIndex++;
+    }
     if (m_hasDownloadsFolder) {
         tempDirIndex++;
     }