Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
System
Dolphin
Commits
d5a4835f
Commit
d5a4835f
authored
Nov 23, 2020
by
Elvis Angelaccio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlacesItemModelTest: consider also Pictures/Music/Videos folders
See a371e23b2b667bc85c311d04549f3d7348d00af5 in kio.
parent
a218b2ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
src/tests/placesitemmodeltest.cpp
src/tests/placesitemmodeltest.cpp
+39
-0
No files found.
src/tests/placesitemmodeltest.cpp
View file @
d5a4835f
...
@@ -71,6 +71,9 @@ private:
...
@@ -71,6 +71,9 @@ private:
bool
m_hasDesktopFolder
=
false
;
bool
m_hasDesktopFolder
=
false
;
bool
m_hasDocumentsFolder
=
false
;
bool
m_hasDocumentsFolder
=
false
;
bool
m_hasDownloadsFolder
=
false
;
bool
m_hasDownloadsFolder
=
false
;
bool
m_hasMusicFolder
=
false
;
bool
m_hasPicturesFolder
=
false
;
bool
m_hasVideosFolder
=
false
;
void
setBalooEnabled
(
bool
enabled
);
void
setBalooEnabled
(
bool
enabled
);
int
indexOf
(
const
QUrl
&
url
);
int
indexOf
(
const
QUrl
&
url
);
...
@@ -162,6 +165,18 @@ QStringList PlacesItemModelTest::initialUrls() const
...
@@ -162,6 +165,18 @@ QStringList PlacesItemModelTest::initialUrls() const
urls
<<
QDir
::
homePath
()
+
QStringLiteral
(
"/Downloads"
);
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:/"
)
urls
<<
QStringLiteral
(
"trash:/"
)
<<
QStringLiteral
(
"remote:/"
)
<<
QStringLiteral
(
"remote:/"
)
<<
QStringLiteral
(
"/media/nfs"
);
<<
QStringLiteral
(
"/media/nfs"
);
...
@@ -227,6 +242,15 @@ void PlacesItemModelTest::increaseIndexIfNeeded(int &index) const
...
@@ -227,6 +242,15 @@ void PlacesItemModelTest::increaseIndexIfNeeded(int &index) const
if
(
m_hasDownloadsFolder
)
{
if
(
m_hasDownloadsFolder
)
{
index
++
;
index
++
;
}
}
if
(
m_hasMusicFolder
)
{
index
++
;
}
if
(
m_hasPicturesFolder
)
{
index
++
;
}
if
(
m_hasVideosFolder
)
{
index
++
;
}
}
}
void
PlacesItemModelTest
::
init
()
void
PlacesItemModelTest
::
init
()
...
@@ -284,6 +308,21 @@ void PlacesItemModelTest::initTestCase()
...
@@ -284,6 +308,21 @@ void PlacesItemModelTest::initTestCase()
m_expectedModelCount
++
;
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
<
KItemRangeList
>
();
qRegisterMetaType
<
KItemRange
>
();
qRegisterMetaType
<
KItemRange
>
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment