Merge lp:~mzanetti/unity-api/launcher-quicklist-add-hasAction into lp:unity-api

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Sawicz
Approved revision: 83
Merged at revision: 82
Proposed branch: lp:~mzanetti/unity-api/launcher-quicklist-add-hasAction
Merge into: lp:unity-api
Diff against target: 53 lines (+7/-1)
3 files modified
include/unity/shell/launcher/QuickListModelInterface.h (+4/-1)
test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockQuickListModel.cpp (+2/-0)
test/qmltest/unity/shell/launcher/tst_Launcher.qml (+1/-0)
To merge this branch: bzr merge lp:~mzanetti/unity-api/launcher-quicklist-add-hasAction
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+180864@code.launchpad.net

Commit message

Add a role, clickable to quicklistModel which determines if the entry can be clicked or not.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
83. By Michael Zanetti

HasAction -> Clickable

Revision history for this message
Michał Sawicz (saviq) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/unity/shell/launcher/QuickListModelInterface.h'
2--- include/unity/shell/launcher/QuickListModelInterface.h 2013-07-08 16:39:41 +0000
3+++ include/unity/shell/launcher/QuickListModelInterface.h 2013-08-19 13:29:37 +0000
4@@ -37,6 +37,7 @@
5 * The model has the following roles:
6 * - RoleLabel (label): The text entry in the QuickList menu (QString).
7 * - RoleIcon (icon): The icon to be shown for this entry (QString).
8+ * - RoleClickable (clickable): Determines if the entry can be triggered or is just a static text (boolean)
9 */
10 class UNITY_API QuickListModelInterface: public QAbstractListModel
11 {
12@@ -47,6 +48,7 @@
13 explicit QuickListModelInterface(QObject *parent = 0) : QAbstractListModel(parent) {
14 m_roleNames.insert(RoleLabel, "label");
15 m_roleNames.insert(RoleIcon, "icon");
16+ m_roleNames.insert(RoleClickable, "clickable");
17 }
18 /// @endcond
19 public:
20@@ -57,7 +59,8 @@
21 */
22 enum Roles {
23 RoleLabel,
24- RoleIcon
25+ RoleIcon,
26+ RoleClickable
27 };
28
29 /// @cond
30
31=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockQuickListModel.cpp'
32--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockQuickListModel.cpp 2013-07-04 17:17:46 +0000
33+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockQuickListModel.cpp 2013-08-19 13:29:37 +0000
34@@ -35,6 +35,8 @@
35 return QLatin1String("test menu entry ") + QString::number(index.row());
36 case RoleIcon:
37 return QLatin1String("copy.png");
38+ case RoleClickable:
39+ return true;
40 }
41 return QVariant();
42 }
43
44=== modified file 'test/qmltest/unity/shell/launcher/tst_Launcher.qml'
45--- test/qmltest/unity/shell/launcher/tst_Launcher.qml 2013-07-08 16:41:21 +0000
46+++ test/qmltest/unity/shell/launcher/tst_Launcher.qml 2013-08-19 13:29:37 +0000
47@@ -147,6 +147,7 @@
48 return [
49 { tag: "Model.roles[label]", role: "label", type: "string" },
50 { tag: "Model.roles[icon]", role: "icon", type: "string" },
51+ { tag: "Model.roles[clickable]", role: "clickable", type: "boolean" },
52 ];
53 }
54

Subscribers

People subscribed via source and target branches

to all changes: