Commit 08eec037 authored by Eike Hein's avatar Eike Hein

Refresh when the names of the running activities change.

Summary:
BUG:384001

Depends on D8524.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8525
parent e19529cd
......@@ -60,7 +60,8 @@ public:
WindowTasksModel *tasksModel = nullptr;
static ActivityInfo *activityInfo;
QMetaObject::Connection activityInfoConn;
QMetaObject::Connection activityNumberConn;
QMetaObject::Connection activityNamesConn;
static VirtualDesktopInfo *virtualDesktopInfo;
QMetaObject::Connection virtualDesktopNumberConn;
......@@ -164,18 +165,24 @@ void PagerModel::Private::refreshDataSource()
}
);
QObject::disconnect(activityInfoConn);
QObject::disconnect(activityNumberConn);
QObject::disconnect(activityNamesConn);
QObject::disconnect(activityInfo, &ActivityInfo::currentActivityChanged,
q, &PagerModel::currentPageChanged);
QObject::connect(virtualDesktopInfo, &VirtualDesktopInfo::currentDesktopChanged,
q, &PagerModel::currentPageChanged, Qt::UniqueConnection);
} else {
QObject::disconnect(activityInfoConn);
activityInfoConn = QObject::connect(activityInfo,
QObject::disconnect(activityNumberConn);
activityNumberConn = QObject::connect(activityInfo,
&ActivityInfo::numberOfRunningActivitiesChanged,
q, [this]() { q->refresh(); });
QObject::disconnect(activityNamesConn);
activityNamesConn = QObject::connect(activityInfo,
&ActivityInfo::namesOfRunningActivitiesChanged,
q, [this]() { q->refresh(); });
QObject::disconnect(virtualDesktopNumberConn);
QObject::disconnect(virtualDesktopNamesConn);
......@@ -272,7 +279,8 @@ void PagerModel::setEnabled(bool enabled)
} else if (!enabled && d->enabled) {
beginResetModel();
disconnect(d->activityInfoConn);
disconnect(d->activityNumberConn);
disconnect(d->activityNamesConn);
disconnect(d->virtualDesktopNumberConn);
disconnect(d->virtualDesktopNamesConn);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment