on xenial help sign in
Require newer launcher-api and update use of newer api.
commita9952b76073da6a567b338a235ab75d08a15ef10 authorMirco Müller <mirco.mueller@ubuntu.com> dateFri 19 Jun 2015, 18:14 (11 years ago) parentb3b0c24
12 files changed+38−38
plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1 plugins/Greeter/Unity/Launcher/launchermodelas.cpp+1−1 plugins/Greeter/Unity/Launcher/launchermodelas.h+1−1 plugins/Unity/Launcher/CMakeLists.txt+1−1 plugins/Unity/Launcher/launchermodel.cpp+1−1 plugins/Unity/Launcher/launchermodel.h+1−1 tests/mocks/Unity/Launcher/CMakeLists.txt+1−1 tests/mocks/Unity/Launcher/MockLauncherModel.cpp+1−1 tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1 tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1 tests/plugins/Unity/Launcher/CMakeLists.txt+1−1 tests/qmltests/Launcher/tst_Launcher.qml+27−27
plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7)
22pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
33pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
44
plugins/Greeter/Unity/Launcher/launchermodelas.cpp+1−1
@@ -72,7 +72,7 @@ QVariant LauncherModel::data(const QModelIndex &index, int role) const
7272 return QVariant();
7373}
7474
75−void LauncherModel::alert(const QString &appId, bool alerting)
75+void LauncherModel::setAlerting(const QString &appId, bool alerting)
7676{
7777 Q_UNUSED(appId)
7878 Q_UNUSED(alerting)
plugins/Greeter/Unity/Launcher/launchermodelas.h+1−1
@@ -41,7 +41,7 @@ public:
4141
4242 QVariant data(const QModelIndex &index, int role) const override;
4343
44− Q_INVOKABLE void alert(const QString &appId, bool alerting) override;
44+ Q_INVOKABLE void setAlerting(const QString &appId, bool alerting) override;
4545 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
4646 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
4747 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7)
22pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
33pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
44
plugins/Unity/Launcher/launchermodel.cpp+1−1
@@ -89,7 +89,7 @@ QVariant LauncherModel::data(const QModelIndex &index, int role) const
8989 return QVariant();
9090}
9191
92−void LauncherModel::alert(const QString &appId, bool alerting) {
92+void LauncherModel::setAlerting(const QString &appId, bool alerting) {
9393 int index = findApplication(appId);
9494 if (index >= 0) {
9595 QModelIndex modelIndex = this->index(index);
plugins/Unity/Launcher/launchermodel.h+1−1
@@ -45,7 +45,7 @@ public:
4545
4646 QVariant data(const QModelIndex &index, int role) const override;
4747
48− Q_INVOKABLE void alert(const QString &appId, bool alerting) override;
48+ Q_INVOKABLE void setAlerting(const QString &appId, bool alerting) override;
4949 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
5050 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
5151 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
tests/mocks/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7)
22
33include_directories(
44 ${CMAKE_CURRENT_SOURCE_DIR}
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+1−1
@@ -121,7 +121,7 @@ unity::shell::launcher::LauncherItemInterface *MockLauncherModel::get(int index)
121121 return m_list.at(index);
122122}
123123
124−void MockLauncherModel::alert(const QString &appId, bool alerting) {
124+void MockLauncherModel::setAlerting(const QString &appId, bool alerting) {
125125 int index = findApp(appId);
126126 if (index >= 0) {
127127 QModelIndex modelIndex = this->index(index);
tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1
@@ -38,7 +38,7 @@ public:
3838
3939 QVariant data(const QModelIndex& index, int role) const override;
4040
41− Q_INVOKABLE void alert(const QString &appId, bool alerting) override;
41+ Q_INVOKABLE void setAlerting(const QString &appId, bool alerting) override;
4242 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface *get(int index) const override;
4343 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
4444 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,4 +1,4 @@
1−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
1+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7)
22pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
33
44include_directories(
tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
11pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
2−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=6)
2+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7)
33
44include_directories(
55 ${CMAKE_CURRENT_SOURCE_DIR}
tests/qmltests/Launcher/tst_Launcher.qml+27−27
@@ -99,7 +99,7 @@ Item {
9999
100100 Button {
101101 text: "set alert"
102− onClicked: LauncherModel.alert(LauncherModel.get(parseInt(appIdEntry.displayText)).appId, true)
102+ onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntry.displayText)).appId, true)
103103 Layout.fillWidth: true
104104 }
105105
@@ -115,7 +115,7 @@ Item {
115115
116116 Button {
117117 text: "unset alert"
118− onClicked: LauncherModel.alert(LauncherModel.get(parseInt(appIdEntry.displayText)).appId, false)
118+ onClicked: LauncherModel.setAlerting(LauncherModel.get(parseInt(appIdEntry.displayText)).appId, false)
119119 Layout.fillWidth: true
120120 }
121121 }
@@ -676,62 +676,62 @@ Item {
676676 function test_alertPeekingIcon() {
677677 var listView = findChild(launcher, "launcherListView")
678678 verify(listView != undefined)
679− LauncherModel.alert(LauncherModel.get(5).appId, true)
679+ LauncherModel.setAlerting(LauncherModel.get(5).appId, true)
680680 tryCompare(listView, "peekingIndex", 5, 1000, "Wrong appId set as peeking-index")
681− LauncherModel.alert(LauncherModel.get(5).appId, false)
681+ LauncherModel.setAlerting(LauncherModel.get(5).appId, false)
682682 tryCompare(listView, "peekingIndex", -1, 1000, "peeking-index should be -1")
683683 }
684684
685685 function test_alertHidingIcon() {
686686 var appIcon6 = findChild(launcher, "launcherDelegate6")
687687 verify(appIcon6 != undefined)
688− LauncherModel.alert(LauncherModel.get(6).appId, true)
688+ LauncherModel.setAlerting(LauncherModel.get(6).appId, true)
689689 waitForWiggleToStart(appIcon6)
690− LauncherModel.alert(LauncherModel.get(6).appId, false)
690+ LauncherModel.setAlerting(LauncherModel.get(6).appId, false)
691691 tryCompare(appIcon6, "x", 0, 1000, "x-value of appId #6 should not be non-zero")
692692 }
693693
694694 function test_alertImplicitHidingIcon() {
695695 var appIcon4 = findChild(launcher, "launcherDelegate4")
696− LauncherModel.alert(LauncherModel.get(4).appId, true)
696+ LauncherModel.setAlerting(LauncherModel.get(4).appId, true)
697697 wait(500)
698698 verify(appIcon4.x > 0)
699699 dragLauncherIntoView()
700700 tryCompare(appIcon4, "x", 0, 1000, "x-value of appId #4 should not be non-zero")
701− LauncherModel.alert(LauncherModel.get(4).appId, false)
701+ LauncherModel.setAlerting(LauncherModel.get(4).appId, false)
702702 }
703703
704704 function test_alertIgnoreFocusedApp() {
705− LauncherModel.alert(LauncherModel.get(0).appId, true)
705+ LauncherModel.setAlerting(LauncherModel.get(0).appId, true)
706706 compare(LauncherModel.get(0).alerting, false, "Focused app should not have the alert-state set")
707707 }
708708
709709 function test_alertOnlyOnePeekingIcon() {
710710 var listView = findChild(launcher, "launcherListView")
711711 verify(listView != undefined)
712− LauncherModel.alert(LauncherModel.get(3).appId, true)
713− LauncherModel.alert(LauncherModel.get(1).appId, true)
714− LauncherModel.alert(LauncherModel.get(5).appId, true)
712+ LauncherModel.setAlerting(LauncherModel.get(3).appId, true)
713+ LauncherModel.setAlerting(LauncherModel.get(1).appId, true)
714+ LauncherModel.setAlerting(LauncherModel.get(5).appId, true)
715715 tryCompare(listView, "peekingIndex", 3, 1000, "Wrong appId set as peeking-index")
716− LauncherModel.alert(LauncherModel.get(1).appId, false)
717− LauncherModel.alert(LauncherModel.get(3).appId, false)
718− LauncherModel.alert(LauncherModel.get(5).appId, false)
716+ LauncherModel.setAlerting(LauncherModel.get(1).appId, false)
717+ LauncherModel.setAlerting(LauncherModel.get(3).appId, false)
718+ LauncherModel.setAlerting(LauncherModel.get(5).appId, false)
719719 tryCompare(listView, "peekingIndex", -1, 1000, "peeking-index should be -1")
720720 }
721721
722722 function test_alertMultipleApps() {
723− LauncherModel.alert(LauncherModel.get(1).appId, true)
724− LauncherModel.alert(LauncherModel.get(3).appId, true)
725− LauncherModel.alert(LauncherModel.get(5).appId, true)
726− LauncherModel.alert(LauncherModel.get(7).appId, true)
723+ LauncherModel.setAlerting(LauncherModel.get(1).appId, true)
724+ LauncherModel.setAlerting(LauncherModel.get(3).appId, true)
725+ LauncherModel.setAlerting(LauncherModel.get(5).appId, true)
726+ LauncherModel.setAlerting(LauncherModel.get(7).appId, true)
727727 compare(LauncherModel.get(1).alerting, true, "Alert-state of appId #1 should not be false")
728728 compare(LauncherModel.get(3).alerting, true, "Alert-state of appId #3 should not be false")
729729 compare(LauncherModel.get(5).alerting, true, "Alert-state of appId #5 should not be false")
730730 compare(LauncherModel.get(7).alerting, true, "Alert-state of appId #7 should not be false")
731− LauncherModel.alert(LauncherModel.get(1).appId, false)
732− LauncherModel.alert(LauncherModel.get(3).appId, false)
733− LauncherModel.alert(LauncherModel.get(5).appId, false)
734− LauncherModel.alert(LauncherModel.get(7).appId, false)
731+ LauncherModel.setAlerting(LauncherModel.get(1).appId, false)
732+ LauncherModel.setAlerting(LauncherModel.get(3).appId, false)
733+ LauncherModel.setAlerting(LauncherModel.get(5).appId, false)
734+ LauncherModel.setAlerting(LauncherModel.get(7).appId, false)
735735 compare(LauncherModel.get(1).alerting, false, "Alert-state of appId #1 should not be true")
736736 compare(LauncherModel.get(3).alerting, false, "Alert-state of appId #1 should not be true")
737737 compare(LauncherModel.get(5).alerting, false, "Alert-state of appId #1 should not be true")
@@ -742,15 +742,15 @@ Item {
742742 dragLauncherIntoView();
743743 var appIcon1 = findChild(launcher, "launcherDelegate1");
744744 var appIcon7 = findChild(launcher, "launcherDelegate7");
745− LauncherModel.alert(LauncherModel.get(1).appId, true)
745+ LauncherModel.setAlerting(LauncherModel.get(1).appId, true)
746746 tryCompare(appIcon1, "angle", 0, 1000, "angle of appId #1 should not be non-zero")
747747 waitForWiggleToStart(appIcon1)
748− LauncherModel.alert(LauncherModel.get(7).appId, true)
748+ LauncherModel.setAlerting(LauncherModel.get(7).appId, true)
749749 tryCompare(appIcon7, "angle", 0, 1000, "angle of appId #7 should not be non-zero")
750750 waitForWiggleToStart(appIcon7)
751− LauncherModel.alert(LauncherModel.get(1).appId, false)
751+ LauncherModel.setAlerting(LauncherModel.get(1).appId, false)
752752 waitForWiggleToStop(appIcon1)
753− LauncherModel.alert(LauncherModel.get(7).appId, false)
753+ LauncherModel.setAlerting(LauncherModel.get(7).appId, false)
754754 waitForWiggleToStop(appIcon7)
755755 }
756756 }