@@ -473,14 +473,15 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
473473 int itemIndex = findApplication(app->appId());
474474 if (itemIndex != -1) {
475475 LauncherItem *item = m_list.at(itemIndex);
476+ QVector<int> roles;
476477 if (!item->recent()) {
477478 item->setRecent(true);
478479 m_asAdapter->syncItems(m_list);
479− Q_EMIT dataChanged(index(itemIndex), index(itemIndex), QVector<int>() << RoleRecent);
480+ roles << RoleRecent;
480481 }
481482 item->setRunning(true);
482− Q_EMIT dataChanged(index(itemIndex), index(itemIndex), QVector<int>() << RoleRunning);
483− // Shall we paint some running/recent app highlight? If yes, do it here.
483+ roles << RoleRunning;
484+ Q_EMIT dataChanged(index(itemIndex), index(itemIndex), roles);
484485 } else {
485486 LauncherItem *item = new LauncherItem(app->appId(), app->name(), app->icon().toString(), this);
486487 item->setRecent(true);
@@ -507,15 +508,15 @@ void LauncherModel::applicationRemoved(const QModelIndex &parent, int row)
507508 }
508509
509510 if (appIndex > -1) {
510− LauncherItem *item = m_list.at(appIndex);
511− item->setRunning(false);
512− Q_EMIT dataChanged(index(appIndex), index(appIndex), QVector<int>() << RoleRunning);
513−
514511 if (!m_list.at(appIndex)->pinned()) {
515512 beginRemoveRows(QModelIndex(), appIndex, appIndex);
516513 m_list.takeAt(appIndex)->deleteLater();
517514 endRemoveRows();
518515 m_asAdapter->syncItems(m_list);
516+ } else {
517+ LauncherItem *item = m_list.at(appIndex);
518+ item->setRunning(false);
519+ Q_EMIT dataChanged(index(appIndex), index(appIndex), QVector<int>() << RoleRunning);
519520 }
520521 }
521522}