1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-10 21:18:19 +03:00

update lastUsedActivity in Single Layout mode

--this also fixes #908. Everything was ok except from
the fact that in Single layout mode the needed
lastUsedActivity variable was empty and thus it couldnt
be tracked to update the needed wallpaper correctly.
This commit is contained in:
Michail Vourlakos 2018-03-08 17:37:02 +02:00
parent 4fc3b43238
commit 085f5b3d16

View File

@ -185,10 +185,8 @@ void Layout::initToCorona(DockCorona *corona)
connect(m_corona, &Plasma::Corona::containmentAdded, this, &Layout::addContainment);
if (m_layoutName != MultipleLayoutsName) {
connect(m_corona->m_activityConsumer, &KActivities::Consumer::currentActivityChanged,
this, &Layout::updateLastUsedActivity);
}
connect(m_corona->m_activityConsumer, &KActivities::Consumer::currentActivityChanged,
this, &Layout::updateLastUsedActivity);
}
int Layout::version() const
@ -652,7 +650,11 @@ void Layout::updateLastUsedActivity()
QString currentId = m_corona->activitiesConsumer()->currentActivity();
if (appliedActivities().contains(currentId) && m_lastUsedActivity != currentId) {
QStringList appliedActivitiesIds = appliedActivities();
if (m_lastUsedActivity != currentId
&& (appliedActivitiesIds.contains(currentId)
|| m_corona->layoutManager()->memoryUsage() == Dock::SingleLayout)) {
m_lastUsedActivity = currentId;
emit lastUsedActivityChanged();