aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src
diff options
context:
space:
mode:
authorNick Dedekind <nick.dedekind@canonical.com>2015-09-08 12:38:18 +0100
committerNick Dedekind <nick.dedekind@canonical.com>2015-09-08 12:38:18 +0100
commit523db871138277062675db9108cbcb3ca61da5e1 (patch)
tree9a5910fe9cf61e9ab7001ce76130f559a7145b93 /libqmenumodel/src
parente6e4babce2ed63c327f85180d77e24dc6a330c11 (diff)
downloadqmenumodel-523db871138277062675db9108cbcb3ca61da5e1.tar.gz
qmenumodel-523db871138277062675db9108cbcb3ca61da5e1.tar.bz2
qmenumodel-523db871138277062675db9108cbcb3ca61da5e1.zip
accelerators
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp
index 63d5e5b..56d73c6 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -50,7 +50,9 @@ enum MenuRoles {
ActionStateRole,
IsCheckRole,
IsRadioRole,
- IsToggledRole
+ IsToggledRole,
+ KeySequence,
+ HasSubmenu
};
class UnityMenuModelPrivate
@@ -482,6 +484,12 @@ QVariant UnityMenuModel::data(const QModelIndex &index, int role) const
case IsToggledRole:
return gtk_menu_tracker_item_get_toggled (item) == TRUE ? true : false;
+ case KeySequence:
+ return QKeySequence(gtk_menu_tracker_item_get_accel (item), QKeySequence::NativeText);
+
+ case HasSubmenu:
+ return gtk_menu_tracker_item_get_has_submenu (item) == TRUE ? true : false;
+
default:
return QVariant();
}
@@ -513,6 +521,8 @@ QHash<int, QByteArray> UnityMenuModel::roleNames() const
names[IsCheckRole] = "isCheck";
names[IsRadioRole] = "isRadio";
names[IsToggledRole] = "isToggled";
+ names[KeySequence] = "keySequence";
+ names[HasSubmenu] = "hasSubmenu";
return names;
}