on xenial help sign in
Remove stage property from Application

It's not used anymore

commitaa017a98c0d65256583cc9ac7fcd8dfdd0061f28 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateMon 25 Jul 2016, 11:57 (10 years ago) parent77a5424
8 files changed+11−32
CMakeLists.txt+1−1 debian/control+3−3 qml/Stages/TabletStage.qml+1−1 tests/mocks/Unity/Application/ApplicationInfo.cpp−8 tests/mocks/Unity/Application/ApplicationInfo.h−4 tests/mocks/Unity/Application/ApplicationManager.cpp−10 tests/plugins/Unity/Launcher/launchermodeltest.cpp−2 tests/qmltests/Stages/tst_TabletStage.qml+6−3
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
5757find_package(Qt5Concurrent 5.4 REQUIRED)
5858find_package(Qt5Sql 5.4 REQUIRED)
5959
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=19)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=20)
6161pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
6262pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
6363pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
debian/control+3−3
@@ -34,7 +34,7 @@ Build-Depends: cmake,
3434 libubuntugestures5-dev,
3535 libubuntugestures5-private-dev,
3636 libudev-dev,
37− libunity-api-dev (>= 7.116),
37+ libunity-api-dev (>= 7.117),
3838 libusermetricsoutput1-dev,
3939# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
4040 libx11-dev[!armhf],
@@ -151,7 +151,7 @@ Depends: qml-module-qtquick-layouts,
151151 qtdeclarative5-ubuntu-settings-components (>= 0.7),
152152 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
153153 ubuntu-thumbnailer-impl-0,
154− unity-application-impl-19,
154+ unity-application-impl-20,
155155 unity-notifications-impl-3,
156156 unity-plugin-scopes | unity-scopes-impl,
157157 unity-scopes-impl-12,
@@ -197,7 +197,7 @@ Pre-Depends: ${misc:Pre-Depends},
197197Depends: ${misc:Depends},
198198 ${shlibs:Depends},
199199Provides: unity-application-impl,
200− unity-application-impl-19,
200+ unity-application-impl-20,
201201Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
202202Description: Fake environment for running Unity 8 shell
203203 Provides fake implementations of some QML modules used by Unity 8 shell
qml/Stages/TabletStage.qml+1−1
@@ -536,7 +536,7 @@ AbstractStage {
536536 if (!app) {
537537 return index;
538538 }
539− var stage = spreadRepeater.itemAt(index) ? spreadRepeater.itemAt(index).stage : app.stage;
539+ var stage = spreadRepeater.itemAt(index) ? spreadRepeater.itemAt(index).stage : ApplicationInfoInterface.MainStage;
540540
541541 // don't shuffle indexes greater than "actives or next"
542542 if (index > 2) return index;
tests/mocks/Unity/Application/ApplicationInfo.cpp−8
@@ -175,14 +175,6 @@ void ApplicationInfo::setIcon(const QUrl &value)
175175 }
176176}
177177
178−void ApplicationInfo::setStage(Stage value)
179−{
180− if (value != m_stage) {
181− m_stage = value;
182− Q_EMIT stageChanged(value);
183− }
184−}
185−
186178void ApplicationInfo::setState(State value)
187179{
188180 if (value != m_state) {
tests/mocks/Unity/Application/ApplicationInfo.h−4
@@ -67,9 +67,6 @@ public:
6767
6868 QUrl icon() const override { return m_icon; }
6969
70− Q_INVOKABLE void setStage(Stage value) override; // invokable only for mock
71− Stage stage() const override { return m_stage; }
72−
7370 Q_INVOKABLE void setState(State value);
7471 State state() const override { return m_state; }
7572
@@ -137,7 +134,6 @@ private:
137134 QString m_appId;
138135 QString m_name;
139136 QUrl m_icon;
140− Stage m_stage{MainStage};
141137 State m_state{Stopped};
142138 bool m_fullscreen{false};
143139 Qt::ScreenOrientations m_supportedOrientations{Qt::PortraitOrientation |
tests/mocks/Unity/Application/ApplicationManager.cpp−10
@@ -102,8 +102,6 @@ QVariant ApplicationManager::data(const QModelIndex& index, int role) const {
102102 return app->comment();
103103 case RoleIcon:
104104 return app->icon();
105− case RoleStage:
106− return app->stage();
107105 case RoleState:
108106 return app->state();
109107 case RoleFocused:
@@ -166,11 +164,6 @@ bool ApplicationManager::add(ApplicationInfo *application) {
166164 if (!appIndex.isValid()) return;
167165 Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleState);
168166 });
169− connect(application, &ApplicationInfo::stageChanged, this, [application, this]() {
170− QModelIndex appIndex = findIndex(application);
171− if (!appIndex.isValid()) return;
172− Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleStage);
173− });
174167
175168 connect(application, &ApplicationInfo::closed, this, [application, this]() {
176169 this->remove(application);
@@ -344,7 +337,6 @@ void ApplicationManager::buildListOfAvailableApplications()
344337 application->setScreenshotId("gallery");
345338 application->setIconId("gallery");
346339 application->setShellChrome(Mir::LowChrome);
347− application->setStage(ApplicationInfo::MainStage);
348340 m_availableApplications.append(application);
349341
350342 application = new ApplicationInfo(this);
@@ -381,7 +373,6 @@ void ApplicationManager::buildListOfAvailableApplications()
381373 application->setName("GMail");
382374 application->setIconId("gmail");
383375 application->setScreenshotId("gmail-webapp.svg");
384− application->setStage(ApplicationInfo::MainStage);
385376 application->setSupportedOrientations(Qt::PortraitOrientation
386377 | Qt::LandscapeOrientation
387378 | Qt::InvertedPortraitOrientation
@@ -393,7 +384,6 @@ void ApplicationManager::buildListOfAvailableApplications()
393384 application->setName("Music");
394385 application->setIconId("soundcloud");
395386 application->setScreenshotId("music");
396− application->setStage(ApplicationInfo::MainStage);
397387 application->setSupportedOrientations(Qt::PortraitOrientation
398388 | Qt::LandscapeOrientation
399389 | Qt::InvertedPortraitOrientation
tests/plugins/Unity/Launcher/launchermodeltest.cpp−2
@@ -49,8 +49,6 @@ public:
4949 QString name() const override { return "mock"; }
5050 QString comment() const override { return "this is a mock"; }
5151 QUrl icon() const override { return QUrl(); }
52− ApplicationInfoInterface::Stage stage() const override { return ApplicationInfoInterface::MainStage; }
53− void setStage(ApplicationInfoInterface::Stage) override {}
5452 ApplicationInfoInterface::State state() const override { return ApplicationInfoInterface::Running; }
5553 bool focused() const override { return m_focused; }
5654 QString splashTitle() const override { return QString(); }
tests/qmltests/Stages/tst_TabletStage.qml+6−3
@@ -290,8 +290,9 @@ Rectangle {
290290 var webbrowserSurfaceId = topSurfaceList.nextId;
291291 webbrowserCheckBox.checked = true;
292292 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
293− var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
294− compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage);
293+ var webbrowserDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
294+ verify(webbrowserDelegate);
295+ compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
295296 var webbrowserWindow = findAppWindowForSurfaceId(webbrowserSurfaceId);
296297 verify(webbrowserWindow);
297298
@@ -397,8 +398,10 @@ Rectangle {
397398 var webbrowserSurfaceId = topSurfaceList.nextId;
398399 webbrowserCheckBox.checked = true;
399400 waitUntilAppSurfaceShowsUp(webbrowserSurfaceId);
401+ var webbrowserDelegate = findChild(tabletStage, "spreadDelegate_" + webbrowserSurfaceId);
402+ verify(webbrowserDelegate);
403+ compare(webbrowserDelegate.stage, ApplicationInfoInterface.MainStage);
400404 var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId);
401− compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage);
402405
403406 var gallerySurfaceId = topSurfaceList.nextId;
404407 galleryCheckBox.checked = true;