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
=== modified file 'src/Unity/scopes.cpp'
--- src/Unity/scopes.cpp 2013-11-08 17:01:37 +0000
+++ src/Unity/scopes.cpp 2013-11-25 10:49:22 +0000
@@ -36,6 +36,7 @@
36 m_roles[Scopes::RoleScope] = "scope";36 m_roles[Scopes::RoleScope] = "scope";
37 m_roles[Scopes::RoleId] = "id";37 m_roles[Scopes::RoleId] = "id";
38 m_roles[Scopes::RoleVisible] = "visible";38 m_roles[Scopes::RoleVisible] = "visible";
39 m_roles[Scopes::RoleTitle] = "title";
3940
40 m_unityScopes->scope_added.connect(sigc::mem_fun(this, &Scopes::onScopeAdded));41 m_unityScopes->scope_added.connect(sigc::mem_fun(this, &Scopes::onScopeAdded));
41 m_unityScopes->scope_removed.connect(sigc::mem_fun(this, &Scopes::onScopeRemoved));42 m_unityScopes->scope_removed.connect(sigc::mem_fun(this, &Scopes::onScopeRemoved));
@@ -71,6 +72,8 @@
71 return QVariant::fromValue(scope->id());72 return QVariant::fromValue(scope->id());
72 } else if (role == Scopes::RoleVisible) {73 } else if (role == Scopes::RoleVisible) {
73 return QVariant::fromValue(scope->visible());74 return QVariant::fromValue(scope->visible());
75 } else if (role == Scopes::RoleTitle) {
76 return QVariant::fromValue(scope->name());
74 } else {77 } else {
75 return QVariant();78 return QVariant();
76 }79 }
7780
=== modified file 'src/Unity/scopes.h'
--- src/Unity/scopes.h 2013-11-08 17:01:37 +0000
+++ src/Unity/scopes.h 2013-11-25 10:49:22 +0000
@@ -54,7 +54,8 @@
54 enum Roles {54 enum Roles {
55 RoleScope,55 RoleScope,
56 RoleId,56 RoleId,
57 RoleVisible57 RoleVisible,
58 RoleTitle
58 };59 };
5960
60 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;61 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;

Subscribers

People subscribed via source and target branches

to all changes: