]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/showmenu.c
more using g_slice_new() instead of g_new()
[chaz/openbox] / openbox / actions / showmenu.c
index 9590bd1589561eaedd7616606f3d1f5c38c7e4ed..485a31d5a7e06880eee48d0f1f6aef512db13911 100644 (file)
@@ -12,8 +12,7 @@ static gboolean run_func(ObActionsData *data, gpointer options);
 
 void action_showmenu_startup(void)
 {
-    actions_register("ShowMenu", setup_func, free_func, run_func,
-                     NULL, NULL);
+    actions_register("ShowMenu", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -21,10 +20,10 @@ static gpointer setup_func(xmlNodePtr node)
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
-    if ((n = obt_parse_find_node(node, "menu")))
-        o->name = obt_parse_node_string(n);
+    if ((n = obt_xml_find_node(node, "menu")))
+        o->name = obt_xml_node_string(n);
     return o;
 }
 
@@ -32,7 +31,7 @@ static void free_func(gpointer options)
 {
     Options *o = options;
     g_free(o->name);
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 /* Always return FALSE because its not interactive */
This page took 0.02194 seconds and 4 git commands to generate.