on xenial help sign in
Address review comments
commita94744deff749407395d559c21a521b15f4c9a46 authorMichael Terry <michael.terry@canonical.com> dateMon 18 Jul 2016, 16:42 (10 years ago) parente483a3c
7 files changed+14−14
plugins/Utils/URLDispatcher.cpp+1−1 plugins/Utils/URLDispatcher.h+1−1 qml/Greeter/Greeter.qml+1−1 qml/Shell.qml+8−8 tests/mocks/Utils/URLDispatcher.h+1−1 tests/plugins/Utils/URLDispatcherTest.cpp+1−1 tests/qmltests/tst_Shell.qml+1−1
plugins/Utils/URLDispatcher.cpp+1−1
@@ -37,7 +37,7 @@ URLDispatcherInterface::URLDispatcherInterface(URLDispatcher *parent)
3737void URLDispatcherInterface::DispatchURL(const QString &url, const QString &package)
3838{
3939 Q_UNUSED(package);
40− Q_EMIT static_cast<URLDispatcher *>(parent())->dispatchURL(url);
40+ Q_EMIT static_cast<URLDispatcher *>(parent())->urlRequested(url);
4141}
4242
4343URLDispatcher::URLDispatcher(QObject *parent)
plugins/Utils/URLDispatcher.h+1−1
@@ -37,7 +37,7 @@ public:
3737 void setActive(bool active);
3838
3939Q_SIGNALS:
40− void dispatchURL(const QString &url);
40+ void urlRequested(const QString &url);
4141 void activeChanged();
4242
4343private:
qml/Greeter/Greeter.qml+1−1
@@ -98,7 +98,7 @@ Showable {
9898 }
9999 }
100100
101− // Notify that the user has explicitly requested the given app through unity8 GUI.
101+ // Notify that the user has explicitly requested an app
102102 function notifyUserRequestedApp() {
103103 if (!active) {
104104 return;
qml/Shell.qml+8−8
@@ -154,12 +154,18 @@ StyledItem {
154154 // Either open the app in our own session, or -- if we're acting as a
155155 // greeter -- ask the user's session to open it for us.
156156 if (shell.mode === "greeter") {
157− urlDispatcher.activateURL("application:///" + appId + ".desktop");
157+ activateURL("application:///" + appId + ".desktop");
158158 } else {
159159 startApp(appId);
160160 }
161161 }
162162
163+ function activateURL(url) {
164+ SessionBroadcast.requestUrlStart(AccountsService.user, url);
165+ greeter.notifyUserRequestedApp();
166+ panel.indicators.hide();
167+ }
168+
163169 function startApp(appId) {
164170 if (ApplicationManager.findApplication(appId)) {
165171 ApplicationManager.requestFocusApplication(appId);
@@ -764,13 +770,7 @@ StyledItem {
764770 id: urlDispatcher
765771 objectName: "urlDispatcher"
766772 active: shell.mode === "greeter"
767− onDispatchURL: activateURL(url)
768−
769− function activateURL(url) {
770− SessionBroadcast.requestUrlStart(AccountsService.user, url);
771− greeter.notifyUserRequestedApp();
772− panel.indicators.hide();
773− }
773+ onUrlRequested: shell.activateURL(url)
774774 }
775775
776776 ItemGrabber {
tests/mocks/Utils/URLDispatcher.h+1−1
@@ -37,7 +37,7 @@ public:
3737 void setActive(bool active);
3838
3939Q_SIGNALS:
40− void dispatchURL(const QString &url);
40+ void urlRequested(const QString &url);
4141 void activeChanged();
4242
4343private:
tests/plugins/Utils/URLDispatcherTest.cpp+1−1
@@ -37,7 +37,7 @@ private Q_SLOTS:
3737 {
3838 dispatcher = new URLDispatcher(this);
3939 dispatchSpy = new QSignalSpy(dispatcher,
40− SIGNAL(dispatchURL(const QString &)));
40+ SIGNAL(urlRequested(const QString &)));
4141 }
4242
4343 void cleanup()
tests/qmltests/tst_Shell.qml+1−1
@@ -2572,7 +2572,7 @@ Rectangle {
25722572
25732573 var urlDispatcher = findInvisibleChild(shell, "urlDispatcher");
25742574 verify(urlDispatcher.active);
2575− urlDispatcher.dispatchURL("test:"); // force signal emission
2575+ urlDispatcher.urlRequested("test:"); // force signal emission
25762576
25772577 tryCompare(broadcastUrlSpy, "count", 1);
25782578 compare(broadcastUrlSpy.signalArguments[0][0], "test:");