@@ -171,6 +171,7 @@ void LauncherModel::requestRemove(const QString &appId)
171 m_list.at(index)->setPinned(false);
171 m_list.at(index)->setPinned(false);
172 QModelIndex modelIndex = this->index(index);
172 QModelIndex modelIndex = this->index(index);
173 Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RolePinned);
173 Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RolePinned);
@@ -350,6 +351,7 @@ void LauncherModel::countVisibleChanged(const QString &appId, int countVisible)
351void LauncherModel::refresh()
352void LauncherModel::refresh()
354+ qDebug() << "calling refresh";
353 // First walk through all the existing items and see if we need to remove something
355 // First walk through all the existing items and see if we need to remove something
354 QList<LauncherItem*> toBeRemoved;
356 QList<LauncherItem*> toBeRemoved;
355 Q_FOREACH (LauncherItem* item, m_list) {
357 Q_FOREACH (LauncherItem* item, m_list) {
@@ -368,8 +370,18 @@ void LauncherModel::refresh()
373+ // If running, just unpin, otherwise really remove
371 Q_FOREACH (LauncherItem* item, toBeRemoved) {
374 Q_FOREACH (LauncherItem* item, toBeRemoved) {
372− requestRemove(item->appId());
375+ int index = m_list.indexOf(item);
376+ if (m_appManager->findApplication(item->appId())) {
377+ item->setPinned(false);
378+ QModelIndex modelIndex = this->index(index);
379+ Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RolePinned);
381+ beginRemoveRows(QModelIndex(), index, index);
382+ m_list.takeAt(index)->deleteLater();
375 // This brings the Launcher into sync with the settings backend again. There's an issue though:
387 // This brings the Launcher into sync with the settings backend again. There's an issue though: