diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-09 13:06:10 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-09 13:06:10 +0200 |
commit | 08a5bb3a2037a4c47059a4be1165874fa81c6a62 (patch) | |
tree | 03dd403f5737b764ff0ff6e6b700598f97eccb88 /libqmenumodel/src | |
parent | 73223bd13a14860433a65bec186057d044b4a8e5 (diff) | |
download | qmenumodel-08a5bb3a2037a4c47059a4be1165874fa81c6a62.tar.gz qmenumodel-08a5bb3a2037a4c47059a4be1165874fa81c6a62.tar.bz2 qmenumodel-08a5bb3a2037a4c47059a4be1165874fa81c6a62.zip |
Re-add UnityMenuModel::activate()
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r-- | libqmenumodel/src/unitymenumodel.cpp | 8 | ||||
-rw-r--r-- | libqmenumodel/src/unitymenumodel.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp index 5226747..9b62eee 100644 --- a/libqmenumodel/src/unitymenumodel.cpp +++ b/libqmenumodel/src/unitymenumodel.cpp @@ -639,3 +639,11 @@ QVariant UnityMenuModel::get(int row, const QByteArray &role) return this->data(this->index(row, 0), priv->roles[role]); } + +void UnityMenuModel::activate(int index) +{ + GtkMenuTrackerItem *item; + + item = (GtkMenuTrackerItem *) g_sequence_get (g_sequence_get_iter_at_pos (priv->items, index)); + gtk_menu_tracker_item_activated (item); +} diff --git a/libqmenumodel/src/unitymenumodel.h b/libqmenumodel/src/unitymenumodel.h index 5401331..79dbaa9 100644 --- a/libqmenumodel/src/unitymenumodel.h +++ b/libqmenumodel/src/unitymenumodel.h @@ -57,6 +57,7 @@ public: Q_INVOKABLE QObject * submenu(int position, QQmlComponent* actionStateParser = NULL); Q_INVOKABLE bool loadExtendedAttributes(int position, const QVariantMap &schema); Q_INVOKABLE QVariant get(int row, const QByteArray &role); + Q_INVOKABLE void activate(int index); Q_SIGNALS: void busNameChanged(const QByteArray &name); |