aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-08-12 12:33:40 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-08-12 12:33:40 +0200
commit94a0809279ae8768fa53e19f9ad06832112b15de (patch)
treeb10ca8f215ce088bda307971411596935dabb601
parent6914a54029eea5e1c762353d975ac3fad9aabbf4 (diff)
downloadqmenumodel-94a0809279ae8768fa53e19f9ad06832112b15de.tar.gz
qmenumodel-94a0809279ae8768fa53e19f9ad06832112b15de.tar.bz2
qmenumodel-94a0809279ae8768fa53e19f9ad06832112b15de.zip
Add isToggled role
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp7
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;
}