on xenial help sign in
protect us against crashes if the backend emits signals for apps we don't know
d7f22acMichael Zanetti
plugins/Unity/Launcher/launchermodel.cpp+10−6
@@ -209,16 +209,20 @@ int LauncherModel::findApplication(const QString &appId)
209void LauncherModel::progressChanged(const QString &appId, int progress)
209void LauncherModel::progressChanged(const QString &appId, int progress)
210{
210{
211 int idx = findApplication(appId);
211 int idx = findApplication(appId);
212+ if (idx >= 0) {
212− LauncherItem *item = m_list.at(idx);
213+ LauncherItem *item = m_list.at(idx);
213− item->setProgress(progress);
214+ item->setProgress(progress);
214− Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleProgress);
215+ Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleProgress);
216+ }
215}
217}
216
218
217
219
218void LauncherModel::countChanged(const QString &appId, int count)
220void LauncherModel::countChanged(const QString &appId, int count)
219{
221{
220 int idx = findApplication(appId);
222 int idx = findApplication(appId);
223+ if (idx >= 0) {
221− LauncherItem *item = m_list.at(idx);
224+ LauncherItem *item = m_list.at(idx);
222− item->setCount(count);
225+ item->setCount(count);
223− Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleCount);
226+ Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleCount);
227+ }
224}
228}