[Commits] extension-loader.c 1.2 1.3
miras at claws-mail.org
miras at claws-mail.org
Tue Dec 13 11:39:58 CET 2011
Update of /home/claws-mail/contacts/src
In directory claws-mail:/tmp/cvs-serv21250/src
Modified Files:
extension-loader.c
Log Message:
2011-12-13 [mir] 0.6.0cvs41
* src/extension-loader.c
Fix minor bug.
Index: extension-loader.c
===================================================================
RCS file: /home/claws-mail/contacts/src/extension-loader.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- extension-loader.c 9 Dec 2011 23:01:21 -0000 1.2
+++ extension-loader.c 13 Dec 2011 10:39:56 -0000 1.3
@@ -476,7 +476,8 @@
if (! mainwindow)
return added;
- if (! menu_item || ! menu_item->parent) {
+ if (! menu_item || menu_item == CONTACTS_NONE ||
+ (! menu_item->parent && menu_item->menu == CONTACTS_MAIN_MENU)) {
g_critical("Missing menu_item or menu_item invalid");
return added;
}
@@ -491,11 +492,12 @@
return added;
}
- debug_print("Inserting %s in menu\n", menu_item->parent);
+ debug_print("Inserting '%s' in '%s' menu_item\n",
+ gtk_menu_item_get_label(GTK_MENU_ITEM(image_menu)), menu_item->parent);
menu = g_new0(UserMenuItem, 1);
gtk_widget_show(GTK_WIDGET(image_menu));
- if (strcasecmp("file", menu_item->parent) == 0) {
+ if (menu_item->parent && strcasecmp("file", menu_item->parent) == 0) {
// add to 'File'
menu_elem = insert_sub_menu(image_menu, menu_item, menu);
if (menu->sublabel && menu_item->parent)
@@ -508,7 +510,7 @@
menu_elem, file_menu_count);
file_menu_count++;
}
- else if (strcasecmp("tools", menu_item->parent) == 0) {
+ else if (menu_item->parent && strcasecmp("tools", menu_item->parent) == 0) {
// add to 'Tools'
menu_elem = insert_sub_menu(image_menu, menu_item, menu);
if (menu->sublabel && menu_item->parent)
@@ -519,7 +521,7 @@
}
gtk_menu_shell_append(GTK_MENU_SHELL(mainwindow->tools_menu), menu_elem);
}
- else if (strcasecmp("help", menu_item->parent) == 0) {
+ else if (menu_item->parent && strcasecmp("help", menu_item->parent) == 0) {
// add to 'Help'
menu_elem = insert_sub_menu(image_menu, menu_item, menu);
if (menu->sublabel && menu_item->parent)
More information about the Commits
mailing list