]> 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 c1d53e41d8c76fbc74ac7d147cccdcfa69b50fd7..485a31d5a7e06880eee48d0f1f6aef512db13911 100644 (file)
@@ -6,25 +6,24 @@ typedef struct {
     gchar   *name;
 } Options;
 
-static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
+static gpointer setup_func(xmlNodePtr node);
 static void     free_func(gpointer options);
 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(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
+static gpointer setup_func(xmlNodePtr node)
 {
     xmlNodePtr n;
     Options *o;
 
-    o = g_new0(Options, 1);
+    o = g_slice_new0(Options);
 
-    if ((n = parse_find_node("menu", node)))
-        o->name = parse_string(doc, 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.020357 seconds and 4 git commands to generate.