on xenial help sign in
disconnect surfaceCount signal again

In theory it could happen that AppMan removes an app from the model but does not delete it. In which case we don't want to get updates from that app any more.

commit8caafb4d3a4d21bd3a6bd1b4228c215c631b34b2 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 19 May 2016, 17:56 (10 years ago) parent9b837ca
1 file changed+4−1
plugins/Unity/Launcher/launchermodel.cpp+4−1
plugins/Unity/Launcher/launchermodel.cpp+4−1
@@ -568,9 +568,10 @@ void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
568568{
569569 Q_UNUSED(parent)
570570
571+ ApplicationInfoInterface *app = m_appManager->get(row);
571572 int appIndex = -1;
572573 for (int i = 0; i < m_list.count(); ++i) {
573− if (m_list.at(i)->appId() == m_appManager->get(row)->appId()) {
574+ if (m_list.at(i)->appId() == app->appId()) {
574575 appIndex = i;
575576 break;
576577 }
@@ -581,6 +582,8 @@ void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
581582 return;
582583 }
583584
585+ disconnect(app, &ApplicationInfoInterface::surfaceCountChanged, this, &LauncherModel::applicationSurfaceCountChanged);
586+
584587 LauncherItem * item = m_list.at(appIndex);
585588 item->setRunning(false);
586589