#include "keyboard.h"
#include "translate.h"
+#include "actions.h"
#include <glib.h>
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);
gboolean tree_chroot(KeyBindingTree *tree, GList *keylist)
{
- if (keylist == NULL) {
- tree->chroot = TRUE;
- return TRUE;
- } else {
- 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)
- return tree_chroot(tree, keylist->next);
+ 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);
}
}
return FALSE;