diff --git a/ChangeLog b/ChangeLog index d4c950065c..60e8ee929f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-07-13 Federico Mena Quintero + + Merged from HEAD: + + * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a + busy cursor while mounting the volume. Also, ref the chooser + while mounting, as we may re-enter. Fixes #139376. + 2004-07-13 Matthias Clasen * gtk/gtkmain.h: Add gtk_parse_args(). Its public API. (#147476, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index d4c950065c..60e8ee929f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2004-07-13 Federico Mena Quintero + + Merged from HEAD: + + * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a + busy cursor while mounting the volume. Also, ref the chooser + while mounting, as we may re-enter. Fixes #139376. + 2004-07-13 Matthias Clasen * gtk/gtkmain.h: Add gtk_parse_args(). Its public API. (#147476, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index d4c950065c..60e8ee929f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +2004-07-13 Federico Mena Quintero + + Merged from HEAD: + + * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a + busy cursor while mounting the volume. Also, ref the chooser + while mounting, as we may re-enter. Fixes #139376. + 2004-07-13 Matthias Clasen * gtk/gtkmain.h: Add gtk_parse_args(). Its public API. (#147476, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index d4c950065c..60e8ee929f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +2004-07-13 Federico Mena Quintero + + Merged from HEAD: + + * gtk/gtkfilechooserdefault.c (shortcuts_activate_volume): Set a + busy cursor while mounting the volume. Also, ref the chooser + while mounting, as we may re-enter. Fixes #139376. + 2004-07-13 Matthias Clasen * gtk/gtkmain.h: Add gtk_parse_args(). Its public API. (#147476, diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 02389f99a9..7e2db959f4 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -4838,12 +4838,22 @@ shortcuts_activate_volume (GtkFileChooserDefault *impl, { GtkFilePath *path; + /* We ref the file chooser since volume_mount() may run a main loop, and the + * user could close the file chooser window in the meantime. + */ + g_object_ref (impl); + if (!gtk_file_system_volume_get_is_mounted (impl->file_system, volume)) { GError *error; + gboolean result; + + set_busy_cursor (impl, TRUE); error = NULL; - if (!gtk_file_system_volume_mount (impl->file_system, volume, &error)) + result = gtk_file_system_volume_mount (impl->file_system, volume, &error); + + if (!result) { char *msg; @@ -4853,14 +4863,21 @@ shortcuts_activate_volume (GtkFileChooserDefault *impl, error_message (impl, msg); g_free (msg); g_error_free (error); - - return; } + + set_busy_cursor (impl, FALSE); + + if (!result) + goto out; } path = gtk_file_system_volume_get_base_path (impl->file_system, volume); change_folder_and_display_error (impl, path); gtk_file_path_free (path); + + out: + + g_object_unref (impl); } /* Opens the folder or volume at the specified index in the shortcuts list */