From c10d63c7c2449982993a9579a9f0b951632b9401 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 9 Apr 2002 15:33:45 +0000 Subject: If the shell fails to display all of the requested URIs, fall back to the default URI (Summary). svn path=/trunk/; revision=16404 --- shell/ChangeLog | 3 ++- shell/main.c | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 4a8a91be5e..a8323cd1e4 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,7 +1,8 @@ 2002-04-09 Dan Winship * main.c (idle_cb): Check for "default:" URIs and treat them the - same way as "evolution:" URIs. + same way as "evolution:" URIs. If the shell fails to display all + of the requested URIs, fall back to the default URI (Summary). * e-shell.c (impl_Shell_handleURI): Handle "default:" URIs by looking up the default folders in the config db. diff --git a/shell/main.c b/shell/main.c index 61ad7c7ef6..23926f3101 100644 --- a/shell/main.c +++ b/shell/main.c @@ -191,6 +191,7 @@ idle_cb (void *data) GSList *p; gboolean have_evolution_uri; gboolean display_default; + gboolean displayed_any; CORBA_exception_init (&ev); @@ -271,26 +272,31 @@ idle_cb (void *data) } } - if (display_default) { + displayed_any = FALSE; + for (p = uri_list; p != NULL; p = p->next) { const char *uri; - uri = E_SHELL_VIEW_DEFAULT_URI; + uri = (const char *) p->data; GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); - if (ev._major != CORBA_NO_EXCEPTION) + if (ev._major == CORBA_NO_EXCEPTION) + displayed_any = TRUE; + else { g_warning ("CORBA exception %s when requesting URI -- %s", ev._repo_id, uri); + CORBA_exception_free (&ev); + } } - for (p = uri_list; p != NULL; p = p->next) { + g_slist_free (uri_list); + + if (display_default || !displayed_any) { const char *uri; - uri = (const char *) p->data; + uri = E_SHELL_VIEW_DEFAULT_URI; GNOME_Evolution_Shell_handleURI (corba_shell, uri, &ev); if (ev._major != CORBA_NO_EXCEPTION) g_warning ("CORBA exception %s when requesting URI -- %s", ev._repo_id, uri); } - g_slist_free (uri_list); - CORBA_Object_release (corba_shell, &ev); CORBA_exception_free (&ev); -- cgit v1.2.3