on xenial help sign in
Require newer launcher-api and update use of newer api.
a9952b7Mirco Müller
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)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
4
4
plugins/Greeter/Unity/Launcher/launchermodelas.cpp+1−1
@@ -72,7 +72,7 @@ QVariant LauncherModel::data(const QModelIndex &index, int role) const
72 return QVariant();
72 return QVariant();
73}
73}
74
74
75−void LauncherModel::alert(const QString &appId, bool alerting)
75+void LauncherModel::setAlerting(const QString &appId, bool alerting)
76{
76{
77 Q_UNUSED(appId)
77 Q_UNUSED(appId)
78 Q_UNUSED(alerting)
78 Q_UNUSED(alerting)
plugins/Greeter/Unity/Launcher/launchermodelas.h+1−1
@@ -41,7 +41,7 @@ public:
41
41
42 QVariant data(const QModelIndex &index, int role) const override;
42 QVariant data(const QModelIndex &index, int role) const override;
43
43
44− Q_INVOKABLE void alert(const QString &appId, bool alerting) override;
44+ Q_INVOKABLE void setAlerting(const QString &appId, bool alerting) override;
45 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
45 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
46 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
46 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
47 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
47 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)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
3pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
4
4
plugins/Unity/Launcher/launchermodel.cpp+1−1
@@ -89,7 +89,7 @@ QVariant LauncherModel::data(const QModelIndex &index, int role) const
89 return QVariant();
89 return QVariant();
90}
90}
91
91
92−void LauncherModel::alert(const QString &appId, bool alerting) {
92+void LauncherModel::setAlerting(const QString &appId, bool alerting) {
93 int index = findApplication(appId);
93 int index = findApplication(appId);
94 if (index >= 0) {
94 if (index >= 0) {
95 QModelIndex modelIndex = this->index(index);
95 QModelIndex modelIndex = this->index(index);
plugins/Unity/Launcher/launchermodel.h+1−1
@@ -45,7 +45,7 @@ public:
45
45
46 QVariant data(const QModelIndex &index, int role) const override;
46 QVariant data(const QModelIndex &index, int role) const override;
47
47
48− Q_INVOKABLE void alert(const QString &appId, bool alerting) override;
48+ Q_INVOKABLE void setAlerting(const QString &appId, bool alerting) override;
49 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
49 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface* get(int index) const override;
50 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
50 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
51 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
51 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)
2
2
3include_directories(
3include_directories(
4 ${CMAKE_CURRENT_SOURCE_DIR}
4 ${CMAKE_CURRENT_SOURCE_DIR}
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+1−1
@@ -121,7 +121,7 @@ unity::shell::launcher::LauncherItemInterface *MockLauncherModel::get(int index)
121 return m_list.at(index);
121 return m_list.at(index);
122}
122}
123
123
124−void MockLauncherModel::alert(const QString &appId, bool alerting) {
124+void MockLauncherModel::setAlerting(const QString &appId, bool alerting) {
125 int index = findApp(appId);
125 int index = findApp(appId);
126 if (index >= 0) {
126 if (index >= 0) {
127 QModelIndex modelIndex = this->index(index);
127 QModelIndex modelIndex = this->index(index);
tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1
@@ -38,7 +38,7 @@ public:
38
38
39 QVariant data(const QModelIndex& index, int role) const override;
39 QVariant data(const QModelIndex& index, int role) const override;
40
40
41− Q_INVOKABLE void alert(const QString &appId, bool alerting) override;
41+ Q_INVOKABLE void setAlerting(const QString &appId, bool alerting) override;
42 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface *get(int index) const override;
42 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface *get(int index) const override;
43 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
43 Q_INVOKABLE void move(int oldIndex, int newIndex) override;
44 Q_INVOKABLE void pin(const QString &appId, int index = -1) override;
44 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)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
2pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6)
3
3
4include_directories(
4include_directories(
tests/plugins/Unity/Launcher/CMakeLists.txt+1−1
@@ -1,5 +1,5 @@
1pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
1pkg_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)
3
3
4include_directories(
4include_directories(
5 ${CMAKE_CURRENT_SOURCE_DIR}
5 ${CMAKE_CURRENT_SOURCE_DIR}
tests/qmltests/Launcher/tst_Launcher.qml+27−27
@@ -99,7 +99,7 @@ Item {
99
99
100 Button {
100 Button {
101 text: "set alert"
101 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)
103 Layout.fillWidth: true
103 Layout.fillWidth: true
104 }
104 }
105
105
@@ -115,7 +115,7 @@ Item {
115
115
116 Button {
116 Button {
117 text: "unset alert"
117 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)
119 Layout.fillWidth: true
119 Layout.fillWidth: true
120 }
120 }
121 }
121 }
@@ -676,62 +676,62 @@ Item {
676 function test_alertPeekingIcon() {
676 function test_alertPeekingIcon() {
677 var listView = findChild(launcher, "launcherListView")
677 var listView = findChild(launcher, "launcherListView")
678 verify(listView != undefined)
678 verify(listView != undefined)
679− LauncherModel.alert(LauncherModel.get(5).appId, true)
679+ LauncherModel.setAlerting(LauncherModel.get(5).appId, true)
680 tryCompare(listView, "peekingIndex", 5, 1000, "Wrong appId set as peeking-index")
680 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)
682 tryCompare(listView, "peekingIndex", -1, 1000, "peeking-index should be -1")
682 tryCompare(listView, "peekingIndex", -1, 1000, "peeking-index should be -1")
683 }
683 }
684
684
685 function test_alertHidingIcon() {
685 function test_alertHidingIcon() {
686 var appIcon6 = findChild(launcher, "launcherDelegate6")
686 var appIcon6 = findChild(launcher, "launcherDelegate6")
687 verify(appIcon6 != undefined)
687 verify(appIcon6 != undefined)
688− LauncherModel.alert(LauncherModel.get(6).appId, true)
688+ LauncherModel.setAlerting(LauncherModel.get(6).appId, true)
689 waitForWiggleToStart(appIcon6)
689 waitForWiggleToStart(appIcon6)
690− LauncherModel.alert(LauncherModel.get(6).appId, false)
690+ LauncherModel.setAlerting(LauncherModel.get(6).appId, false)
691 tryCompare(appIcon6, "x", 0, 1000, "x-value of appId #6 should not be non-zero")
691 tryCompare(appIcon6, "x", 0, 1000, "x-value of appId #6 should not be non-zero")
692 }
692 }
693
693
694 function test_alertImplicitHidingIcon() {
694 function test_alertImplicitHidingIcon() {
695 var appIcon4 = findChild(launcher, "launcherDelegate4")
695 var appIcon4 = findChild(launcher, "launcherDelegate4")
696− LauncherModel.alert(LauncherModel.get(4).appId, true)
696+ LauncherModel.setAlerting(LauncherModel.get(4).appId, true)
697 wait(500)
697 wait(500)
698 verify(appIcon4.x > 0)
698 verify(appIcon4.x > 0)
699 dragLauncherIntoView()
699 dragLauncherIntoView()
700 tryCompare(appIcon4, "x", 0, 1000, "x-value of appId #4 should not be non-zero")
700 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)
702 }
702 }
703
703
704 function test_alertIgnoreFocusedApp() {
704 function test_alertIgnoreFocusedApp() {
705− LauncherModel.alert(LauncherModel.get(0).appId, true)
705+ LauncherModel.setAlerting(LauncherModel.get(0).appId, true)
706 compare(LauncherModel.get(0).alerting, false, "Focused app should not have the alert-state set")
706 compare(LauncherModel.get(0).alerting, false, "Focused app should not have the alert-state set")
707 }
707 }
708
708
709 function test_alertOnlyOnePeekingIcon() {
709 function test_alertOnlyOnePeekingIcon() {
710 var listView = findChild(launcher, "launcherListView")
710 var listView = findChild(launcher, "launcherListView")
711 verify(listView != undefined)
711 verify(listView != undefined)
712− LauncherModel.alert(LauncherModel.get(3).appId, true)
712+ LauncherModel.setAlerting(LauncherModel.get(3).appId, true)
713− LauncherModel.alert(LauncherModel.get(1).appId, true)
713+ LauncherModel.setAlerting(LauncherModel.get(1).appId, true)
714− LauncherModel.alert(LauncherModel.get(5).appId, true)
714+ LauncherModel.setAlerting(LauncherModel.get(5).appId, true)
715 tryCompare(listView, "peekingIndex", 3, 1000, "Wrong appId set as peeking-index")
715 tryCompare(listView, "peekingIndex", 3, 1000, "Wrong appId set as peeking-index")
716− LauncherModel.alert(LauncherModel.get(1).appId, false)
716+ LauncherModel.setAlerting(LauncherModel.get(1).appId, false)
717− LauncherModel.alert(LauncherModel.get(3).appId, false)
717+ LauncherModel.setAlerting(LauncherModel.get(3).appId, false)
718− LauncherModel.alert(LauncherModel.get(5).appId, false)
718+ LauncherModel.setAlerting(LauncherModel.get(5).appId, false)
719 tryCompare(listView, "peekingIndex", -1, 1000, "peeking-index should be -1")
719 tryCompare(listView, "peekingIndex", -1, 1000, "peeking-index should be -1")
720 }
720 }
721
721
722 function test_alertMultipleApps() {
722 function test_alertMultipleApps() {
723− LauncherModel.alert(LauncherModel.get(1).appId, true)
723+ LauncherModel.setAlerting(LauncherModel.get(1).appId, true)
724− LauncherModel.alert(LauncherModel.get(3).appId, true)
724+ LauncherModel.setAlerting(LauncherModel.get(3).appId, true)
725− LauncherModel.alert(LauncherModel.get(5).appId, true)
725+ LauncherModel.setAlerting(LauncherModel.get(5).appId, true)
726− LauncherModel.alert(LauncherModel.get(7).appId, true)
726+ LauncherModel.setAlerting(LauncherModel.get(7).appId, true)
727 compare(LauncherModel.get(1).alerting, true, "Alert-state of appId #1 should not be false")
727 compare(LauncherModel.get(1).alerting, true, "Alert-state of appId #1 should not be false")
728 compare(LauncherModel.get(3).alerting, true, "Alert-state of appId #3 should not be false")
728 compare(LauncherModel.get(3).alerting, true, "Alert-state of appId #3 should not be false")
729 compare(LauncherModel.get(5).alerting, true, "Alert-state of appId #5 should not be false")
729 compare(LauncherModel.get(5).alerting, true, "Alert-state of appId #5 should not be false")
730 compare(LauncherModel.get(7).alerting, true, "Alert-state of appId #7 should not be false")
730 compare(LauncherModel.get(7).alerting, true, "Alert-state of appId #7 should not be false")
731− LauncherModel.alert(LauncherModel.get(1).appId, false)
731+ LauncherModel.setAlerting(LauncherModel.get(1).appId, false)
732− LauncherModel.alert(LauncherModel.get(3).appId, false)
732+ LauncherModel.setAlerting(LauncherModel.get(3).appId, false)
733− LauncherModel.alert(LauncherModel.get(5).appId, false)
733+ LauncherModel.setAlerting(LauncherModel.get(5).appId, false)
734− LauncherModel.alert(LauncherModel.get(7).appId, false)
734+ LauncherModel.setAlerting(LauncherModel.get(7).appId, false)
735 compare(LauncherModel.get(1).alerting, false, "Alert-state of appId #1 should not be true")
735 compare(LauncherModel.get(1).alerting, false, "Alert-state of appId #1 should not be true")
736 compare(LauncherModel.get(3).alerting, false, "Alert-state of appId #1 should not be true")
736 compare(LauncherModel.get(3).alerting, false, "Alert-state of appId #1 should not be true")
737 compare(LauncherModel.get(5).alerting, false, "Alert-state of appId #1 should not be true")
737 compare(LauncherModel.get(5).alerting, false, "Alert-state of appId #1 should not be true")
@@ -742,15 +742,15 @@ Item {
742 dragLauncherIntoView();
742 dragLauncherIntoView();
743 var appIcon1 = findChild(launcher, "launcherDelegate1");
743 var appIcon1 = findChild(launcher, "launcherDelegate1");
744 var appIcon7 = findChild(launcher, "launcherDelegate7");
744 var appIcon7 = findChild(launcher, "launcherDelegate7");
745− LauncherModel.alert(LauncherModel.get(1).appId, true)
745+ LauncherModel.setAlerting(LauncherModel.get(1).appId, true)
746 tryCompare(appIcon1, "angle", 0, 1000, "angle of appId #1 should not be non-zero")
746 tryCompare(appIcon1, "angle", 0, 1000, "angle of appId #1 should not be non-zero")
747 waitForWiggleToStart(appIcon1)
747 waitForWiggleToStart(appIcon1)
748− LauncherModel.alert(LauncherModel.get(7).appId, true)
748+ LauncherModel.setAlerting(LauncherModel.get(7).appId, true)
749 tryCompare(appIcon7, "angle", 0, 1000, "angle of appId #7 should not be non-zero")
749 tryCompare(appIcon7, "angle", 0, 1000, "angle of appId #7 should not be non-zero")
750 waitForWiggleToStart(appIcon7)
750 waitForWiggleToStart(appIcon7)
751− LauncherModel.alert(LauncherModel.get(1).appId, false)
751+ LauncherModel.setAlerting(LauncherModel.get(1).appId, false)
752 waitForWiggleToStop(appIcon1)
752 waitForWiggleToStop(appIcon1)
753− LauncherModel.alert(LauncherModel.get(7).appId, false)
753+ LauncherModel.setAlerting(LauncherModel.get(7).appId, false)
754 waitForWiggleToStop(appIcon7)
754 waitForWiggleToStop(appIcon7)
755 }
755 }
756 }
756 }