aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-25 20:27:12 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-10-25 20:27:12 +0200
commit64a2113a109dc9eb7644b82b5e5503c1147f1ccf (patch)
tree26842f05848f4bf3ec8e7a6f64bc3b83e94bd1fd
parent64ac22dc0d80ab3d44fe0fa08cbc517a5bc6b1bd (diff)
parent0d1bfd69b848b2c86b48a3de198bc7dad9c96441 (diff)
downloadqmenumodel-64a2113a109dc9eb7644b82b5e5503c1147f1ccf.tar.gz
qmenumodel-64a2113a109dc9eb7644b82b5e5503c1147f1ccf.tar.bz2
qmenumodel-64a2113a109dc9eb7644b82b5e5503c1147f1ccf.zip
Merged variant-string-parser into converter-improvements.
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp
index 5e8c8e3..aac1d92 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -661,7 +661,7 @@ bool UnityMenuModel::loadExtendedAttributes(int position, const QVariantMap &sch
continue;
}
- QVariant qvalue = attributeToQVariant(value, type);
+ const QVariant &qvalue = attributeToQVariant(value, type);
if (qvalue.isValid())
extendedAttrs->insert(qtify_name (name.toUtf8()), qvalue);
else
@@ -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 {