diff options
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/main.c | 45 |
2 files changed, 39 insertions, 15 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 67ed71c0a8..83df07e4b7 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,12 @@ +2004-01-23 Rodney Dawes <dobey@ximian.com> + + * main.c (idle_cb): Move uri_list loop into a separate function + so we don't duplicate code in both instances where we are creating + a new shell or using a current one, and don't open a new shell window + if we are passing in a uri and a shell is already up + + Fixes #53216 + 2004-01-15 JP Rosevear <jpr@ximian.com> * e-config-upgrade.c: remove calendar and task keys for upgrade, diff --git a/shell/main.c b/shell/main.c index e3eff9b1e9..b7e3f329a0 100644 --- a/shell/main.c +++ b/shell/main.c @@ -417,6 +417,28 @@ attempt_upgrade (EShell *shell) } +static void +open_uris (GNOME_Evolution_Shell corba_shell, GSList *uri_list) +{ + GSList *p; + CORBA_Environment ev; + + CORBA_exception_init (&ev); + + for (p = uri_list; p != NULL; p = p->next) { + const char *uri; + + uri = (const char *) p->data; + GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("Invalid URI: %s", uri); + CORBA_exception_free (&ev); + } + } + + CORBA_exception_free (&ev); +} + /* This is for doing stuff that requires the GTK+ loop to be running already. */ static gint @@ -427,7 +449,6 @@ idle_cb (void *data) CORBA_Environment ev; EShellConstructResult result; EShellStartupLineMode startup_line_mode; - GSList *p; gboolean have_evolution_uri; #ifdef KILL_PROCESS_CMD @@ -490,26 +511,20 @@ idle_cb (void *data) if (shell != NULL) { e_shell_create_window (shell, default_component_id, NULL); + open_uris (corba_shell, uri_list); } else { CORBA_Environment ev; CORBA_exception_init (&ev); - if (default_component_id == NULL) - GNOME_Evolution_Shell_createNewWindow (corba_shell, "", &ev); + if (uri_list != NULL) + open_uris (corba_shell, uri_list); else - GNOME_Evolution_Shell_createNewWindow (corba_shell, default_component_id, &ev); - CORBA_exception_free (&ev); - } + if (default_component_id == NULL) + GNOME_Evolution_Shell_createNewWindow (corba_shell, "", &ev); + else + GNOME_Evolution_Shell_createNewWindow (corba_shell, default_component_id, &ev); - for (p = uri_list; p != NULL; p = p->next) { - const char *uri; - - uri = (const char *) p->data; - GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); - if (ev._major != CORBA_NO_EXCEPTION) { - g_warning ("Invalid URI: %s", uri); - CORBA_exception_free (&ev); - } + CORBA_exception_free (&ev); } g_slist_free (uri_list); |