aboutsummaryrefslogtreecommitdiff
path: root/src/idoprogressmenuitem.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-12-04 14:26:11 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-12-04 14:26:11 +0100
commit1545345255210e8fbf781c2bbebcdd49fa5a87cd (patch)
tree0af826edcc3fa90ae163e4b1f089775f9586922e /src/idoprogressmenuitem.c
parent0ab4079b28220f4051f8d0935a976e550514ad7f (diff)
downloadayatana-ido-1545345255210e8fbf781c2bbebcdd49fa5a87cd.tar.gz
ayatana-ido-1545345255210e8fbf781c2bbebcdd49fa5a87cd.tar.bz2
ayatana-ido-1545345255210e8fbf781c2bbebcdd49fa5a87cd.zip
Port from Glib's g_object_newv to g_object_new_with_properties.
Diffstat (limited to 'src/idoprogressmenuitem.c')
-rw-r--r--src/idoprogressmenuitem.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/idoprogressmenuitem.c b/src/idoprogressmenuitem.c
index 4fda202..004682e 100644
--- a/src/idoprogressmenuitem.c
+++ b/src/idoprogressmenuitem.c
@@ -58,25 +58,29 @@ ido_progress_menu_item_new_from_model (GMenuItem * menu_item,
guint n;
gchar * str;
IdoBasicMenuItem * ido_menu_item;
- GParameter parameters[4];
+ const gchar * names[1] = {0};
+ GValue * values;
+ const guint n_max = 1;
/* create the ido menuitem */;
n = 0;
+ values = g_new0(GValue, n_max);
if (g_menu_item_get_attribute (menu_item, "label", "s", &str))
{
- GParameter p = { "text", G_VALUE_INIT };
- g_value_init (&p.value, G_TYPE_STRING);
- g_value_take_string (&p.value, str);
- parameters[n++] = p;
+ names[n] = "text";
+ g_value_init (&values[n], G_TYPE_STRING);
+ g_value_take_string (&values[n], str);
+ n++;
}
- g_assert (n <= G_N_ELEMENTS (parameters));
- ido_menu_item = g_object_newv (IDO_TYPE_BASIC_MENU_ITEM, n, parameters);
+ g_assert (n <= G_N_ELEMENTS (names));
+ g_assert (n <= n_max);
+ ido_menu_item = IDO_BASIC_MENU_ITEM(g_object_new_with_properties (IDO_TYPE_BASIC_MENU_ITEM, n, names, values));
for (i=0; i<n; i++)
- g_value_unset (&parameters[i].value);
+ g_value_unset (&values[i]);
/* give it an ActionHelper */