on xenial help sign in
remove signal resetAll
de9c303handsome_feng
plugins/Unity/DashCommunicator/DashCommunicator.qmltypes−6
@@ -18,9 +18,6 @@ Module {
18 Parameter { name: "animate"; type: "bool" }
18 Parameter { name: "animate"; type: "bool" }
19 Parameter { name: "isSwipe"; type: "bool" }
19 Parameter { name: "isSwipe"; type: "bool" }
20 }
20 }
21− Method {
22− name: "resetAll"
23− }
24 }
21 }
25 Component {
22 Component {
26 name: "DashCommunicatorService"
23 name: "DashCommunicatorService"
@@ -33,9 +30,6 @@ Module {
33 Parameter { name: "animate"; type: "bool" }
30 Parameter { name: "animate"; type: "bool" }
34 Parameter { name: "isSwipe"; type: "bool" }
31 Parameter { name: "isSwipe"; type: "bool" }
35 }
32 }
36− Signal {
37− name: "resetAllRequested"
38− }
39 }
33 }
40 Component {
34 Component {
41 name: "QThread"
35 name: "QThread"
plugins/Unity/DashCommunicator/dashcommunicator.cpp−9
@@ -39,15 +39,6 @@ void DashCommunicator::setCurrentScope(int index, bool animate, bool isSwipe)
39 m_mutex.unlock();
39 m_mutex.unlock();
40}
40}
41
41
42−void DashCommunicator::resetAll()
43−{
44− m_mutex.lock();
45− if(m_created) {
46− QMetaObject::invokeMethod(m_dashConnection, "resetAll");
47− }
48− m_mutex.unlock();
49−}
50−
51void DashCommunicator::run()
42void DashCommunicator::run()
52{
43{
53 m_dashConnection = new DashConnection("com.canonical.UnityDash",
44 m_dashConnection = new DashConnection("com.canonical.UnityDash",
plugins/Unity/DashCommunicator/dashcommunicator.h−1
@@ -32,7 +32,6 @@ public:
32
32
33public Q_SLOTS:
33public Q_SLOTS:
34 void setCurrentScope(int index, bool animate, bool isSwipe);
34 void setCurrentScope(int index, bool animate, bool isSwipe);
35− void resetAll();
36
35
37protected:
36protected:
38 void run() override;
37 void run() override;
plugins/Unity/DashCommunicator/dashcommunicatorservice.cpp−1
@@ -21,7 +21,6 @@ DashCommunicatorService::DashCommunicatorService(QObject *parent):
21 m_dbusService(new DBusDashCommunicatorService(this))
21 m_dbusService(new DBusDashCommunicatorService(this))
22{
22{
23 connect(m_dbusService, &DBusDashCommunicatorService::setCurrentScopeRequested, this, &DashCommunicatorService::setCurrentScopeRequested);
23 connect(m_dbusService, &DBusDashCommunicatorService::setCurrentScopeRequested, this, &DashCommunicatorService::setCurrentScopeRequested);
24− connect(m_dbusService, &DBusDashCommunicatorService::resetAllRequested, this, &DashCommunicatorService::resetAllRequested);
25}
24}
26
25
27
26
plugins/Unity/DashCommunicator/dashcommunicatorservice.h−1
@@ -30,7 +30,6 @@ public:
30
30
31Q_SIGNALS:
31Q_SIGNALS:
32 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
32 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
33− void resetAllRequested();
34
33
35private:
34private:
36 DBusDashCommunicatorService *m_dbusService;
35 DBusDashCommunicatorService *m_dbusService;
plugins/Unity/DashCommunicator/dashconnection.cpp−7
@@ -61,10 +61,3 @@ void DashConnection::setCurrentScope(int index, bool animate, bool isSwipe)
61 dbusInterface()->asyncCall("SetCurrentScope", index, animate, isSwipe);
61 dbusInterface()->asyncCall("SetCurrentScope", index, animate, isSwipe);
62 }
62 }
63}
63}
64−
65−void DashConnection::resetAll()
66−{
67− if (dbusInterface()) {
68− dbusInterface()->asyncCall("ResetAll");
69− }
70−}
plugins/Unity/DashCommunicator/dashconnection.h−1
@@ -28,7 +28,6 @@ public:
28
28
29public Q_SLOTS:
29public Q_SLOTS:
30 void setCurrentScope(int index, bool animate, bool isSwipe);
30 void setCurrentScope(int index, bool animate, bool isSwipe);
31− void resetAll();
32
31
33private:
32private:
34 QDBusAbstractInterface* createInterface(const QString &service, const QString &path,
33 QDBusAbstractInterface* createInterface(const QString &service, const QString &path,
plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.cpp−5
@@ -33,8 +33,3 @@ void DBusDashCommunicatorService::SetCurrentScope(int index, bool animate, bool
33{
33{
34 Q_EMIT setCurrentScopeRequested(index, animate, isSwipe);
34 Q_EMIT setCurrentScopeRequested(index, animate, isSwipe);
35}
35}
36−
37−void DBusDashCommunicatorService::ResetAll()
38−{
39− Q_EMIT resetAllRequested();
40−}
plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.h−2
@@ -30,11 +30,9 @@ public:
30
30
31Q_SIGNALS:
31Q_SIGNALS:
32 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
32 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
33− void resetAllRequested();
34
33
35public Q_SLOTS:
34public Q_SLOTS:
36 Q_SCRIPTABLE void SetCurrentScope(int index, bool animate, bool isSwipe);
35 Q_SCRIPTABLE void SetCurrentScope(int index, bool animate, bool isSwipe);
37− Q_SCRIPTABLE void ResetAll();
38
36
39};
37};
40
38
qml/Dash/Dash.qml−3
@@ -45,9 +45,6 @@ Showable {
45 backToDashContent()
45 backToDashContent()
46 }
46 }
47 }
47 }
48− onResetAllRequested:{
49− dashContent.resetSearch();
50− }
51 }
48 }
52
49
53 function backToDashContent()
50 function backToDashContent()
qml/Dash/DashContent.qml+1−6
@@ -40,7 +40,6 @@ Item {
40 signal gotoScope(string scopeId)
40 signal gotoScope(string scopeId)
41 signal openScope(var scope)
41 signal openScope(var scope)
42 signal closePreview()
42 signal closePreview()
43− signal resetSearch()
44
43
45 // If we set the current scope index before the scopes have been added,
44 // If we set the current scope index before the scopes have been added,
46 // then we need to wait until the loaded signals gets emitted from the scopes
45 // then we need to wait until the loaded signals gets emitted from the scopes
@@ -85,6 +84,7 @@ Item {
85
84
86 if (reset) {
85 if (reset) {
87 dashContentList.currentItem.item.positionAtBeginning()
86 dashContentList.currentItem.item.positionAtBeginning()
87+ dashContentList.currentItem.item.resetSearch()
88 }
88 }
89 }
89 }
90
90
@@ -206,11 +206,6 @@ Item {
206 onClosePreview: if (item) item.closePreview()
206 onClosePreview: if (item) item.closePreview()
207 }
207 }
208
208
209− Connections {
210− target: dashContent
211− onResetSearch: if(item) item.resetSearch()
212− }
213−
214 Component.onDestruction: active = false
209 Component.onDestruction: active = false
215 }
210 }
216 }
211 }
qml/Shell.qml+4−6
@@ -443,20 +443,18 @@ Item {
443 greeter.notifyAboutToFocusApp("unity8-dash");
443 greeter.notifyAboutToFocusApp("unity8-dash");
444
444
445 var animate = !LightDM.Greeter.active && !stages.shown
445 var animate = !LightDM.Greeter.active && !stages.shown
446− dash.setCurrentScope(0, animate, false)
446+ dash.setCurrentScope(0, animate, true)
447− dash.resetAll()
448 ApplicationManager.requestFocusApplication("unity8-dash")
447 ApplicationManager.requestFocusApplication("unity8-dash")
449 }
448 }
450
449
451 function showDash() {
450 function showDash() {
452− dash.setCurrentScope(0, false, true);
453− dash.resetAll();
454 if (greeter.notifyShowingDashFromDrag()) {
451 if (greeter.notifyShowingDashFromDrag()) {
455 launcher.fadeOut();
452 launcher.fadeOut();
456 }
453 }
457
454
458− if (!greeter.locked && ApplicationManager.focusedApplicationId != "unity8-dash") {
455+ if (!greeter.locked) {
456+ dash.setCurrentScope(0, false, true);
459− ApplicationManager.requestFocusApplication("unity8-dash")
457+ ApplicationManager.requestFocusApplication("unity8-dash");
460 launcher.fadeOut();
458 launcher.fadeOut();
461 }
459 }
462 }
460 }
tests/mocks/Unity/DashCommunicator/DashCommunicator.qmltypes−12
@@ -18,18 +18,12 @@ Module {
18 Parameter { name: "animate"; type: "bool" }
18 Parameter { name: "animate"; type: "bool" }
19 Parameter { name: "reset"; type: "bool" }
19 Parameter { name: "reset"; type: "bool" }
20 }
20 }
21− Signal {
22− name: "resetAllCalled"
23− }
24 Method {
21 Method {
25 name: "setCurrentScope"
22 name: "setCurrentScope"
26 Parameter { name: "index"; type: "int" }
23 Parameter { name: "index"; type: "int" }
27 Parameter { name: "animate"; type: "bool" }
24 Parameter { name: "animate"; type: "bool" }
28 Parameter { name: "reset"; type: "bool" }
25 Parameter { name: "reset"; type: "bool" }
29 }
26 }
30− Method {
31− name: "resetAll"
32− }
33 }
27 }
34 Component {
28 Component {
35 name: "DashCommunicatorService"
29 name: "DashCommunicatorService"
@@ -42,17 +36,11 @@ Module {
42 Parameter { name: "animate"; type: "bool" }
36 Parameter { name: "animate"; type: "bool" }
43 Parameter { name: "isSwipe"; type: "bool" }
37 Parameter { name: "isSwipe"; type: "bool" }
44 }
38 }
45− Signal {
46− name: "resetAllRequested"
47− }
48 Method {
39 Method {
49 name: "mockSetCurrentScope"
40 name: "mockSetCurrentScope"
50 Parameter { name: "index"; type: "int" }
41 Parameter { name: "index"; type: "int" }
51 Parameter { name: "animate"; type: "bool" }
42 Parameter { name: "animate"; type: "bool" }
52 Parameter { name: "isSwipe"; type: "bool" }
43 Parameter { name: "isSwipe"; type: "bool" }
53 }
44 }
54− Method {
55− name: "mockResetAll"
56− }
57 }
45 }
58}
46}
tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.cpp−5
@@ -31,8 +31,3 @@ void DashCommunicatorService::mockSetCurrentScope(int index, bool animate, bool
31{
31{
32 Q_EMIT setCurrentScopeRequested(index, animate, isSwipe);
32 Q_EMIT setCurrentScopeRequested(index, animate, isSwipe);
33}
33}
34−
35−void DashCommunicatorService::mockResetAll()
36−{
37− Q_EMIT resetAllRequested();
38−}
tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.h−2
@@ -28,11 +28,9 @@ public:
28
28
29Q_SIGNALS:
29Q_SIGNALS:
30 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
30 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
31− void resetAllRequested();
32
31
33public Q_SLOTS:
32public Q_SLOTS:
34 void mockSetCurrentScope(int index, bool animate, bool isSwipe);
33 void mockSetCurrentScope(int index, bool animate, bool isSwipe);
35− void mockResetAll();
36};
34};
37
35
38#endif // DBUSUNITYSESSIONSERVICE_H
36#endif // DBUSUNITYSESSIONSERVICE_H
tests/qmltests/tst_Shell.qml+1−37
@@ -203,11 +203,6 @@ Rectangle {
203 signalName: "setCurrentScopeCalled"
203 signalName: "setCurrentScopeCalled"
204 }
204 }
205
205
206− SignalSpy {
207− id: resetAllSpy
208− signalName: "resetAllCalled"
209− }
210−
211 SignalSpy {
206 SignalSpy {
212 id: unlockAllModemsSpy
207 id: unlockAllModemsSpy
213 target: Connectivity
208 target: Connectivity
@@ -255,7 +250,6 @@ Rectangle {
255
250
256 sessionSpy.target = findChild(shell, "greeter")
251 sessionSpy.target = findChild(shell, "greeter")
257 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
252 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
258− resetAllSpy.target = findInvisibleChild(shell, "dashCommunicator");
259
253
260 var launcher = findChild(shell, "launcher");
254 var launcher = findChild(shell, "launcher");
261 launcherShowDashHomeSpy.target = launcher;
255 launcherShowDashHomeSpy.target = launcher;
@@ -404,7 +398,7 @@ Rectangle {
404
398
405 {tag: "swipe over dash",
399 {tag: "swipe over dash",
406 revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
400 revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
407− launcherHides: false, greeterShown: false},
401+ launcherHides: true, greeterShown: false},
408 ];
402 ];
409 }
403 }
410
404
@@ -616,34 +610,6 @@ Rectangle {
616 compare(dashCommunicatorSpy.signalArguments[0][0], 0);
610 compare(dashCommunicatorSpy.signalArguments[0][0], 0);
617 }
611 }
618
612
619− function test_leftSwipeOrBFBCausesResetAllEmission() {
620− loadShell("phone");
621− swipeAwayGreeter();
622−
623− resetAllSpy.clear();
624−
625− //Only long left edge swipe or BFB click on the launcher causes the signal emission
626− dragLauncherIntoView();
627− compare(resetAllSpy.count, 0);
628−
629− //Click the dash icon on the launcher
630− var launcher = findChild(shell, "launcher");
631− var dashIcon = findChild(launcher, "dashItem");
632− verify(dashIcon != undefined);
633− mouseClick(dashIcon);
634−
635− compare(resetAllSpy.count, 1);
636−
637− resetAllSpy.clear();
638−
639− //Long left edge swipe
640− swipeFromLeftEdge(units.gu(27));
641−
642− compare(resetAllSpy.count, 1);
643−
644− resetAllSpy.clear();
645− }
646−
647 function test_showInputMethod() {
613 function test_showInputMethod() {
648 loadShell("phone");
614 loadShell("phone");
649 swipeAwayGreeter();
615 swipeAwayGreeter();
@@ -1113,8 +1079,6 @@ Rectangle {
1113 var dismissTimer = findInvisibleChild(launcher, "dismissTimer");
1079 var dismissTimer = findInvisibleChild(launcher, "dismissTimer");
1114 dismissTimer.interval = 60 * 60 * 1000;
1080 dismissTimer.interval = 60 * 60 * 1000;
1115
1081
1116− launcherShowDashHomeSpy.clear();
1117−
1118 dragLauncherIntoView();
1082 dragLauncherIntoView();
1119
1083
1120 // Emulate a tap with a finger, where the touch position drifts during the tap.
1084 // Emulate a tap with a finger, where the touch position drifts during the tap.