aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-09-05 03:33:15 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-09-05 03:33:15 +0800
commitee467a65b12c7e063763b58157632e093dc86991 (patch)
treefe41e2b556d33b5a716939139babf9c1b0c68ff1 /shell/e-shell-view.c
parent4270c51a98b6cc77a8337c6120195be4f620c775 (diff)
downloadgsoc2013-evolution-ee467a65b12c7e063763b58157632e093dc86991.tar.gz
gsoc2013-evolution-ee467a65b12c7e063763b58157632e093dc86991.tar.zst
gsoc2013-evolution-ee467a65b12c7e063763b58157632e093dc86991.zip
Pass TRUE as @queue to e_shell_view_display_uri().
* e-shell.c (create_view): Pass TRUE as @queue to e_shell_view_display_uri(). * e-shell-view-menu.c (command_activate_view): Pass TRUE as @queue to e_shell_view_display_uri(). (goto_folder_dialog_folder_selected_cb): Likewise. * e-shell-shared-folder-picker-dialog.c (shared_folder_discovery_listener_callback): Pass TRUE as @queue to e_shell_view_display_uri(). * e-shell-view.c (display_uri): New arg @queue. If true, it allows the delayed_selection mechanism to happen transparently (returning TRUE, while before it used to return FALSE). Otherwise, refuse to queue the URI and return FALSE. (e_shell_view_display_uri): New arg @queue; pass it to display_uri(). (handle_current_folder_removed): Pass TRUE as @queue to e_shell_view_display_uri(). (set_folder_timeout): Likewise. (switch_on_folder_tree_click): Likewise. (activate_shortcut_cb): Likewise. (corba_interface_change_current_view_cb): Likewise. (socket_destroy_cb): Likewise. (socket_destroy_cb): Likewise. (e_shell_view_load_settings): Here, try displaying the old URI with @queue set to FALSE; if this fails, display the default URI and then invoke display again using @queue = TRUE so it gets queued up. This should fix #27721. svn path=/trunk/; revision=17972
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r--shell/e-shell-view.c55
1 files changed, 33 insertions, 22 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index fd23753894..cee729a950 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -189,7 +189,8 @@ static const char *get_storage_set_path_from_uri (const char *uri);
/* Boo. */
static void new_folder_cb (EStorageSet *storage_set, const char *path, void *data);
-static gboolean display_uri (EShellView *shell_view, const char *uri, gboolean add_to_history);
+static gboolean display_uri (EShellView *shell_view, const char *uri,
+ gboolean add_to_history, gboolean queue);
/* View handling. */
@@ -454,7 +455,7 @@ handle_current_folder_removed (EShellView *shell_view)
/* No Inbox in this storage -- fallback to the storage. */
storage_uri = g_strconcat (E_SHELL_URI_PREFIX, storage_name, NULL);
- e_shell_view_display_uri (shell_view, storage_uri);
+ e_shell_view_display_uri (shell_view, storage_uri, TRUE);
g_free (storage_uri);
g_free (storage_name);
@@ -466,7 +467,7 @@ handle_current_folder_removed (EShellView *shell_view)
}
if (new_path == NULL) {
- e_shell_view_display_uri (shell_view, FALLBACK_URI);
+ e_shell_view_display_uri (shell_view, FALLBACK_URI, TRUE);
} else {
EFolder *folder;
@@ -475,12 +476,12 @@ handle_current_folder_removed (EShellView *shell_view)
folder = e_storage_set_get_folder (e_shell_get_storage_set (priv->shell), new_path);
if (folder == NULL) {
- e_shell_view_display_uri (shell_view, FALLBACK_URI);
+ e_shell_view_display_uri (shell_view, FALLBACK_URI, TRUE);
} else {
char *new_uri;
new_uri = g_strconcat (E_SHELL_URI_PREFIX, new_path, NULL);
- e_shell_view_display_uri (shell_view, new_uri);
+ e_shell_view_display_uri (shell_view, new_uri, TRUE);
g_free (new_uri);
}
@@ -745,7 +746,7 @@ set_folder_timeout (gpointer data)
/* Set to 0 so we don't remove it in _display_uri(). */
priv->set_folder_timeout = 0;
- e_shell_view_display_uri (shell_view, priv->set_folder_uri);
+ e_shell_view_display_uri (shell_view, priv->set_folder_uri, TRUE);
return FALSE;
}
@@ -792,7 +793,7 @@ switch_on_folder_tree_click (EShellView *shell_view,
cleanup_delayed_selection (shell_view);
if (priv->folder_bar_popup != NULL) {
- e_shell_view_display_uri (shell_view, uri);
+ e_shell_view_display_uri (shell_view, uri, TRUE);
g_free (uri);
gtk_object_ref (GTK_OBJECT (shell_view));
@@ -830,7 +831,7 @@ new_folder_cb (EStorageSet *storage_set,
uri = g_strdup (priv->delayed_selection);
cleanup_delayed_selection (shell_view);
- e_shell_view_display_uri (shell_view, uri);
+ e_shell_view_display_uri (shell_view, uri, TRUE);
g_free (uri);
}
}
@@ -855,7 +856,7 @@ activate_shortcut_cb (EShortcutsView *shortcut_view,
e_shell_view_show_shortcut_bar (new_view, FALSE);
e_shell_view_show_folder_bar (new_view, FALSE);
} else {
- e_shell_view_display_uri (shell_view, uri);
+ e_shell_view_display_uri (shell_view, uri, TRUE);
}
}
@@ -985,7 +986,7 @@ back_clicked_callback (EShellFolderTitleBar *title_bar,
new_uri = (const char *) e_history_prev (priv->history);
- display_uri (shell_view, new_uri, FALSE);
+ display_uri (shell_view, new_uri, FALSE, TRUE);
}
static void
@@ -1004,7 +1005,7 @@ forward_clicked_callback (EShellFolderTitleBar *title_bar,
new_uri = (const char *) e_history_next (priv->history);
- display_uri (shell_view, new_uri, FALSE);
+ display_uri (shell_view, new_uri, FALSE, TRUE);
}
@@ -1490,7 +1491,7 @@ corba_interface_change_current_view_cb (EvolutionShellView *shell_view,
g_return_if_fail (view != NULL);
- e_shell_view_display_uri (view, uri);
+ e_shell_view_display_uri (view, uri, TRUE);
}
static void
@@ -2045,13 +2046,13 @@ socket_destroy_cb (GtkWidget *socket_widget, gpointer data)
}
if (viewing_closed_uri)
- e_shell_view_display_uri (shell_view, NULL);
+ e_shell_view_display_uri (shell_view, NULL, TRUE);
e_shell_component_maybe_crashed (priv->shell, uri, folder_type, shell_view);
/* We were actively viewing the component that just crashed, so flip to the default URI */
if (viewing_closed_uri)
- e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI);
+ e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI, TRUE);
}
@@ -2226,7 +2227,8 @@ evolution_uri_for_default_uri (EShell *shell,
static gboolean
display_uri (EShellView *shell_view,
const char *uri,
- gboolean add_to_history)
+ gboolean add_to_history,
+ gboolean queue)
{
EShellViewPrivate *priv;
View *view;
@@ -2281,12 +2283,17 @@ display_uri (EShellView *shell_view,
if (view != NULL) {
show_existing_view (shell_view, real_uri, view);
} else if (! create_new_view_for_uri (shell_view, real_uri, view_info)) {
+ if (! queue) {
+ retval = FALSE;
+ goto end;
+ }
+
cleanup_delayed_selection (shell_view);
priv->delayed_selection = g_strdup (real_uri);
gtk_signal_connect_full (GTK_OBJECT (e_shell_get_storage_set (priv->shell)),
"new_folder", GTK_SIGNAL_FUNC (new_folder_cb), NULL,
shell_view, NULL, FALSE, TRUE);
- retval = FALSE;
+ retval = TRUE;
goto end;
}
@@ -2325,12 +2332,13 @@ display_uri (EShellView *shell_view,
gboolean
e_shell_view_display_uri (EShellView *shell_view,
- const char *uri)
+ const char *uri,
+ gboolean queue)
{
g_return_val_if_fail (shell_view != NULL, FALSE);
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
- return display_uri (shell_view, uri, TRUE);
+ return display_uri (shell_view, uri, TRUE, queue);
}
@@ -2778,10 +2786,13 @@ e_shell_view_load_settings (EShellView *shell_view,
key = g_strconcat (prefix, "DisplayedURI", NULL);
stringval = bonobo_config_get_string (db, key, NULL);
if (stringval) {
- if (! e_shell_view_display_uri (shell_view, stringval))
- e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI);
- } else
- e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI);
+ if (! e_shell_view_display_uri (shell_view, stringval, FALSE)) {
+ e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI, FALSE);
+ e_shell_view_display_uri (shell_view, stringval, TRUE);
+ }
+ } else {
+ e_shell_view_display_uri (shell_view, E_SHELL_VIEW_DEFAULT_URI, TRUE);
+ }
g_free (stringval);
g_free (key);