X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fexit.c;h=2d9fc63312dc9c73b196474db71fb0f79bd99f83;hb=e27680e4205f5be210cd52660f495e67623e6260;hp=567926e1fd3e4ddb8ba52c5a1cc25e8d927a5981;hpb=7f36e21ea9d86df5e6fa62d2888891ed957c4639;p=chaz%2Fopenbox diff --git a/openbox/actions/exit.c b/openbox/actions/exit.c index 567926e1..2d9fc633 100644 --- a/openbox/actions/exit.c +++ b/openbox/actions/exit.c @@ -8,29 +8,35 @@ typedef struct { gboolean prompt; } Options; -static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node); +static gpointer setup_func(xmlNodePtr node); +static void free_func(gpointer o); static gboolean run_func(ObActionsData *data, gpointer options); void action_exit_startup(void) { - actions_register("Exit", setup_func, NULL, run_func, NULL, NULL); - actions_register("SessionLogout", setup_func, NULL, run_func, NULL, NULL); + actions_register("Exit", setup_func, free_func, run_func); + actions_register("SessionLogout", 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); o->prompt = TRUE; - if ((n = parse_find_node("prompt", node))) - o->prompt = parse_bool(doc, n); + if ((n = obt_xml_find_node(node, "prompt"))) + o->prompt = obt_xml_node_bool(n); return o; } +static void free_func(gpointer o) +{ + g_slice_free(Options, o); +} + static void do_exit(void) { if (session_connected()) @@ -51,6 +57,7 @@ static void prompt_cleanup(ObPrompt *p, gpointer data) prompt_unref(p); } + /* Always return FALSE because its not interactive */ static gboolean run_func(ObActionsData *data, gpointer options) {