on xenial help sign in
hide "private" launcher quicklist entries when the greeter is locked (LP: #1667649)
d7adde7Michael Zanetti
CMakeLists.txt+1−1
@@ -74,7 +74,7 @@ pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=26)
74pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
74pkg_check_modules(GEONAMES REQUIRED geonames>=0.2)
75pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
75pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
76pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
76pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
77−pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=11)
77+pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=12)
78pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
78pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
79pkg_check_modules(GD3 REQUIRED gnome-desktop-3.0)
79pkg_check_modules(GD3 REQUIRED gnome-desktop-3.0)
80pkg_check_modules(UAL REQUIRED ubuntu-app-launch-3)
80pkg_check_modules(UAL REQUIRED ubuntu-app-launch-3)
debian/control+3−3
@@ -38,7 +38,7 @@ Build-Depends: cmake,
38 libubuntugestures5-private-dev (>= 1.3.2030),
38 libubuntugestures5-private-dev (>= 1.3.2030),
39 libudev-dev,
39 libudev-dev,
40 libudm-common-dev,
40 libudm-common-dev,
41− libunity-api-dev (>= 8.2),
41+ libunity-api-dev (>= 8.5),
42 libusermetricsoutput1-dev,
42 libusermetricsoutput1-dev,
43# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
43# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
44 libx11-dev[!arm64 !armhf],
44 libx11-dev[!arm64 !armhf],
@@ -132,7 +132,7 @@ Depends: dmz-cursor-theme,
132 qtdeclarative5-qtmir-plugin (>= 0.4.8),
132 qtdeclarative5-qtmir-plugin (>= 0.4.8),
133 qtdeclarative5-ubuntu-telephony0.1,
133 qtdeclarative5-ubuntu-telephony0.1,
134 ubuntu-system-settings (>= 0.4),
134 ubuntu-system-settings (>= 0.4),
135− unity-launcher-impl-10,
135+ unity-launcher-impl-12,
136 unity8-common (= ${source:Version}),
136 unity8-common (= ${source:Version}),
137 unity8-private (= ${binary:Version}),
137 unity8-private (= ${binary:Version}),
138 unity8-private | unity-launcher-impl,
138 unity8-private | unity-launcher-impl,
@@ -235,7 +235,7 @@ Depends: accountsservice-ubuntu-schemas (>= 0.0.7),
235 ${misc:Depends},
235 ${misc:Depends},
236 ${shlibs:Depends},
236 ${shlibs:Depends},
237Provides: unity-launcher-impl,
237Provides: unity-launcher-impl,
238− unity-launcher-impl-10,
238+ unity-launcher-impl-12,
239Description: Unity 8 private libs
239Description: Unity 8 private libs
240 The Unity 8 shell is the primary user interface for Ubuntu devices.
240 The Unity 8 shell is the primary user interface for Ubuntu devices.
241 .
241 .
plugins/Greeter/Unity/Launcher/quicklistmodel.cpp+2
@@ -65,6 +65,8 @@ QVariant QuickListModel::data(const QModelIndex &index, int role) const
65 return m_list.at(index.row()).icon();
65 return m_list.at(index.row()).icon();
66 case RoleClickable:
66 case RoleClickable:
67 return m_list.at(index.row()).clickable();
67 return m_list.at(index.row()).clickable();
68+ case RoleIsPrivate:
69+ return false; // The greeter plugin would just not add any private entries
68 }
70 }
69 return QVariant();
71 return QVariant();
70}
72}
plugins/Unity/Launcher/launcheritem.cpp+3
@@ -48,11 +48,13 @@ LauncherItem::LauncherItem(const QString &appId, const QString &name, const QStr
48 QuickListEntry pinningAction;
48 QuickListEntry pinningAction;
49 pinningAction.setActionId(QStringLiteral("pin_item"));
49 pinningAction.setActionId(QStringLiteral("pin_item"));
50 pinningAction.setText(gettext("Pin shortcut"));
50 pinningAction.setText(gettext("Pin shortcut"));
51+ pinningAction.setIsPrivate(true);
51 m_quickList->appendAction(pinningAction);
52 m_quickList->appendAction(pinningAction);
52
53
53 m_quitAction.setActionId(QStringLiteral("stop_item"));
54 m_quitAction.setActionId(QStringLiteral("stop_item"));
54 m_quitAction.setIcon(QStringLiteral("application-exit"));
55 m_quitAction.setIcon(QStringLiteral("application-exit"));
55 m_quitAction.setText(gettext("Quit"));
56 m_quitAction.setText(gettext("Quit"));
57+ m_quitAction.setIsPrivate(true);
56}
58}
57
59
58QString LauncherItem::appId() const
60QString LauncherItem::appId() const
@@ -120,6 +122,7 @@ void LauncherItem::setPinned(bool pinned)
120 QuickListEntry entry;
122 QuickListEntry entry;
121 entry.setActionId(QStringLiteral("pin_item"));
123 entry.setActionId(QStringLiteral("pin_item"));
122 entry.setText(pinned ? gettext("Unpin shortcut") : gettext("Pin shortcut"));
124 entry.setText(pinned ? gettext("Unpin shortcut") : gettext("Pin shortcut"));
125+ entry.setIsPrivate(true);
123 m_quickList->updateAction(entry);
126 m_quickList->updateAction(entry);
124}
127}
125
128
plugins/Unity/Launcher/quicklistentry.cpp+11
@@ -20,6 +20,7 @@
20
20
21QuickListEntry::QuickListEntry()
21QuickListEntry::QuickListEntry()
22 : m_hasSeparator(false)
22 : m_hasSeparator(false)
23+ , m_isPrivate(false)
23{
24{
24}
25}
25
26
@@ -72,3 +73,13 @@ bool QuickListEntry::operator==(const QuickListEntry &other)
72{
73{
73 return !other.actionId().isEmpty() && other.actionId() == m_actionId;
74 return !other.actionId().isEmpty() && other.actionId() == m_actionId;
74}
75}
76+
77+bool QuickListEntry::isPrivate() const
78+{
79+ return m_isPrivate;
80+}
81+
82+void QuickListEntry::setIsPrivate(bool isPrivate)
83+{
84+ m_isPrivate = isPrivate;
85+}
plugins/Unity/Launcher/quicklistentry.h+4
@@ -42,11 +42,15 @@ public:
42
42
43 bool operator==(const QuickListEntry & other);
43 bool operator==(const QuickListEntry & other);
44
44
45+ bool isPrivate() const;
46+ void setIsPrivate(bool isPrivate);
47+
45private:
48private:
46 QString m_actionId;
49 QString m_actionId;
47 QString m_text;
50 QString m_text;
48 QString m_icon;
51 QString m_icon;
49 bool m_hasSeparator;
52 bool m_hasSeparator;
53+ bool m_isPrivate;
50};
54};
51
55
52#endif // QUICKLISTENTRY
56#endif // QUICKLISTENTRY
plugins/Unity/Launcher/quicklistmodel.cpp+2
@@ -81,6 +81,8 @@ QVariant QuickListModel::data(const QModelIndex &index, int role) const
81 return m_list.at(index.row()).clickable();
81 return m_list.at(index.row()).clickable();
82 case RoleHasSeparator:
82 case RoleHasSeparator:
83 return m_list.at(index.row()).hasSeparator();
83 return m_list.at(index.row()).hasSeparator();
84+ case RoleIsPrivate:
85+ return m_list.at(index.row()).isPrivate();
84 }
86 }
85 return QVariant();
87 return QVariant();
86}
88}
plugins/Utils/CMakeLists.txt+1
@@ -36,6 +36,7 @@ set(QMLPLUGIN_SRC
36 URLDispatcher.cpp
36 URLDispatcher.cpp
37 tabfocusfence.cpp
37 tabfocusfence.cpp
38 expressionfiltermodel.cpp
38 expressionfiltermodel.cpp
39+ quicklistproxymodel.cpp
39 plugin.cpp
40 plugin.cpp
40 )
41 )
41
42
plugins/Utils/plugin.cpp+2
@@ -42,6 +42,7 @@
42#include "appdrawerproxymodel.h"
42#include "appdrawerproxymodel.h"
43#include "tabfocusfence.h"
43#include "tabfocusfence.h"
44#include "expressionfiltermodel.h"
44#include "expressionfiltermodel.h"
45+#include "quicklistproxymodel.h"
45
46
46static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
47static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
47{
48{
@@ -88,4 +89,5 @@ void UtilsPlugin::registerTypes(const char *uri)
88 qmlRegisterType<AppDrawerProxyModel>(uri, 0, 1, "AppDrawerProxyModel");
89 qmlRegisterType<AppDrawerProxyModel>(uri, 0, 1, "AppDrawerProxyModel");
89 qmlRegisterType<TabFocusFenceItem>(uri, 0, 1, "TabFocusFence");
90 qmlRegisterType<TabFocusFenceItem>(uri, 0, 1, "TabFocusFence");
90 qmlRegisterType<ExpressionFilterModel>(uri, 0, 1, "ExpressionFilterModel");
91 qmlRegisterType<ExpressionFilterModel>(uri, 0, 1, "ExpressionFilterModel");
92+ qmlRegisterType<QuickListProxyModel>(uri, 0, 1, "QuickListProxyModel");
91}
93}
plugins/Utils/quicklistproxymodel.cppnew file+72
@@ -0,0 +1,72 @@
1+/*
2+ * Copyright (C) 2017 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include "quicklistproxymodel.h"
18+
19+#include <QDebug>
20+
21+QuickListProxyModel::QuickListProxyModel(QObject *parent):
22+ QSortFilterProxyModel(parent)
23+{
24+ connect(this, &QAbstractListModel::rowsInserted, this, &QuickListProxyModel::countChanged);
25+ connect(this, &QAbstractListModel::rowsRemoved, this, &QuickListProxyModel::countChanged);
26+ connect(this, &QAbstractListModel::layoutChanged, this, &QuickListProxyModel::countChanged);
27+}
28+
29+QAbstractItemModel *QuickListProxyModel::source() const
30+{
31+ return m_source;
32+}
33+
34+bool QuickListProxyModel::privateMode() const
35+{
36+ return m_privateMode;
37+}
38+
39+void QuickListProxyModel::setPrivateMode(bool privateMode)
40+{
41+ if (m_privateMode != privateMode) {
42+ m_privateMode = privateMode;
43+ invalidateFilter();
44+ Q_EMIT privateModeChanged();
45+ }
46+}
47+
48+void QuickListProxyModel::setSource(QAbstractItemModel *source)
49+{
50+ if (m_source != source) {
51+ m_source = source;
52+ setSourceModel(m_source);
53+ connect(m_source, &QAbstractItemModel::rowsRemoved, this, &QuickListProxyModel::invalidate);
54+ connect(m_source, &QAbstractItemModel::rowsInserted, this, &QuickListProxyModel::invalidate);
55+ Q_EMIT sourceChanged();
56+ }
57+}
58+
59+int QuickListProxyModel::count() const
60+{
61+ return rowCount();
62+}
63+
64+bool QuickListProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
65+{
66+ Q_UNUSED(source_parent)
67+
68+ if (m_privateMode) {
69+ return !m_source->data(m_source->index(source_row, 0), QuickListModelInterface::RoleIsPrivate).toBool();
70+ }
71+ return true;
72+}
plugins/Utils/quicklistproxymodel.hnew file+52
@@ -0,0 +1,52 @@
1+/*
2+ * Copyright (C) 2017 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+#include <QSortFilterProxyModel>
18+
19+#include <unity/shell/launcher/QuickListModelInterface.h>
20+
21+using namespace unity::shell::launcher;
22+
23+class QuickListProxyModel: public QSortFilterProxyModel
24+{
25+ Q_OBJECT
26+ Q_PROPERTY(QAbstractItemModel* source READ source WRITE setSource NOTIFY sourceChanged)
27+ Q_PROPERTY(bool privateMode READ privateMode WRITE setPrivateMode NOTIFY privateModeChanged)
28+ Q_PROPERTY(int count READ count NOTIFY countChanged)
29+
30+public:
31+ QuickListProxyModel(QObject* parent = nullptr);
32+
33+ QAbstractItemModel* source() const;
34+ void setSource(QAbstractItemModel* source);
35+
36+ bool privateMode() const;
37+ void setPrivateMode(bool privateMode);
38+
39+ int count() const;
40+
41+protected:
42+ bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
43+
44+Q_SIGNALS:
45+ void sourceChanged();
46+ void privateModeChanged();
47+ void countChanged();
48+
49+private:
50+ QAbstractItemModel* m_source = nullptr;
51+ bool m_privateMode;
52+};
qml/Launcher/Launcher.qml+1
@@ -33,6 +33,7 @@ FocusScope {
33 property Item blurSource: null
33 property Item blurSource: null
34 property int topPanelHeight: 0
34 property int topPanelHeight: 0
35 property bool drawerEnabled: true
35 property bool drawerEnabled: true
36+ property alias privateMode: panel.privateMode
36
37
37 property int panelWidth: units.gu(10)
38 property int panelWidth: units.gu(10)
38 property int dragAreaWidth: units.gu(1)
39 property int dragAreaWidth: units.gu(1)
qml/Launcher/LauncherPanel.qml+7−1
@@ -19,6 +19,7 @@ import QtQml.StateMachine 1.0 as DSM
19import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
20import Unity.Launcher 0.1
20import Unity.Launcher 0.1
21import Ubuntu.Components.Popups 1.3
21import Ubuntu.Components.Popups 1.3
22+import Utils 0.1
22import "../Components"
23import "../Components"
23
24
24Rectangle {
25Rectangle {
@@ -29,6 +30,7 @@ Rectangle {
29
30
30 property var model
31 property var model
31 property bool inverted: false
32 property bool inverted: false
33+ property bool privateMode: false
32 property bool dragging: false
34 property bool dragging: false
33 property bool moving: launcherListView.moving || launcherListView.flicking
35 property bool moving: launcherListView.moving || launcherListView.flicking
34 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
36 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
@@ -811,7 +813,11 @@ Rectangle {
811
813
812 Repeater {
814 Repeater {
813 id: popoverRepeater
815 id: popoverRepeater
814− model: quickList.model
816+ objectName: "popoverRepeater"
817+ model: QuickListProxyModel {
818+ source: quickList.model
819+ privateMode: root.privateMode
820+ }
815
821
816 ListItem {
822 ListItem {
817 objectName: "quickListEntry" + index
823 objectName: "quickListEntry" + index
qml/Shell.qml+1
@@ -561,6 +561,7 @@ StyledItem {
561 blurSource: greeter.shown ? greeter : stages
561 blurSource: greeter.shown ? greeter : stages
562 topPanelHeight: panel.panelHeight
562 topPanelHeight: panel.panelHeight
563 drawerEnabled: !greeter.active
563 drawerEnabled: !greeter.active
564+ privateMode: greeter.active
564
565
565 onShowDashHome: showHome()
566 onShowDashHome: showHome()
566 onLauncherApplicationSelected: {
567 onLauncherApplicationSelected: {
tests/mocks/Unity/Launcher/MockLauncherModel.h+1−1
@@ -28,7 +28,7 @@ using namespace unity::shell::launcher;
28
28
29class MockLauncherModel: public LauncherModelInterface
29class MockLauncherModel: public LauncherModelInterface
30{
30{
31− Q_OBJECT
31+ Q_OBJECT
32
32
33public:
33public:
34 MockLauncherModel(QObject* parent = 0);
34 MockLauncherModel(QObject* parent = 0);
tests/mocks/Unity/Launcher/MockQuickListModel.cpp+3−1
@@ -39,6 +39,8 @@ QVariant MockQuickListModel::data(const QModelIndex &index, int role) const
39 return index.row() == 1 ? false : true;
39 return index.row() == 1 ? false : true;
40 case RoleHasSeparator:
40 case RoleHasSeparator:
41 return index.row() <= 1 ? true : false;
41 return index.row() <= 1 ? true : false;
42+ case RoleIsPrivate:
43+ return index.row() == 4 ? true : false;
42 }
44 }
43 return QVariant();
45 return QVariant();
44}
46}
@@ -46,5 +48,5 @@ QVariant MockQuickListModel::data(const QModelIndex &index, int role) const
46int MockQuickListModel::rowCount(const QModelIndex &parent) const
48int MockQuickListModel::rowCount(const QModelIndex &parent) const
47{
49{
48 Q_UNUSED(parent)
50 Q_UNUSED(parent)
49− return 4;
51+ return 5;
50}
52}
tests/mocks/Unity/Launcher/MockQuickListModel.h+2
@@ -27,6 +27,8 @@ using namespace unity::shell::launcher;
27class MockQuickListModel: public QuickListModelInterface
27class MockQuickListModel: public QuickListModelInterface
28{
28{
29 Q_OBJECT
29 Q_OBJECT
30+ Q_PROPERTY(int count READ rowCount)
31+
30public:
32public:
31 MockQuickListModel(QObject *parent = 0);
33 MockQuickListModel(QObject *parent = 0);
32
34
tests/mocks/Utils/CMakeLists.txt+2
@@ -27,6 +27,7 @@ set(QMLPLUGIN_SRC
27 ${CMAKE_SOURCE_DIR}/plugins/Utils/appdrawerproxymodel.cpp
27 ${CMAKE_SOURCE_DIR}/plugins/Utils/appdrawerproxymodel.cpp
28 ${CMAKE_SOURCE_DIR}/plugins/Utils/tabfocusfence.cpp
28 ${CMAKE_SOURCE_DIR}/plugins/Utils/tabfocusfence.cpp
29 ${CMAKE_SOURCE_DIR}/plugins/Utils/expressionfiltermodel.cpp
29 ${CMAKE_SOURCE_DIR}/plugins/Utils/expressionfiltermodel.cpp
30+ ${CMAKE_SOURCE_DIR}/plugins/Utils/quicklistproxymodel.cpp
30 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
31 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h
31 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
32 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h
32 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceInterface.h
33 ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirSurfaceInterface.h
@@ -35,6 +36,7 @@ set(QMLPLUGIN_SRC
35 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/AppDrawerModelInterface.h
36 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/AppDrawerModelInterface.h
36 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherModelInterface.h
37 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherModelInterface.h
37 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherItemInterface.h
38 ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/LauncherItemInterface.h
39+ ${LAUNCHER_API_INCLUDEDIR}/unity/shell/launcher/QuickListModelInterface.h
38 constants.cpp
40 constants.cpp
39 plugin.cpp
41 plugin.cpp
40 windowstatestorage.cpp
42 windowstatestorage.cpp
tests/mocks/Utils/plugin.cpp+2
@@ -43,6 +43,7 @@
43#include <appdrawerproxymodel.h>
43#include <appdrawerproxymodel.h>
44#include <tabfocusfence.h>
44#include <tabfocusfence.h>
45#include <expressionfiltermodel.h>
45#include <expressionfiltermodel.h>
46+#include <quicklistproxymodel.h>
46
47
47static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
48static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
48{
49{
@@ -88,4 +89,5 @@ void FakeUtilsPlugin::registerTypes(const char *uri)
88 qmlRegisterType<AppDrawerProxyModel>(uri, 0, 1, "AppDrawerProxyModel");
89 qmlRegisterType<AppDrawerProxyModel>(uri, 0, 1, "AppDrawerProxyModel");
89 qmlRegisterType<TabFocusFenceItem>(uri, 0, 1, "TabFocusFence");
90 qmlRegisterType<TabFocusFenceItem>(uri, 0, 1, "TabFocusFence");
90 qmlRegisterType<ExpressionFilterModel>(uri, 0, 1, "ExpressionFilterModel");
91 qmlRegisterType<ExpressionFilterModel>(uri, 0, 1, "ExpressionFilterModel");
92+ qmlRegisterType<QuickListProxyModel>(uri, 0, 1, "QuickListProxyModel");
91}
93}
tests/qmltests/Launcher/tst_Launcher.qml+42
@@ -95,6 +95,11 @@ Rectangle {
95 property: "lockedVisible"
95 property: "lockedVisible"
96 value: lockedVisibleCheckBox.checked
96 value: lockedVisibleCheckBox.checked
97 }
97 }
98+ Binding {
99+ target: launcherLoader.item
100+ property: "privateMode"
101+ value: privateModeCheckBox.checked
102+ }
98 Binding {
103 Binding {
99 target: launcherLoader.item
104 target: launcherLoader.item
100 property: "panelWidth"
105 property: "panelWidth"
@@ -120,6 +125,20 @@ Rectangle {
120 }
125 }
121 }
126 }
122
127
128+ RowLayout {
129+ CheckBox {
130+ id: privateModeCheckBox
131+ checked: false
132+ }
133+ Label {
134+ text: "Private mode (lockscreen locked)"
135+ AbstractButton {
136+ anchors.fill: parent
137+ onClicked: privateModeCheckBox.checked = !privateModeCheckBox.checked
138+ }
139+ }
140+ }
141+
123 Slider {
142 Slider {
124 id: widthSlider
143 id: widthSlider
125 Layout.fillWidth: true
144 Layout.fillWidth: true
@@ -1242,6 +1261,7 @@ Rectangle {
1242 keyClick(Qt.Key_Down);
1261 keyClick(Qt.Key_Down);
1243 keyClick(Qt.Key_Down);
1262 keyClick(Qt.Key_Down);
1244 keyClick(Qt.Key_Down);
1263 keyClick(Qt.Key_Down);
1264+ keyClick(Qt.Key_Down);
1245 tryCompare(quickList, "selectedIndex", 0)
1265 tryCompare(quickList, "selectedIndex", 0)
1246
1266
1247 // Left gets us back to the launcher
1267 // Left gets us back to the launcher
@@ -1493,6 +1513,28 @@ Rectangle {
1493 compare(launcher.state, "visibleTemporary");
1513 compare(launcher.state, "visibleTemporary");
1494 }
1514 }
1495
1515
1516+ function test_hideQuicklistItemsInPrivateModel_data() {
1517+ return [
1518+ { tag: "private mode", private: true },
1519+ { tag: "normal mode", private: false }
1520+ ];
1521+ }
1522+
1523+ function test_hideQuicklistItemsInPrivateModel(data) {
1524+ privateModeCheckBox.checked = data.private;
1525+
1526+ revealByEdgePush();
1527+
1528+ var item = findChild(launcher, "launcherDelegate4");
1529+ var quickListShape = findChild(launcher, "quickListShape")
1530+
1531+ mousePress(item)
1532+ tryCompare(quickListShape, "visible", true)
1533+
1534+ var repeater = findChild(launcher, "popoverRepeater");
1535+ tryCompare(repeater, "count", LauncherModel.get(4).quickList.count - (data.private ? 1 : 0))
1536+ }
1537+
1496 function test_hintOnSizeChange() {
1538 function test_hintOnSizeChange() {
1497 var oldSize = launcher.panelWidth;
1539 var oldSize = launcher.panelWidth;
1498 launcher.maxPanelX = -launcher.panelWidth;
1540 launcher.maxPanelX = -launcher.panelWidth;