on xenial help sign in
remove signal resetAll
commitde9c303037a8334a4b18f3b16361e285a470e342 authorhandsome_feng <445865575@qq.com> dateWed 29 Apr 2015, 15:39 (11 years ago) parent4b51b2c
16 files changed+6−104
plugins/Unity/DashCommunicator/DashCommunicator.qmltypes−6 plugins/Unity/DashCommunicator/dashcommunicator.cpp−9 plugins/Unity/DashCommunicator/dashcommunicator.h−1 plugins/Unity/DashCommunicator/dashcommunicatorservice.cpp−1 plugins/Unity/DashCommunicator/dashcommunicatorservice.h−1 plugins/Unity/DashCommunicator/dashconnection.cpp−7 plugins/Unity/DashCommunicator/dashconnection.h−1 plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.cpp−5 plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.h−2 qml/Dash/Dash.qml−3 qml/Dash/DashContent.qml+1−6 qml/Shell.qml+4−6 tests/mocks/Unity/DashCommunicator/DashCommunicator.qmltypes−12 tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.cpp−5 tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.h−2 tests/qmltests/tst_Shell.qml+1−37
plugins/Unity/DashCommunicator/DashCommunicator.qmltypes−6
@@ -18,9 +18,6 @@ Module {
1818 Parameter { name: "animate"; type: "bool" }
1919 Parameter { name: "isSwipe"; type: "bool" }
2020 }
21− Method {
22− name: "resetAll"
23− }
2421 }
2522 Component {
2623 name: "DashCommunicatorService"
@@ -33,9 +30,6 @@ Module {
3330 Parameter { name: "animate"; type: "bool" }
3431 Parameter { name: "isSwipe"; type: "bool" }
3532 }
36− Signal {
37− name: "resetAllRequested"
38− }
3933 }
4034 Component {
4135 name: "QThread"
plugins/Unity/DashCommunicator/dashcommunicator.cpp−9
@@ -39,15 +39,6 @@ void DashCommunicator::setCurrentScope(int index, bool animate, bool isSwipe)
3939 m_mutex.unlock();
4040}
4141
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−
5142void DashCommunicator::run()
5243{
5344 m_dashConnection = new DashConnection("com.canonical.UnityDash",
plugins/Unity/DashCommunicator/dashcommunicator.h−1
@@ -32,7 +32,6 @@ public:
3232
3333public Q_SLOTS:
3434 void setCurrentScope(int index, bool animate, bool isSwipe);
35− void resetAll();
3635
3736protected:
3837 void run() override;
plugins/Unity/DashCommunicator/dashcommunicatorservice.cpp−1
@@ -21,7 +21,6 @@ DashCommunicatorService::DashCommunicatorService(QObject *parent):
2121 m_dbusService(new DBusDashCommunicatorService(this))
2222{
2323 connect(m_dbusService, &DBusDashCommunicatorService::setCurrentScopeRequested, this, &DashCommunicatorService::setCurrentScopeRequested);
24− connect(m_dbusService, &DBusDashCommunicatorService::resetAllRequested, this, &DashCommunicatorService::resetAllRequested);
2524}
2625
2726
plugins/Unity/DashCommunicator/dashcommunicatorservice.h−1
@@ -30,7 +30,6 @@ public:
3030
3131Q_SIGNALS:
3232 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
33− void resetAllRequested();
3433
3534private:
3635 DBusDashCommunicatorService *m_dbusService;
plugins/Unity/DashCommunicator/dashconnection.cpp−7
@@ -61,10 +61,3 @@ void DashConnection::setCurrentScope(int index, bool animate, bool isSwipe)
6161 dbusInterface()->asyncCall("SetCurrentScope", index, animate, isSwipe);
6262 }
6363}
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:
2828
2929public Q_SLOTS:
3030 void setCurrentScope(int index, bool animate, bool isSwipe);
31− void resetAll();
3231
3332private:
3433 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
3333{
3434 Q_EMIT setCurrentScopeRequested(index, animate, isSwipe);
3535}
36−
37−void DBusDashCommunicatorService::ResetAll()
38−{
39− Q_EMIT resetAllRequested();
40−}
plugins/Unity/DashCommunicator/dbusdashcommunicatorservice.h−2
@@ -30,11 +30,9 @@ public:
3030
3131Q_SIGNALS:
3232 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
33− void resetAllRequested();
3433
3534public Q_SLOTS:
3635 Q_SCRIPTABLE void SetCurrentScope(int index, bool animate, bool isSwipe);
37− Q_SCRIPTABLE void ResetAll();
3836
3937};
4038
qml/Dash/Dash.qml−3
@@ -45,9 +45,6 @@ Showable {
4545 backToDashContent()
4646 }
4747 }
48− onResetAllRequested:{
49− dashContent.resetSearch();
50− }
5148 }
5249
5350 function backToDashContent()
qml/Dash/DashContent.qml+1−6
@@ -40,7 +40,6 @@ Item {
4040 signal gotoScope(string scopeId)
4141 signal openScope(var scope)
4242 signal closePreview()
43− signal resetSearch()
4443
4544 // If we set the current scope index before the scopes have been added,
4645 // then we need to wait until the loaded signals gets emitted from the scopes
@@ -85,6 +84,7 @@ Item {
8584
8685 if (reset) {
8786 dashContentList.currentItem.item.positionAtBeginning()
87+ dashContentList.currentItem.item.resetSearch()
8888 }
8989 }
9090
@@ -206,11 +206,6 @@ Item {
206206 onClosePreview: if (item) item.closePreview()
207207 }
208208
209− Connections {
210− target: dashContent
211− onResetSearch: if(item) item.resetSearch()
212− }
213−
214209 Component.onDestruction: active = false
215210 }
216211 }
qml/Shell.qml+4−6
@@ -443,20 +443,18 @@ Item {
443443 greeter.notifyAboutToFocusApp("unity8-dash");
444444
445445 var animate = !LightDM.Greeter.active && !stages.shown
446− dash.setCurrentScope(0, animate, false)
447− dash.resetAll()
446+ dash.setCurrentScope(0, animate, true)
448447 ApplicationManager.requestFocusApplication("unity8-dash")
449448 }
450449
451450 function showDash() {
452− dash.setCurrentScope(0, false, true);
453− dash.resetAll();
454451 if (greeter.notifyShowingDashFromDrag()) {
455452 launcher.fadeOut();
456453 }
457454
458− if (!greeter.locked && ApplicationManager.focusedApplicationId != "unity8-dash") {
459− ApplicationManager.requestFocusApplication("unity8-dash")
455+ if (!greeter.locked) {
456+ dash.setCurrentScope(0, false, true);
457+ ApplicationManager.requestFocusApplication("unity8-dash");
460458 launcher.fadeOut();
461459 }
462460 }
tests/mocks/Unity/DashCommunicator/DashCommunicator.qmltypes−12
@@ -18,18 +18,12 @@ Module {
1818 Parameter { name: "animate"; type: "bool" }
1919 Parameter { name: "reset"; type: "bool" }
2020 }
21− Signal {
22− name: "resetAllCalled"
23− }
2421 Method {
2522 name: "setCurrentScope"
2623 Parameter { name: "index"; type: "int" }
2724 Parameter { name: "animate"; type: "bool" }
2825 Parameter { name: "reset"; type: "bool" }
2926 }
30− Method {
31− name: "resetAll"
32− }
3327 }
3428 Component {
3529 name: "DashCommunicatorService"
@@ -42,17 +36,11 @@ Module {
4236 Parameter { name: "animate"; type: "bool" }
4337 Parameter { name: "isSwipe"; type: "bool" }
4438 }
45− Signal {
46− name: "resetAllRequested"
47− }
4839 Method {
4940 name: "mockSetCurrentScope"
5041 Parameter { name: "index"; type: "int" }
5142 Parameter { name: "animate"; type: "bool" }
5243 Parameter { name: "isSwipe"; type: "bool" }
5344 }
54− Method {
55− name: "mockResetAll"
56− }
5745 }
5846}
tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.cpp−5
@@ -31,8 +31,3 @@ void DashCommunicatorService::mockSetCurrentScope(int index, bool animate, bool
3131{
3232 Q_EMIT setCurrentScopeRequested(index, animate, isSwipe);
3333}
34−
35−void DashCommunicatorService::mockResetAll()
36−{
37− Q_EMIT resetAllRequested();
38−}
tests/mocks/Unity/DashCommunicator/dashcommunicatorservice.h−2
@@ -28,11 +28,9 @@ public:
2828
2929Q_SIGNALS:
3030 void setCurrentScopeRequested(int index, bool animate, bool isSwipe);
31− void resetAllRequested();
3231
3332public Q_SLOTS:
3433 void mockSetCurrentScope(int index, bool animate, bool isSwipe);
35− void mockResetAll();
3634};
3735
3836#endif // DBUSUNITYSESSIONSERVICE_H
tests/qmltests/tst_Shell.qml+1−37
@@ -203,11 +203,6 @@ Rectangle {
203203 signalName: "setCurrentScopeCalled"
204204 }
205205
206− SignalSpy {
207− id: resetAllSpy
208− signalName: "resetAllCalled"
209− }
210−
211206 SignalSpy {
212207 id: unlockAllModemsSpy
213208 target: Connectivity
@@ -255,7 +250,6 @@ Rectangle {
255250
256251 sessionSpy.target = findChild(shell, "greeter")
257252 dashCommunicatorSpy.target = findInvisibleChild(shell, "dashCommunicator");
258− resetAllSpy.target = findInvisibleChild(shell, "dashCommunicator");
259253
260254 var launcher = findChild(shell, "launcher");
261255 launcherShowDashHomeSpy.target = launcher;
@@ -404,7 +398,7 @@ Rectangle {
404398
405399 {tag: "swipe over dash",
406400 revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
407− launcherHides: false, greeterShown: false},
401+ launcherHides: true, greeterShown: false},
408402 ];
409403 }
410404
@@ -616,34 +610,6 @@ Rectangle {
616610 compare(dashCommunicatorSpy.signalArguments[0][0], 0);
617611 }
618612
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−
647613 function test_showInputMethod() {
648614 loadShell("phone");
649615 swipeAwayGreeter();
@@ -1113,8 +1079,6 @@ Rectangle {
11131079 var dismissTimer = findInvisibleChild(launcher, "dismissTimer");
11141080 dismissTimer.interval = 60 * 60 * 1000;
11151081
1116− launcherShowDashHomeSpy.clear();
1117−
11181082 dragLauncherIntoView();
11191083
11201084 // Emulate a tap with a finger, where the touch position drifts during the tap.