diff options
author | Rodney Dawes <dobey@ximian.com> | 2004-01-24 07:27:03 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2004-01-24 07:27:03 +0800 |
commit | 8f4d01823c2a8ae78387e9958b86c810f39620ad (patch) | |
tree | 0b3a5ae50d8b633a4b7c2350b2c05f18ac6e09cf /shell/main.c | |
parent | 2829122e95b3f123487b7928975fa3049af898b5 (diff) | |
download | gsoc2013-evolution-8f4d01823c2a8ae78387e9958b86c810f39620ad.tar.gz gsoc2013-evolution-8f4d01823c2a8ae78387e9958b86c810f39620ad.tar.zst gsoc2013-evolution-8f4d01823c2a8ae78387e9958b86c810f39620ad.zip |
Move uri_list loop into a separate function so we don't duplicate code in
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
svn path=/trunk/; revision=24394
Diffstat (limited to 'shell/main.c')
-rw-r--r-- | shell/main.c | 45 |
1 files changed, 30 insertions, 15 deletions
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); |