Merge lp:~mardy/qmenumodel/root-index into lp:~phablet-team/qmenumodel/trunk

Proposed by Alberto Mardegan
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 69
Merged at revision: 68
Proposed branch: lp:~mardy/qmenumodel/root-index
Merge into: lp:~phablet-team/qmenumodel/trunk
Diff against target: 12 lines (+3/-0)
1 file modified
libqmenumodel/src/qmenumodel.cpp (+3/-0)
To merge this branch: bzr merge lp:~mardy/qmenumodel/root-index
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
PS Jenkins bot continuous-integration Approve
Mathieu Trudel-Lapierre Abstain
Review via email: mp+164705@code.launchpad.net

Commit message

Use invalid index as root index

When emitting the rowsInserted signal for top-level items, use an invalid
QModelIndex as parent.

Description of the change

Use invalid index as root index

When emitting the rowsInserted signal for top-level items, use an invalid
QModelIndex as parent.
This change is needed by the Ubuntu System Settings project.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Seems fine, but you'd know better. It would be preferable to get another review from others involved directly in qmenumodel..

review: Abstain
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Looks good.
Could you install this on device and check if messaging menu still working?

is not a big deal but could you follow the code style:

if (node == m_root) {
    return QModelIndex();
}
return createIndex(node->position(), 0, node);

lp:~mardy/qmenumodel/root-index updated
69. By Alberto Mardegan

style

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

Hi Renato, I fixed the coding style, and tried the package on my device: the messaging menu still works as before. :-)

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Thanks for the fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libqmenumodel/src/qmenumodel.cpp'
2--- libqmenumodel/src/qmenumodel.cpp 2013-01-10 18:54:35 +0000
3+++ libqmenumodel/src/qmenumodel.cpp 2013-05-23 08:46:26 +0000
4@@ -252,6 +252,9 @@
5 /*! \internal */
6 QModelIndex QMenuModel::indexFromNode(MenuNode *node) const
7 {
8+ if (node == m_root) {
9+ return QModelIndex();
10+ }
11 return createIndex(node->position(), 0, node);
12 }
13

Subscribers

People subscribed via source and target branches