aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-25 19:57:38 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-25 19:57:38 +0200
commit307efb494989e3be1086731dc591c886d5f57583 (patch)
tree6a597b4fd6a16f348ae88c885a30d3a66c91ec21
parentc314929116d21057b5fae27c4a929c75d17d6183 (diff)
downloadqmenumodel-307efb494989e3be1086731dc591c886d5f57583.tar.gz
qmenumodel-307efb494989e3be1086731dc591c886d5f57583.tar.bz2
qmenumodel-307efb494989e3be1086731dc591c886d5f57583.zip
UnityMenuModel: use conversion with gschema in unity actions
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp
index 5e8c8e3..695d053 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -692,6 +692,8 @@ void UnityMenuModel::activate(int index, const QVariant& parameter)
{
GSequenceIter *it;
GtkMenuTrackerItem *item;
+ GVariant *value;
+ const GVariantType *parameter_type;
it = g_sequence_get_iter_at_pos (priv->items, index);
if (g_sequence_iter_is_end (it)) {
@@ -707,7 +709,9 @@ void UnityMenuModel::activate(int index, const QVariant& parameter)
gchar *action;
action = gtk_menu_tracker_item_get_action_name (item);
- g_action_group_activate_action (G_ACTION_GROUP (priv->muxer), action, Converter::toGVariant(parameter));
+ parameter_type = g_action_group_get_action_parameter_type (G_ACTION_GROUP (priv->muxer), action);
+ value = Converter::toGVariantWithSchema(parameter, g_variant_type_peek_string (parameter_type));
+ g_action_group_activate_action (G_ACTION_GROUP (priv->muxer), action, value);
g_free (action);
} else {