Mercurial > pidgin.yaz
comparison console/libgnt/gntwidget.c @ 14881:5228f8cf2a6a
[gaim-migrate @ 17650]
Print a debug message if someone tries to specify a binding for some non-existent action.
Make sure the conversation windows aren't too large to cause a crash.
raise(SIGABRT) instead of exit() to force a coredump if something goes wrong with stdin.
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 01 Nov 2006 20:59:23 +0000 |
parents | 70623f0d5cdc |
children | 065e7ac30338 |
comparison
equal
deleted
inserted
replaced
14880:0e4833acd31c | 14881:5228f8cf2a6a |
---|---|
709 | 709 |
710 static void | 710 static void |
711 register_binding(GntWidgetClass *klass, const char *name, const char *trigger, GList *list) | 711 register_binding(GntWidgetClass *klass, const char *name, const char *trigger, GList *list) |
712 { | 712 { |
713 GntWidgetActionParam *param; | 713 GntWidgetActionParam *param; |
714 GntWidgetAction *action; | |
714 | 715 |
715 if (name == NULL || *name == '\0') { | 716 if (name == NULL || *name == '\0') { |
716 g_hash_table_remove(klass->bindings, (char*)trigger); | 717 g_hash_table_remove(klass->bindings, (char*)trigger); |
717 return; | 718 return; |
718 } | 719 } |
719 | 720 |
721 action = g_hash_table_lookup(klass->actions, name); | |
722 if (!action) { | |
723 g_printerr("GntWidget: Invalid action name %s for %s\n", | |
724 name, g_type_name(G_OBJECT_CLASS_TYPE(klass))); | |
725 if (list) | |
726 g_list_free(list); | |
727 return; | |
728 } | |
729 | |
720 param = g_new0(GntWidgetActionParam, 1); | 730 param = g_new0(GntWidgetActionParam, 1); |
721 param->action = g_hash_table_lookup(klass->actions, name); | 731 param->action = action; |
722 param->list = list; | 732 param->list = list; |
723 g_hash_table_replace(klass->bindings, g_strdup(trigger), param); | 733 g_hash_table_replace(klass->bindings, g_strdup(trigger), param); |
724 } | 734 } |
725 | 735 |
726 void gnt_widget_register_binding(GntWidgetClass *klass, const char *name, | 736 void gnt_widget_register_binding(GntWidgetClass *klass, const char *name, |