From ac4f13b93e22cc59dbe36ff3a4825bb5077523c4 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 20 Aug 2001 04:02:10 +0000 Subject: Allow the activity to be NULL if there isn't a global_shell_client so that 2001-08-19 Jeffrey Stedfast * mail-mt.c (do_op_status): Allow the activity to be NULL if there isn't a global_shell_client so that we don't try and report status updates when the shell is destroyed. * mail-config.c (add_shortcut_entry): Return if there isn't a global_shell_client. * component-factory.c (owner_set_cb): set the global_shell_client here and connect to the destroy signal. * mail-vfolder.c (vfolder_create_storage): Use an extern global_shell_client. svn path=/trunk/; revision=12242 --- mail/mail-config.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index 74dbdaf27c..a406ba1367 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -1455,26 +1455,29 @@ add_shortcut_entry (const char *name, const char *uri, const char *type) GNOME_Evolution_Shortcuts_Group *the_group; GNOME_Evolution_Shortcuts_Shortcut *the_shortcut; int i, group_num; - + + if (!global_shell_client) + return; + CORBA_exception_init (&ev); - + shortcuts_interface = evolution_shell_client_get_shortcuts_interface (global_shell_client); if (CORBA_Object_is_nil (shortcuts_interface, &ev)) { g_warning ("No ::Shortcut interface on the shell"); CORBA_exception_free (&ev); return; } - + groups = GNOME_Evolution_Shortcuts__get_groups (shortcuts_interface, &ev); if (ev._major != CORBA_NO_EXCEPTION) { g_warning ("Exception getting the groups: %s", ev._repo_id); CORBA_exception_free (&ev); return; } - + the_group = NULL; group_num = 0; - + for (i = 0; i < groups->_length; i++) { GNOME_Evolution_Shortcuts_Group *iter; @@ -1485,33 +1488,33 @@ add_shortcut_entry (const char *name, const char *uri, const char *type) break; } } - + if (the_group == NULL) { /* Bleah, just create it. Probably not the best * course of action. */ - + GNOME_Evolution_Shortcuts_addGroup (shortcuts_interface, group_num, "Evolution Shortcuts", &ev); - + if (ev._major != CORBA_NO_EXCEPTION) { g_warning ("Exception recreating \"Evolution Shortcuts\" group: %s", ev._repo_id); goto cleanup; } - + the_group = GNOME_Evolution_Shortcuts_getGroup (shortcuts_interface, group_num, &ev); - + if (ev._major != CORBA_NO_EXCEPTION) { g_warning ("Exception getting newly created \"Evolution Shortcuts\" group: %s", ev._repo_id); goto cleanup; } } - + the_shortcut = NULL; - + for (i = 0; i < the_group->shortcuts._length; i++) { GNOME_Evolution_Shortcuts_Shortcut *iter; @@ -1521,30 +1524,29 @@ add_shortcut_entry (const char *name, const char *uri, const char *type) break; } } - + if (the_shortcut == NULL) { the_shortcut = GNOME_Evolution_Shortcuts_Shortcut__alloc (); - + the_shortcut->name = CORBA_string_dup (name); the_shortcut->uri = CORBA_string_dup (uri); the_shortcut->type = CORBA_string_dup (type); - + GNOME_Evolution_Shortcuts_add (shortcuts_interface, group_num, the_group->shortcuts._length, the_shortcut, &ev); - + CORBA_free (the_shortcut); - + if (ev._major != CORBA_NO_EXCEPTION) { g_warning ("Exception creating shortcut \"%s\": %s", name, ev._repo_id); goto cleanup; } - - } - + } + cleanup: CORBA_exception_free (&ev); CORBA_free (groups); -- cgit