diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-09 13:33:39 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-08-09 13:33:39 +0200 |
commit | 4e1a2603a84117210064e2ef970ce4b81157427c (patch) | |
tree | 664ca4e51960e290cd86dd156490452f16173e73 /libqmenumodel/src | |
parent | 08a5bb3a2037a4c47059a4be1165874fa81c6a62 (diff) | |
download | qmenumodel-4e1a2603a84117210064e2ef970ce4b81157427c.tar.gz qmenumodel-4e1a2603a84117210064e2ef970ce4b81157427c.tar.bz2 qmenumodel-4e1a2603a84117210064e2ef970ce4b81157427c.zip |
Add parameter to unitymenumodel.action.activate
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r-- | libqmenumodel/src/unitymenuaction.h | 2 | ||||
-rw-r--r-- | libqmenumodel/src/unitymenumodel.cpp | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libqmenumodel/src/unitymenuaction.h b/libqmenumodel/src/unitymenuaction.h index ef844fd..bcbb50d 100644 --- a/libqmenumodel/src/unitymenuaction.h +++ b/libqmenumodel/src/unitymenuaction.h @@ -46,7 +46,7 @@ public: virtual QVariant state() const = 0; - Q_INVOKABLE virtual void activate() = 0; + Q_INVOKABLE virtual void activate(const QVariant ¶meter) = 0; Q_INVOKABLE virtual void changeState(const QVariant& vvalue) = 0; diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp index 9b62eee..08f220e 100644 --- a/libqmenumodel/src/unitymenumodel.cpp +++ b/libqmenumodel/src/unitymenumodel.cpp @@ -104,14 +104,18 @@ public: return d->itemState(item); } - virtual void activate() + virtual void activate(const QVariant ¶meter) { GtkMenuTrackerItem* item; + gchar *action; item = (GtkMenuTrackerItem *) g_sequence_get (g_sequence_get_iter_at_pos (d->items, index())); if (!item) return; - gtk_menu_tracker_item_activated (item); + gtk_menu_tracker_item_get_attribute (item, "action", "s", &action); + g_action_group_activate_action (G_ACTION_GROUP (d->muxer), action, Converter::toGVariant(parameter)); + + g_free (action); } virtual void changeState(const QVariant& vvalue) |