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
=== modified file 'include/unity/shell/launcher/QuickListModelInterface.h'
--- include/unity/shell/launcher/QuickListModelInterface.h 2013-07-08 16:39:41 +0000
+++ include/unity/shell/launcher/QuickListModelInterface.h 2013-08-19 13:29:37 +0000
@@ -37,6 +37,7 @@
37 * The model has the following roles:37 * The model has the following roles:
38 * - RoleLabel (label): The text entry in the QuickList menu (QString).38 * - RoleLabel (label): The text entry in the QuickList menu (QString).
39 * - RoleIcon (icon): The icon to be shown for this entry (QString).39 * - RoleIcon (icon): The icon to be shown for this entry (QString).
40 * - RoleClickable (clickable): Determines if the entry can be triggered or is just a static text (boolean)
40 */41 */
41class UNITY_API QuickListModelInterface: public QAbstractListModel42class UNITY_API QuickListModelInterface: public QAbstractListModel
42{43{
@@ -47,6 +48,7 @@
47 explicit QuickListModelInterface(QObject *parent = 0) : QAbstractListModel(parent) {48 explicit QuickListModelInterface(QObject *parent = 0) : QAbstractListModel(parent) {
48 m_roleNames.insert(RoleLabel, "label");49 m_roleNames.insert(RoleLabel, "label");
49 m_roleNames.insert(RoleIcon, "icon");50 m_roleNames.insert(RoleIcon, "icon");
51 m_roleNames.insert(RoleClickable, "clickable");
50 }52 }
51 /// @endcond53 /// @endcond
52public:54public:
@@ -57,7 +59,8 @@
57 */59 */
58 enum Roles {60 enum Roles {
59 RoleLabel,61 RoleLabel,
60 RoleIcon62 RoleIcon,
63 RoleClickable
61 };64 };
6265
63 /// @cond66 /// @cond
6467
=== modified file 'test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockQuickListModel.cpp'
--- test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockQuickListModel.cpp 2013-07-04 17:17:46 +0000
+++ test/qmltest/mocks/plugins/Unity/Launcher/Mocks/MockQuickListModel.cpp 2013-08-19 13:29:37 +0000
@@ -35,6 +35,8 @@
35 return QLatin1String("test menu entry ") + QString::number(index.row());35 return QLatin1String("test menu entry ") + QString::number(index.row());
36 case RoleIcon:36 case RoleIcon:
37 return QLatin1String("copy.png");37 return QLatin1String("copy.png");
38 case RoleClickable:
39 return true;
38 }40 }
39 return QVariant();41 return QVariant();
40}42}
4143
=== modified file 'test/qmltest/unity/shell/launcher/tst_Launcher.qml'
--- test/qmltest/unity/shell/launcher/tst_Launcher.qml 2013-07-08 16:41:21 +0000
+++ test/qmltest/unity/shell/launcher/tst_Launcher.qml 2013-08-19 13:29:37 +0000
@@ -147,6 +147,7 @@
147 return [147 return [
148 { tag: "Model.roles[label]", role: "label", type: "string" },148 { tag: "Model.roles[label]", role: "label", type: "string" },
149 { tag: "Model.roles[icon]", role: "icon", type: "string" },149 { tag: "Model.roles[icon]", role: "icon", type: "string" },
150 { tag: "Model.roles[clickable]", role: "clickable", type: "boolean" },
150 ];151 ];
151 }152 }
152153

Subscribers

People subscribed via source and target branches

to all changes: