diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-02 02:30:11 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-07-02 02:30:11 +0800 |
commit | ac60e853cbee9c568b3cc066cbdadfdd7e0152c8 (patch) | |
tree | ad0daba3c32a00e33581296c8317cfa9a22b4061 /shell/e-shell-view.c | |
parent | 2a9973b6fb45980836115bdbb0a05f0478d0a08e (diff) | |
download | gsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.tar gsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.tar.gz gsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.tar.bz2 gsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.tar.lz gsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.tar.xz gsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.tar.zst gsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.zip |
Get the "Open in a New Window" shortcut right-click menu to actually
work (I had removed a line by mistake), and fix a crash that would
happen if user opened a new view, closed it and then created a new
folder.
svn path=/trunk/; revision=10657
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r-- | shell/e-shell-view.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index f7d40e5330..ae72420da6 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -160,6 +160,10 @@ static void update_offline_toggle_status (EShellView *shell_view); 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); + + /* Utility functions. */ static GtkWidget * @@ -215,6 +219,22 @@ bonobo_widget_is_dead (BonoboWidget *bonobo_widget) return is_dead; } +static void +cleanup_delayed_selection (EShellView *shell_view) +{ + EShellViewPrivate *priv; + + priv = shell_view->priv; + + if (priv->delayed_selection != NULL) { + g_free (priv->delayed_selection); + priv->delayed_selection = NULL; + gtk_signal_disconnect_by_func (GTK_OBJECT (e_shell_get_storage_set (priv->shell)), + GTK_SIGNAL_FUNC (new_folder_cb), + shell_view); + } +} + /* Folder bar pop-up handling. */ @@ -400,8 +420,6 @@ pop_up_folder_bar (EShellView *shell_view) /* Switching views on a tree view click. */ -static void new_folder_cb (EStorageSet *storage_set, const char *path, void *data); - static int set_folder_timeout (gpointer data) { @@ -437,13 +455,7 @@ switch_on_folder_tree_click (EShellView *shell_view, gtk_timeout_remove (priv->set_folder_timeout); g_free (priv->set_folder_uri); - if (priv->delayed_selection) { - g_free (priv->delayed_selection); - priv->delayed_selection = NULL; - gtk_signal_disconnect_by_func (GTK_OBJECT (e_shell_get_storage_set (priv->shell)), - GTK_SIGNAL_FUNC (new_folder_cb), - shell_view); - } + cleanup_delayed_selection (shell_view); if (priv->folder_bar_mode == E_SHELL_VIEW_SUBWINDOW_TRANSIENT) { e_shell_view_display_uri (shell_view, uri); @@ -482,8 +494,8 @@ new_folder_cb (EStorageSet *storage_set, GTK_SIGNAL_FUNC (new_folder_cb), shell_view); g_free (priv->uri); - priv->uri = priv->delayed_selection; - priv->delayed_selection = NULL; + priv->uri = g_strdup (priv->delayed_selection); + cleanup_delayed_selection (shell_view); e_shell_view_display_uri (shell_view, priv->uri); } } @@ -915,6 +927,8 @@ destroy (GtkObject *object) g_free (priv->uri); + cleanup_delayed_selection (shell_view); + if (priv->set_folder_timeout != 0) gtk_timeout_remove (priv->set_folder_timeout); @@ -1847,6 +1861,7 @@ e_shell_view_display_uri (EShellView *shell_view, g_assert (GTK_IS_WIDGET (control)); show_existing_view (shell_view, uri, control); } else if (create_new_view_for_uri (shell_view, uri)) { + cleanup_delayed_selection (shell_view); priv->delayed_selection = g_strdup (uri); gtk_signal_connect_after (GTK_OBJECT (e_shell_get_storage_set (priv->shell)), "new_folder", GTK_SIGNAL_FUNC (new_folder_cb), shell_view); |