diff options
Diffstat (limited to 'libqmenumodel')
-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) |