aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-08-12 10:55:11 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-08-12 10:55:11 +0200
commit6bd9b6831e7046b5c414840f88aee8002be3cbb6 (patch)
tree0a267b48a38cf96fdb29ecbf73cc5caedbb68d72 /libqmenumodel/src
parent4e1a2603a84117210064e2ef970ce4b81157427c (diff)
downloadqmenumodel-6bd9b6831e7046b5c414840f88aee8002be3cbb6.tar.gz
qmenumodel-6bd9b6831e7046b5c414840f88aee8002be3cbb6.tar.bz2
qmenumodel-6bd9b6831e7046b5c414840f88aee8002be3cbb6.zip
Expose isCheck and isRadio roles
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 08f220e..a164476 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -40,7 +40,9 @@ enum MenuRoles {
IconRole,
TypeRole,
ExtendedAttributesRole,
- ActionRole
+ ActionRole,
+ IsCheckRole,
+ IsRadioRole
};
class UnityMenuModelPrivate
@@ -472,6 +474,12 @@ QVariant UnityMenuModel::data(const QModelIndex &index, int role) const
case ActionRole:
return QVariant::fromValue(new UnityGtkMenuTrackerItemAction(index.row(), priv));
+ case IsCheckRole:
+ return gtk_menu_tracker_item_get_role (item) == GTK_MENU_TRACKER_ITEM_ROLE_CHECK;
+
+ case IsRadioRole:
+ return gtk_menu_tracker_item_get_role (item) == GTK_MENU_TRACKER_ITEM_ROLE_RADIO;
+
default:
return QVariant();
}
@@ -499,6 +507,8 @@ QHash<int, QByteArray> UnityMenuModel::roleNames() const
names[TypeRole] = "type";
names[ExtendedAttributesRole] = "ext";
names[ActionRole] = "action";
+ names[IsCheckRole] = "isCheck";
+ names[IsRadioRole] = "isRadio";
return names;
}