┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2020-11-23 00:25:07 +0100
committerElvis Angelaccio <[email protected]>2020-11-23 00:40:53 +0100
commitd5a4835f01a7a269dc94f170860dddbd512bee6a (patch)
tree7c165b8ed014b1e8b3188e84f6c4aeee8ea38a4b /src
parenta218b2ce51d22a1d1ea8ab38ab5a2834ed598b55 (diff)
PlacesItemModelTest: consider also Pictures/Music/Videos folders
See a371e23b2b667bc85c311d04549f3d7348d00af5 in kio.
Diffstat (limited to 'src')
-rw-r--r--src/tests/placesitemmodeltest.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/tests/placesitemmodeltest.cpp b/src/tests/placesitemmodeltest.cpp
index 9d2f74175..0a6ccf27d 100644
--- a/src/tests/placesitemmodeltest.cpp
+++ b/src/tests/placesitemmodeltest.cpp
@@ -71,6 +71,9 @@ private:
bool m_hasDesktopFolder = false;
bool m_hasDocumentsFolder = false;
bool m_hasDownloadsFolder = false;
+ bool m_hasMusicFolder = false;
+ bool m_hasPicturesFolder = false;
+ bool m_hasVideosFolder = false;
void setBalooEnabled(bool enabled);
int indexOf(const QUrl &url);
@@ -162,6 +165,18 @@ QStringList PlacesItemModelTest::initialUrls() const
urls << QDir::homePath() + QStringLiteral("/Downloads");
}
+ if (m_hasMusicFolder) {
+ urls << QDir::homePath() + QStringLiteral("/Music");
+ }
+
+ if (m_hasPicturesFolder) {
+ urls << QDir::homePath() + QStringLiteral("/Pictures");
+ }
+
+ if (m_hasVideosFolder) {
+ urls << QDir::homePath() + QStringLiteral("/Videos");
+ }
+
urls << QStringLiteral("trash:/")
<< QStringLiteral("remote:/")
<< QStringLiteral("/media/nfs");
@@ -227,6 +242,15 @@ void PlacesItemModelTest::increaseIndexIfNeeded(int &index) const
if (m_hasDownloadsFolder) {
index++;
}
+ if (m_hasMusicFolder) {
+ index++;
+ }
+ if (m_hasPicturesFolder) {
+ index++;
+ }
+ if (m_hasVideosFolder) {
+ index++;
+ }
}
void PlacesItemModelTest::init()
@@ -284,6 +308,21 @@ void PlacesItemModelTest::initTestCase()
m_expectedModelCount++;
}
+ if (QDir(QStandardPaths::writableLocation(QStandardPaths::MusicLocation)).exists()) {
+ m_hasMusicFolder = true;
+ m_expectedModelCount++;
+ }
+
+ if (QDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)).exists()) {
+ m_hasPicturesFolder = true;
+ m_expectedModelCount++;
+ }
+
+ if (QDir(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)).exists()) {
+ m_hasVideosFolder = true;
+ m_expectedModelCount++;
+ }
+
qRegisterMetaType<KItemRangeList>();
qRegisterMetaType<KItemRange>();
}