diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-12 12:33:40 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-12 12:33:40 +0200 |
commit | 94a0809279ae8768fa53e19f9ad06832112b15de (patch) | |
tree | b10ca8f215ce088bda307971411596935dabb601 /libqmenumodel | |
parent | 6914a54029eea5e1c762353d975ac3fad9aabbf4 (diff) | |
download | qmenumodel-94a0809279ae8768fa53e19f9ad06832112b15de.tar.gz qmenumodel-94a0809279ae8768fa53e19f9ad06832112b15de.tar.bz2 qmenumodel-94a0809279ae8768fa53e19f9ad06832112b15de.zip |
Add isToggled role
Diffstat (limited to 'libqmenumodel')
-rw-r--r-- | libqmenumodel/src/unitymenumodel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp index 8045d57..8191dee 100644 --- a/libqmenumodel/src/unitymenumodel.cpp +++ b/libqmenumodel/src/unitymenumodel.cpp @@ -44,7 +44,8 @@ enum MenuRoles { ExtendedAttributesRole, ActionRole, IsCheckRole, - IsRadioRole + IsRadioRole, + IsToggledRole }; class UnityMenuModelPrivate @@ -462,6 +463,9 @@ QVariant UnityMenuModel::data(const QModelIndex &index, int role) const case IsRadioRole: return gtk_menu_tracker_item_get_role (item) == GTK_MENU_TRACKER_ITEM_ROLE_RADIO; + case IsToggledRole: + return gtk_menu_tracker_item_get_toggled (item) == TRUE ? true : false; + default: return QVariant(); } @@ -491,6 +495,7 @@ QHash<int, QByteArray> UnityMenuModel::roleNames() const names[ActionRole] = "action"; names[IsCheckRole] = "isCheck"; names[IsRadioRole] = "isRadio"; + names[IsToggledRole] = "isToggled"; return names; } |