on xenial help sign in
Reverted the need for a newer Unity-API, since we don't want to expose setProgress() that way.
71d7660Mirco Müller
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)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
4
4
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)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
4
4
plugins/Unity/Launcher/launchermodel.cpp−10
@@ -199,16 +199,6 @@ void LauncherModel::quickListActionInvoked(const QString &appId, int actionIndex
199 }
199 }
200}
200}
201
201
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−
212void LauncherModel::setUser(const QString &username)
202void LauncherModel::setUser(const QString &username)
213{
203{
214 Q_UNUSED(username)
204 Q_UNUSED(username)
plugins/Unity/Launcher/launchermodel.h−1
@@ -49,7 +49,6 @@ public:
49 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
49 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
50 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
50 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
51 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
51 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
52− Q_INVOKABLE void setProgress(const QString &appId, int progress) override;
53 Q_INVOKABLE void setUser(const QString &username) override;
52 Q_INVOKABLE void setUser(const QString &username) override;
54 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
53 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
55
54
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)
2
2
3include_directories(
3include_directories(
4 ${CMAKE_CURRENT_SOURCE_DIR}
4 ${CMAKE_CURRENT_SOURCE_DIR}
tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1
@@ -43,7 +43,6 @@ public:
43 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
43 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
44 Q_INVOKABLE void requestRemove(const QString &appId) override;
44 Q_INVOKABLE void requestRemove(const QString &appId) override;
45 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
45 Q_INVOKABLE void quickListActionInvoked(const QString &appId, int actionIndex) override;
46− Q_INVOKABLE void setProgress(const QString &appId, int progress) override;
47 Q_INVOKABLE void setUser(const QString &username) override;
46 Q_INVOKABLE void setUser(const QString &username) override;
48 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
47 Q_INVOKABLE QString getUrlForAppId(const QString &appId) const;
49
48
@@ -55,6 +54,7 @@ public:
55
54
56 // For testing
55 // For testing
57 Q_INVOKABLE void emitHint();
56 Q_INVOKABLE void emitHint();
57+ Q_INVOKABLE void setProgress(const QString &appId, int progress);
58
58
59Q_SIGNALS:
59Q_SIGNALS:
60 void quickListTriggered(const QString &appId, int index);
60 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)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
3
3
4include_directories(
4include_directories(
tests/plugins/Greeter/Unity/Launcher/launchermodelastest.cpp+3
@@ -43,6 +43,7 @@ private Q_SLOTS:
43 item.insert("name", "Item 1");
43 item.insert("name", "Item 1");
44 item.insert("icon", "fake.svg");
44 item.insert("icon", "fake.svg");
45 item.insert("count", 0);
45 item.insert("count", 0);
46+ item.insert("progress", 42);
46 item.insert("countVisible", false);
47 item.insert("countVisible", false);
47 item.insert("pinned", true);
48 item.insert("pinned", true);
48 list.append(item);
49 list.append(item);
@@ -67,6 +68,7 @@ private Q_SLOTS:
67 inSync &= model->get(i)->name() == list.at(i).value("name").toString();
68 inSync &= model->get(i)->name() == list.at(i).value("name").toString();
68 inSync &= model->get(i)->icon() == list.at(i).value("icon").toString();
69 inSync &= model->get(i)->icon() == list.at(i).value("icon").toString();
69 inSync &= model->get(i)->count() == list.at(i).value("count").toInt();
70 inSync &= model->get(i)->count() == list.at(i).value("count").toInt();
71+ inSync &= model->get(i)->progress() == list.at(i).value("progress").toInt();
70 inSync &= model->get(i)->countVisible() == list.at(i).value("countVisible").toBool();
72 inSync &= model->get(i)->countVisible() == list.at(i).value("countVisible").toBool();
71 }
73 }
72 return inSync;
74 return inSync;
@@ -111,6 +113,7 @@ private Q_SLOTS:
111 newEntry.insert("name", "New app");
113 newEntry.insert("name", "New app");
112 newEntry.insert("icon", "some-icon.svg");
114 newEntry.insert("icon", "some-icon.svg");
113 newEntry.insert("count", 0);
115 newEntry.insert("count", 0);
116+ newEntry.insert("progress", 42);
114 newEntry.insert("countVisible", false);
117 newEntry.insert("countVisible", false);
115 newEntry.insert("pinned", true);
118 newEntry.insert("pinned", true);
116 newList.append(newEntry);
119 newList.append(newEntry);
tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
1pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
1pkg_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)
3
3
4include_directories(
4include_directories(
5 ${CMAKE_CURRENT_SOURCE_DIR}
5 ${CMAKE_CURRENT_SOURCE_DIR}