]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/restart.c
more using g_slice_new() instead of g_new()
[chaz/openbox] / openbox / actions / restart.c
index 0afe8bf016c68f9415b9095deb7ff3fdb7c78cf5..dc9a218a6985b69c437020b9cdd7182351868bb5 100644 (file)
@@ -1,5 +1,6 @@
 #include "openbox/actions.h"
 #include "openbox/openbox.h"
+#include "obt/paths.h"
 
 typedef struct {
     gchar   *cmd;
@@ -11,7 +12,7 @@ static gboolean run_func(ObActionsData *data, gpointer options);
 
 void action_restart_startup(void)
 {
-    actions_register("Restart", setup_func, free_func, run_func, NULL, NULL);
+    actions_register("Restart", setup_func, free_func, run_func);
 }
 
 static gpointer setup_func(xmlNodePtr node)
@@ -19,13 +20,13 @@ 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, "command")) ||
-        (n = obt_parse_find_node(node, "execute")))
+    if ((n = obt_xml_find_node(node, "command")) ||
+        (n = obt_xml_find_node(node, "execute")))
     {
-        gchar *s = obt_parse_node_string(n);
-        o->cmd = parse_expand_tilde(s);
+        gchar *s = obt_xml_node_string(n);
+        o->cmd = obt_paths_expand_tilde(s);
         g_free(s);
     }
     return o;
@@ -35,7 +36,7 @@ static void free_func(gpointer options)
 {
     Options *o = options;
     g_free(o->cmd);
-    g_free(o);
+    g_slice_free(Options, o);
 }
 
 /* Always return FALSE because its not interactive */
This page took 0.025255 seconds and 4 git commands to generate.