Merge lp:~aacid/unity-scopes-shell/addscopestitle into lp:unity-scopes-shell

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michal Hruby
Approved revision: 22
Merged at revision: 22
Proposed branch: lp:~aacid/unity-scopes-shell/addscopestitle
Merge into: lp:unity-scopes-shell
Diff against target: 34 lines (+5/-1)
2 files modified
src/Unity/scopes.cpp (+3/-0)
src/Unity/scopes.h (+2/-1)
To merge this branch: bzr merge lp:~aacid/unity-scopes-shell/addscopestitle
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michal Hruby (community) Approve
Michał Sawicz Approve
Review via email: mp+196514@code.launchpad.net

Commit message

Add a title role

This way this model can be fed directly to the new TabBar api

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

Yup.

review: Approve
Revision history for this message
Michal Hruby (mhr3) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/scopes.cpp'
2--- src/Unity/scopes.cpp 2013-11-08 17:01:37 +0000
3+++ src/Unity/scopes.cpp 2013-11-25 10:49:22 +0000
4@@ -36,6 +36,7 @@
5 m_roles[Scopes::RoleScope] = "scope";
6 m_roles[Scopes::RoleId] = "id";
7 m_roles[Scopes::RoleVisible] = "visible";
8+ m_roles[Scopes::RoleTitle] = "title";
9
10 m_unityScopes->scope_added.connect(sigc::mem_fun(this, &Scopes::onScopeAdded));
11 m_unityScopes->scope_removed.connect(sigc::mem_fun(this, &Scopes::onScopeRemoved));
12@@ -71,6 +72,8 @@
13 return QVariant::fromValue(scope->id());
14 } else if (role == Scopes::RoleVisible) {
15 return QVariant::fromValue(scope->visible());
16+ } else if (role == Scopes::RoleTitle) {
17+ return QVariant::fromValue(scope->name());
18 } else {
19 return QVariant();
20 }
21
22=== modified file 'src/Unity/scopes.h'
23--- src/Unity/scopes.h 2013-11-08 17:01:37 +0000
24+++ src/Unity/scopes.h 2013-11-25 10:49:22 +0000
25@@ -54,7 +54,8 @@
26 enum Roles {
27 RoleScope,
28 RoleId,
29- RoleVisible
30+ RoleVisible,
31+ RoleTitle
32 };
33
34 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;

Subscribers

People subscribed via source and target branches

to all changes: