aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-07-02 02:30:11 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-07-02 02:30:11 +0800
commitac60e853cbee9c568b3cc066cbdadfdd7e0152c8 (patch)
treead0daba3c32a00e33581296c8317cfa9a22b4061 /shell
parent2a9973b6fb45980836115bdbb0a05f0478d0a08e (diff)
downloadgsoc2013-evolution-ac60e853cbee9c568b3cc066cbdadfdd7e0152c8.tar.gz
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')
-rw-r--r--shell/ChangeLog22
-rw-r--r--shell/e-shell-view.c37
-rw-r--r--shell/e-shortcuts-view.c2
3 files changed, 49 insertions, 12 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 396a50fa72..a7e079c1d0 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,27 @@
2001-07-01 Ettore Perazzoli <ettore@ximian.com>
+ * e-shell-view.c: Fixing a bug that could cause Evolution to crash
+ if a new ShellView was created and then destroyed, and then a new
+ folder would appear in the folder tree. Sigh, this code with the
+ delayed_selection is pretty messed up, but at least this will add
+ some consistency to it and make it safe.
+ (cleanup_delayed_selection): New function to disconnect the
+ "new_folder_cb" callback if the `delayed_selection' is not NULL,
+ and also free the `delayed_selection' itself.
+ (new_folder_cb): Use it.
+ (destroy): Call it here, otherwise we might [a] leak [b] cause a
+ crash as soon as a new folder appears in the folder tree, as
+ "new_folder" gets emitted and our connected signal handler has no
+ EShellView to handle the signal on.
+ (e_shell_view_display_uri): Call it here before re-setting the
+ `delayed_selection'.
+
+ * e-shortcuts-view.c (open_shortcut_in_new_window_cb): Add
+ invocation for `open_shortcut_helper()' back in [it was gone, for
+ unknown reasons].
+
+2001-07-01 Ettore Perazzoli <ettore@ximian.com>
+
* e-storage-set-view.c (tree_drag_begin): If the node doesn't have
a component, just don't start the whole CORBA drag thing instead
of crashing with an assertion.
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);
diff --git a/shell/e-shortcuts-view.c b/shell/e-shortcuts-view.c
index de30fdba1c..32aa46fa56 100644
--- a/shell/e-shortcuts-view.c
+++ b/shell/e-shortcuts-view.c
@@ -408,7 +408,7 @@ static void
open_shortcut_in_new_window_cb (GtkWidget *widget,
void *data)
{
-
+ open_shortcut_helper ((ShortcutRightClickMenuData *) data, TRUE);
}