┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Crouthamel <[email protected]>2019-05-20 16:20:28 -0600
committerNate Graham <[email protected]>2019-05-20 16:59:35 -0600
commit1b985d1ef400de024ed221264a55fd58affdec0c (patch)
tree3ffae5b6cda5e563c4d98ff14395852695c58a0a /src
parent2907a34bb54beea207f0a2b816521c75ba571684 (diff)
Add Documents shortcut detection
Summary: This adds support for Documents detection when included as a default as implemented in D16852. This is a work-in-progress and currently does not succeed. Assistance is welcome. Test Plan: Run ctest within the dolphin build directory. Reviewers: #dolphin Subscribers: elvisangelaccio, kfm-devel, ngraham Tags: #dolphin Differential Revision: https://phabricator.kde.org/D16967
Diffstat (limited to 'src')
-rw-r--r--src/tests/placesitemmodeltest.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/placesitemmodeltest.cpp b/src/tests/placesitemmodeltest.cpp
index 78c5eabfe..af466908c 100644
--- a/src/tests/placesitemmodeltest.cpp
+++ b/src/tests/placesitemmodeltest.cpp
@@ -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++;
}