@@ -25,6 +25,9 @@ LauncherModel::LauncherModel(QObject *parent):
2525 LauncherModelInterface(parent),
2626 m_backend(new LauncherBackend(this))
2727{
28+ connect(m_backend, SIGNAL(countChanged(QString,int)), SLOT(countChanged(QString,int)));
29+ connect(m_backend, SIGNAL(progressChanged(QString,int)), SLOT(progressChanged(QString,int)));
30+
2831 Q_FOREACH (const QString &entry, m_backend->storedApplications()) {
2932 LauncherItem *item = new LauncherItem(entry,
3033 m_backend->desktopFile(entry),
@@ -67,6 +70,10 @@ QVariant LauncherModel::data(const QModelIndex &index, int role) const
6770 return item->icon();
6871 case RolePinned:
6972 return item->pinned();
73+ case RoleCount:
74+ return item->count();
75+ case RoleProgress:
76+ return item->progress();
7077 }
7178
7279 return QVariant();
@@ -204,3 +211,24 @@ int LauncherModel::findApplication(const QString &appId)
204211 }
205212 return -1;
206213}
214+
215+void LauncherModel::progressChanged(const QString &appId, int progress)
216+{
217+ int idx = findApplication(appId);
218+ if (idx >= 0) {
219+ LauncherItem *item = m_list.at(idx);
220+ item->setProgress(progress);
221+ Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleProgress);
222+ }
223+}
224+
225+
226+void LauncherModel::countChanged(const QString &appId, int count)
227+{
228+ int idx = findApplication(appId);
229+ if (idx >= 0) {
230+ LauncherItem *item = m_list.at(idx);
231+ item->setCount(count);
232+ Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleCount);
233+ }
234+}