Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Elisa
Commits
3aec97bb
Commit
3aec97bb
authored
Aug 21, 2020
by
stef lep
Browse files
fix open now playing
BUG: 425601
parent
35ffe0f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
autotests/viewmanagertest.cpp
View file @
3aec97bb
...
...
@@ -845,6 +845,61 @@ private Q_SLOTS:
QCOMPARE
(
switchFilesBrowserViewSpy
.
count
(),
0
);
QCOMPARE
(
popOneViewSpy
.
count
(),
0
);
}
void
openNowPlayingViewTest
()
{
ViewManager
viewManager
;
ViewsListData
viewsData
;
viewManager
.
setViewsData
(
&
viewsData
);
QSignalSpy
openGridViewSpy
(
&
viewManager
,
&
ViewManager
::
openGridView
);
QSignalSpy
openListViewSpy
(
&
viewManager
,
&
ViewManager
::
openListView
);
QSignalSpy
switchFilesBrowserViewSpy
(
&
viewManager
,
&
ViewManager
::
switchFilesBrowserView
);
QSignalSpy
switchContextViewSpy
(
&
viewManager
,
&
ViewManager
::
switchContextView
);
QSignalSpy
popOneViewSpy
(
&
viewManager
,
&
ViewManager
::
popOneView
);
viewManager
.
openChildView
({{
DataTypes
::
TitleRole
,
QStringLiteral
(
"album1"
)},
{
DataTypes
::
ArtistRole
,
QStringLiteral
(
"artist1"
)},
{
DataTypes
::
DatabaseIdRole
,
12
},
{
DataTypes
::
ElementTypeRole
,
ElisaUtils
::
Album
}});
QCOMPARE
(
openGridViewSpy
.
count
(),
1
);
QCOMPARE
(
switchContextViewSpy
.
count
(),
0
);
QCOMPARE
(
openListViewSpy
.
count
(),
0
);
QCOMPARE
(
switchFilesBrowserViewSpy
.
count
(),
0
);
QCOMPARE
(
popOneViewSpy
.
count
(),
0
);
QCOMPARE
(
openGridViewSpy
.
at
(
0
).
count
(),
1
);
QCOMPARE
(
openGridViewSpy
.
at
(
0
).
at
(
0
).
value
<
ViewConfigurationData
*>
()
->
filterType
(),
ElisaUtils
::
NoFilter
);
QCOMPARE
(
openGridViewSpy
.
at
(
0
).
at
(
0
).
value
<
ViewConfigurationData
*>
()
->
dataType
(),
ElisaUtils
::
Album
);
viewManager
.
viewIsLoaded
();
QCOMPARE
(
openGridViewSpy
.
count
(),
1
);
QCOMPARE
(
openListViewSpy
.
count
(),
1
);
QCOMPARE
(
switchContextViewSpy
.
count
(),
0
);
QCOMPARE
(
switchFilesBrowserViewSpy
.
count
(),
0
);
QCOMPARE
(
popOneViewSpy
.
count
(),
0
);
QCOMPARE
(
openListViewSpy
.
at
(
0
).
count
(),
1
);
QCOMPARE
(
openListViewSpy
.
at
(
0
).
at
(
0
).
value
<
ViewConfigurationData
*>
()
->
dataFilter
()[
DataTypes
::
TitleRole
].
toString
(),
QStringLiteral
(
"album1"
));
QCOMPARE
(
openListViewSpy
.
at
(
0
).
at
(
0
).
value
<
ViewConfigurationData
*>
()
->
dataFilter
()[
DataTypes
::
ArtistRole
].
toString
(),
QStringLiteral
(
"artist1"
));
viewManager
.
viewIsLoaded
();
QCOMPARE
(
openGridViewSpy
.
count
(),
1
);
QCOMPARE
(
openListViewSpy
.
count
(),
1
);
QCOMPARE
(
switchContextViewSpy
.
count
(),
0
);
QCOMPARE
(
switchFilesBrowserViewSpy
.
count
(),
0
);
QCOMPARE
(
popOneViewSpy
.
count
(),
0
);
viewManager
.
openNowPlaying
();
QCOMPARE
(
openGridViewSpy
.
count
(),
1
);
QCOMPARE
(
openListViewSpy
.
count
(),
1
);
QCOMPARE
(
switchContextViewSpy
.
count
(),
1
);
QCOMPARE
(
switchFilesBrowserViewSpy
.
count
(),
0
);
QCOMPARE
(
popOneViewSpy
.
count
(),
0
);
}
};
QTEST_GUILESS_MAIN
(
ViewManagerTests
)
...
...
src/qml/ContentView.qml
View file @
3aec97bb
...
...
@@ -33,7 +33,7 @@ RowLayout {
}
function
openNowPlaying
()
{
viewManager
.
closeAllViews
();
viewManager
.
openNowPlaying
();
}
ViewManager
{
...
...
src/viewmanager.cpp
View file @
3aec97bb
...
...
@@ -227,6 +227,11 @@ void ViewManager::openArtistView(const QString &artist)
}
}
void
ViewManager
::
openNowPlaying
()
{
openView
(
0
);
}
void
ViewManager
::
viewIsLoaded
()
{
qCDebug
(
orgKdeElisaViews
())
<<
"ViewManager::viewIsLoaded"
<<
d
->
mViewParametersStack
.
size
()
...
...
src/viewmanager.h
View file @
3aec97bb
...
...
@@ -128,6 +128,8 @@ public Q_SLOTS:
void
openArtistView
(
const
QString
&
artist
);
void
openNowPlaying
();
void
viewIsLoaded
();
void
goBack
();
...
...
Write
Preview
Supports
Markdown
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