[nautilus] application: don't call mount_removed_callback() on pre-unmount



commit 454b2caf1ba89a62321486db10c87e63217031b8
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri Jan 28 16:18:02 2011 -0500

    application: don't call mount_removed_callback() on pre-unmount
    
    The unmount process follows this flow:
    - pre-unmount is emitted
    - GIO performs checks to see whether the volume is safe to unmount, and
      spawns GtkMountOperation dialogues accordingly
    - if everything is fine, the unmount signal is emitted
    
    So, it's wrong to close or redirect windows from pre-unmount, as the
    mount could actually not be unmounted after that.

 src/nautilus-application.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index c2b97e4..2b003da 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -489,8 +489,6 @@ finish_startup (NautilusApplication *application,
 	application->volume_monitor = g_volume_monitor_get ();
 	g_signal_connect_object (application->volume_monitor, "mount_removed",
 				 G_CALLBACK (mount_removed_callback), application, 0);
-	g_signal_connect_object (application->volume_monitor, "mount_pre_unmount",
-				 G_CALLBACK (mount_removed_callback), application, 0);
 	g_signal_connect_object (application->volume_monitor, "mount_added",
 				 G_CALLBACK (mount_added_callback), application, 0);
 }
@@ -1135,8 +1133,6 @@ should_close_slot_with_mount (NautilusWindow *window,
  * any windows open displaying contents on the mount. If there are,
  * close them.  It would also be cool to save open window and position
  * info.
- *
- * This is also called on pre_unmount.
  */
 static void
 mount_removed_callback (GVolumeMonitor *monitor,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]