on xenial help sign in
Address review comments
a94744dMichael Terry
plugins/Utils/URLDispatcher.cpp+1−1
@@ -37,7 +37,7 @@ URLDispatcherInterface::URLDispatcherInterface(URLDispatcher *parent)
37void URLDispatcherInterface::DispatchURL(const QString &url, const QString &package)
37void URLDispatcherInterface::DispatchURL(const QString &url, const QString &package)
38{
38{
39 Q_UNUSED(package);
39 Q_UNUSED(package);
40− Q_EMIT static_cast<URLDispatcher *>(parent())->dispatchURL(url);
40+ Q_EMIT static_cast<URLDispatcher *>(parent())->urlRequested(url);
41}
41}
42
42
43URLDispatcher::URLDispatcher(QObject *parent)
43URLDispatcher::URLDispatcher(QObject *parent)
plugins/Utils/URLDispatcher.h+1−1
@@ -37,7 +37,7 @@ public:
37 void setActive(bool active);
37 void setActive(bool active);
38
38
39Q_SIGNALS:
39Q_SIGNALS:
40− void dispatchURL(const QString &url);
40+ void urlRequested(const QString &url);
41 void activeChanged();
41 void activeChanged();
42
42
43private:
43private:
qml/Greeter/Greeter.qml+1−1
@@ -98,7 +98,7 @@ Showable {
98 }
98 }
99 }
99 }
100
100
101− // Notify that the user has explicitly requested the given app through unity8 GUI.
101+ // Notify that the user has explicitly requested an app
102 function notifyUserRequestedApp() {
102 function notifyUserRequestedApp() {
103 if (!active) {
103 if (!active) {
104 return;
104 return;
qml/Shell.qml+8−8
@@ -154,12 +154,18 @@ StyledItem {
154 // Either open the app in our own session, or -- if we're acting as a
154 // Either open the app in our own session, or -- if we're acting as a
155 // greeter -- ask the user's session to open it for us.
155 // greeter -- ask the user's session to open it for us.
156 if (shell.mode === "greeter") {
156 if (shell.mode === "greeter") {
157− urlDispatcher.activateURL("application:///" + appId + ".desktop");
157+ activateURL("application:///" + appId + ".desktop");
158 } else {
158 } else {
159 startApp(appId);
159 startApp(appId);
160 }
160 }
161 }
161 }
162
162
163+ function activateURL(url) {
164+ SessionBroadcast.requestUrlStart(AccountsService.user, url);
165+ greeter.notifyUserRequestedApp();
166+ panel.indicators.hide();
167+ }
168+
163 function startApp(appId) {
169 function startApp(appId) {
164 if (ApplicationManager.findApplication(appId)) {
170 if (ApplicationManager.findApplication(appId)) {
165 ApplicationManager.requestFocusApplication(appId);
171 ApplicationManager.requestFocusApplication(appId);
@@ -764,13 +770,7 @@ StyledItem {
764 id: urlDispatcher
770 id: urlDispatcher
765 objectName: "urlDispatcher"
771 objectName: "urlDispatcher"
766 active: shell.mode === "greeter"
772 active: shell.mode === "greeter"
767− onDispatchURL: activateURL(url)
773+ onUrlRequested: shell.activateURL(url)
768−
769− function activateURL(url) {
770− SessionBroadcast.requestUrlStart(AccountsService.user, url);
771− greeter.notifyUserRequestedApp();
772− panel.indicators.hide();
773− }
774 }
774 }
775
775
776 ItemGrabber {
776 ItemGrabber {
tests/mocks/Utils/URLDispatcher.h+1−1
@@ -37,7 +37,7 @@ public:
37 void setActive(bool active);
37 void setActive(bool active);
38
38
39Q_SIGNALS:
39Q_SIGNALS:
40− void dispatchURL(const QString &url);
40+ void urlRequested(const QString &url);
41 void activeChanged();
41 void activeChanged();
42
42
43private:
43private:
tests/plugins/Utils/URLDispatcherTest.cpp+1−1
@@ -37,7 +37,7 @@ private Q_SLOTS:
37 {
37 {
38 dispatcher = new URLDispatcher(this);
38 dispatcher = new URLDispatcher(this);
39 dispatchSpy = new QSignalSpy(dispatcher,
39 dispatchSpy = new QSignalSpy(dispatcher,
40− SIGNAL(dispatchURL(const QString &)));
40+ SIGNAL(urlRequested(const QString &)));
41 }
41 }
42
42
43 void cleanup()
43 void cleanup()
tests/qmltests/tst_Shell.qml+1−1
@@ -2572,7 +2572,7 @@ Rectangle {
2572
2572
2573 var urlDispatcher = findInvisibleChild(shell, "urlDispatcher");
2573 var urlDispatcher = findInvisibleChild(shell, "urlDispatcher");
2574 verify(urlDispatcher.active);
2574 verify(urlDispatcher.active);
2575− urlDispatcher.dispatchURL("test:"); // force signal emission
2575+ urlDispatcher.urlRequested("test:"); // force signal emission
2576
2576
2577 tryCompare(broadcastUrlSpy, "count", 1);
2577 tryCompare(broadcastUrlSpy, "count", 1);
2578 compare(broadcastUrlSpy.signalArguments[0][0], "test:");
2578 compare(broadcastUrlSpy.signalArguments[0][0], "test:");