X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fkeytree.c;h=56cc96d41baf767dac67e8f9152e2fcb98475c60;hb=3592046b2b26e05ee94c0dd0fed5b7fd5475c198;hp=202dd32c9864e55c1623c7b04852bbcead34e871;hpb=8c68c9ab0f75514ee4f0336e566ac2c02ac20b65;p=chaz%2Fopenbox diff --git a/openbox/keytree.c b/openbox/keytree.c index 202dd32c..56cc96d4 100644 --- a/openbox/keytree.c +++ b/openbox/keytree.c @@ -19,6 +19,7 @@ #include "keyboard.h" #include "translate.h" +#include "actions.h" #include void tree_destroy(KeyBindingTree *tree) @@ -35,7 +36,7 @@ void tree_destroy(KeyBindingTree *tree) g_free(it->data); g_list_free(tree->keylist); for (sit = tree->actions; sit != NULL; sit = sit->next) - action_unref(sit->data); + actions_act_unref(sit->data); g_slist_free(tree->actions); } g_free(tree); @@ -62,10 +63,7 @@ KeyBindingTree *tree_build(GList *keylist) g_strdup(kit->data)); /* deep copy */ ret->first_child = p; if (p != NULL) p->parent = ret; - if (!translate_key(it->data, &ret->state, &ret->key)) { - tree_destroy(ret); - return NULL; - } + translate_key(it->data, &ret->state, &ret->key); } return ret; } @@ -134,16 +132,15 @@ KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict) gboolean tree_chroot(KeyBindingTree *tree, GList *keylist) { guint key, state; - if (translate_key(keylist->data, &state, &key)) { - while (tree != NULL && !(tree->state == state && tree->key == key)) - tree = tree->next_sibling; - if (tree != NULL) { - if (keylist->next == NULL) { - tree->chroot = TRUE; - return TRUE; - } else - return tree_chroot(tree->first_child, keylist->next); - } + translate_key(keylist->data, &state, &key); + while (tree != NULL && !(tree->state == state && tree->key == key)) + tree = tree->next_sibling; + if (tree != NULL) { + if (keylist->next == NULL) { + tree->chroot = TRUE; + return TRUE; + } else + return tree_chroot(tree->first_child, keylist->next); } return FALSE; }