on xenial help sign in
Reverted the need for a newer Unity-API, since we don't want to expose setProgress() that way.
commit71d7660bb954cdc7ef569c3d97034179be9f7ede authorMirco Müller <mirco.mueller@ubuntu.com> dateMon 29 Jun 2015, 18:17 (11 years ago) parent6a3b886
9 files changed+9−17
plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1 plugins/Unity/Launcher/CMakeLists.txt+1−1 plugins/Unity/Launcher/launchermodel.cpp−10 plugins/Unity/Launcher/launchermodel.h−1 tests/mocks/Unity/Launcher/CMakeLists.txt+1−1 tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1 tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1 tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp+3 tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=8)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
22pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
33pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
44
plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=8)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
22pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
33pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
44
plugins/Unity/Launcher/launchermodel.cpp−10
@@ -199,16 +199,6 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
199199 }
200200}
201201
202−void LauncherModel::setProgress(const QString &appId, int progress)
203−{
204− int index = findApplication(appId);
205− if (index >= 0) {
206− m_list.at(index)->setProgress(progress);
207− QModelIndex modelIndex = this->index(index);
208− Q_EMIT dataChanged(modelIndex, modelIndex);
209− }
210−}
211−
212202void LauncherModel::setUser(const QString &username)
213203{
214204 Q_UNUSED(username)
plugins/Unity/Launcher/launchermodel.h−1
@@ -49,7 +49,6 @@ public:
4949 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
5050 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
5151 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
52− Q_INVOKABLE void setProgress(const QString &appId, int progress) override;
5352 Q_INVOKABLE void setUser(const QString &username) override;
5453 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
5554
tests/mocks/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=8)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
22
33include_directories(
44 ${CMAKE_CURRENT_SOURCE_DIR}
tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1
@@ -43,7 +43,6 @@ public:
4343 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
4444 Q_INVOKABLE void requestRemove(const QString &appId) override;
4545 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
46− Q_INVOKABLE void setProgress(const QString &appId, int progress) override;
4746 Q_INVOKABLE void setUser(const QString &username) override;
4847 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
4948
@@ -55,6 +54,7 @@ public:
5554
5655 // For testing
5756 Q_INVOKABLE void emitHint();
57+ Q_INVOKABLE void setProgress(const QString &appId, int progress);
5858
5959Q_SIGNALS:
6060 void quickListTriggered(const QString &appId, int index);
tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=8)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
22pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
33
44include_directories(
tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp+3
@@ -43,6 +43,7 @@ private Q_SLOTS:
4343 item.insert("name", "Item 1");
4444 item.insert("icon", "fake.svg");
4545 item.insert("count", 0);
46+ item.insert("progress", 42);
4647 item.insert("countVisible", false);
4748 item.insert("pinned", true);
4849 list.append(item);
@@ -67,6 +68,7 @@ private Q_SLOTS:
6768 inSync &= model->get(i)->name() == list.at(i).value("name").toString();
6869 inSync &= model->get(i)->icon() == list.at(i).value("icon").toString();
6970 inSync &= model->get(i)->count() == list.at(i).value("count").toInt();
71+ inSync &= model->get(i)->progress() == list.at(i).value("progress").toInt();
7072 inSync &= model->get(i)->countVisible() == list.at(i).value("countVisible").toBool();
7173 }
7274 return inSync;
@@ -111,6 +113,7 @@ private Q_SLOTS:
111113 newEntry.insert("name", "New app");
112114 newEntry.insert("icon", "some-icon.svg");
113115 newEntry.insert("count", 0);
116+ newEntry.insert("progress", 42);
114117 newEntry.insert("countVisible", false);
115118 newEntry.insert("pinned", true);
116119 newList.append(newEntry);
tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
11pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
2−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=8)
2+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
33
44include_directories(
55 ${CMAKE_CURRENT_SOURCE_DIR}