gvfs r2036 - in trunk: . monitor/hal



Author: davidz
Date: Mon Sep 29 15:54:53 2008
New Revision: 2036
URL: http://svn.gnome.org/viewvc/gvfs?rev=2036&view=rev

Log:
2008-09-29  David Zeuthen  <davidz redhat com>

        * monitor/hal/ghalvolume.c:
        * monitor/hal/ghalvolumemonitor.[ch]:
        Make sure we emit 'mount-added' when forcing an update for
        completing a mount operation (#552168)



Modified:
   trunk/ChangeLog
   trunk/monitor/hal/ghalvolume.c
   trunk/monitor/hal/ghalvolumemonitor.c
   trunk/monitor/hal/ghalvolumemonitor.h

Modified: trunk/monitor/hal/ghalvolume.c
==============================================================================
--- trunk/monitor/hal/ghalvolume.c	(original)
+++ trunk/monitor/hal/ghalvolume.c	Mon Sep 29 15:54:53 2008
@@ -760,9 +760,10 @@
   GSimpleAsyncResult *simple;
 
   /* ensure that the #GHalMount corrosponding to the #GHalVolume we've
-   * mounted is made available before returning to the user
+   * mounted is made available before returning to the user (make sure
+   * we don't emit the signals in idle; see #552168).
    */
-  g_hal_volume_monitor_force_update (G_HAL_VOLUME_MONITOR (G_HAL_VOLUME (data->object)->volume_monitor));
+  g_hal_volume_monitor_force_update (G_HAL_VOLUME_MONITOR (G_HAL_VOLUME (data->object)->volume_monitor), FALSE);
 
   if (WEXITSTATUS (status) != 0)
     {

Modified: trunk/monitor/hal/ghalvolumemonitor.c
==============================================================================
--- trunk/monitor/hal/ghalvolumemonitor.c	(original)
+++ trunk/monitor/hal/ghalvolumemonitor.c	Mon Sep 29 15:54:53 2008
@@ -82,7 +82,8 @@
                                       HalDevice  *device,
                                       gpointer    user_data);
 static void update_all               (GHalVolumeMonitor *monitor,
-                                      gboolean emit_changes);
+                                      gboolean emit_changes,
+                                      gboolean emit_in_idle);
 static void update_drives            (GHalVolumeMonitor *monitor,
                                       GList **added_drives,
                                       GList **removed_drives);
@@ -367,7 +368,7 @@
 {
   GHalVolumeMonitor *monitor = G_HAL_VOLUME_MONITOR (user_data);
 
-  update_all (monitor, TRUE);
+  update_all (monitor, TRUE, TRUE);
 }
 
 static void
@@ -376,13 +377,13 @@
 {
   GHalVolumeMonitor *monitor = G_HAL_VOLUME_MONITOR (user_data);
 
-  update_all (monitor, TRUE);
+  update_all (monitor, TRUE, TRUE);
 }
 
 void 
-g_hal_volume_monitor_force_update (GHalVolumeMonitor *monitor)
+g_hal_volume_monitor_force_update (GHalVolumeMonitor *monitor, gboolean emit_in_idle)
 {
-  update_all (monitor, TRUE);
+  update_all (monitor, TRUE, emit_in_idle);
 }
 
 static void
@@ -394,7 +395,7 @@
   
   /*g_warning ("hal changed");*/
   
-  update_all (monitor, TRUE);
+  update_all (monitor, TRUE, TRUE);
 }
 
 static GObject *
@@ -448,7 +449,7 @@
                     "device_removed", G_CALLBACK (hal_changed),
                     monitor);
 		    
-  update_all (monitor, FALSE);
+  update_all (monitor, FALSE, TRUE);
 
   G_LOCK (hal_vm);
   the_volume_monitor = monitor;
@@ -973,7 +974,8 @@
 /* Must be called from idle if emit_changes, with no locks held */
 static void
 update_all (GHalVolumeMonitor *monitor,
-            gboolean emit_changes)
+            gboolean emit_changes,
+            gboolean emit_in_idle)
 {
   ChangedLists *lists;
   GList *added_drives, *removed_drives;
@@ -1007,7 +1009,10 @@
       lists->added_mounts = added_mounts;
       lists->removed_mounts = removed_mounts;
       
-      g_idle_add (emit_lists_in_idle, lists);
+      if (emit_in_idle)
+        g_idle_add (emit_lists_in_idle, lists);
+      else
+        emit_lists_in_idle (lists);
     }
   else
     {

Modified: trunk/monitor/hal/ghalvolumemonitor.h
==============================================================================
--- trunk/monitor/hal/ghalvolumemonitor.h	(original)
+++ trunk/monitor/hal/ghalvolumemonitor.h	Mon Sep 29 15:54:53 2008
@@ -51,7 +51,8 @@
 GType g_hal_volume_monitor_get_type (void) G_GNUC_CONST;
 
 GVolumeMonitor *g_hal_volume_monitor_new                          (void);
-void            g_hal_volume_monitor_force_update                 (GHalVolumeMonitor *monitor);
+void            g_hal_volume_monitor_force_update                 (GHalVolumeMonitor *monitor,
+                                                                   gboolean emit_in_idle);
 
 G_END_DECLS
 



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