From 4bc04b4bef057a2b5b75ddfe9d34fc098584d4c3 Mon Sep 17 00:00:00 2001
From: Benedikt Meurer <benny@xfce.org>
Date: Mon, 13 Feb 2006 21:59:44 +0000
Subject: [PATCH] 2006-02-13	Benedikt Meurer <benny@xfce.org>

	* thunar-vfs/thunar-vfs-volume-hal.c: Properly update volume state
	  after eject and unmount.
	* README: List optional HAL dependency.




(Old svn revision: 19861)
---
 ChangeLog                          |  6 ++++++
 README                             |  1 +
 thunar-vfs/thunar-vfs-volume-hal.c | 20 ++++++++++++++++++++
 3 files changed, 27 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b459f7bb2..d774a5555 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-13	Benedikt Meurer <benny@xfce.org>
+
+	* thunar-vfs/thunar-vfs-volume-hal.c: Properly update volume state
+	  after eject and unmount.
+	* README: List optional HAL dependency.
+
 2006-02-13	Benedikt Meurer <benny@xfce.org>
 
 	* thunar/thunar-dbus-service.c: Print a warning to stderr, instead of
diff --git a/README b/README
index 8b8ecb26c..88d871c57 100644
--- a/README
+++ b/README
@@ -21,6 +21,7 @@ Thunar depends on the following packages:
 Thunar can optionally use the following packages:
 
  - D-BUS 0.34 or above (strongly suggested)
+ - HAL 0.5.0 or above (esp. the libhal-storage devel package)
  - gamin 0.1.0 or above
  - gconf 2.4 or above
  - libjpeg 6 or above
diff --git a/thunar-vfs/thunar-vfs-volume-hal.c b/thunar-vfs/thunar-vfs-volume-hal.c
index 4e3c55fc7..a94f4e4f6 100644
--- a/thunar-vfs/thunar-vfs-volume-hal.c
+++ b/thunar-vfs/thunar-vfs-volume-hal.c
@@ -226,6 +226,16 @@ thunar_vfs_volume_hal_eject (ThunarVfsVolume *volume,
       g_free (standard_error);
     }
 
+  /* check if we were successfull */
+  if (G_LIKELY (result))
+    {
+      /* reset the status */
+      volume_hal->status &= ~(THUNAR_VFS_VOLUME_STATUS_MOUNTED | THUNAR_VFS_VOLUME_STATUS_PRESENT);
+
+      /* emit "changed" on the volume */
+      thunar_vfs_volume_changed (THUNAR_VFS_VOLUME (volume_hal));
+    }
+
   /* cleanup */
   g_free (command_line);
 
@@ -399,6 +409,16 @@ thunar_vfs_volume_hal_unmount (ThunarVfsVolume *volume,
       g_free (standard_error);
     }
 
+  /* check if we were successfull */
+  if (G_LIKELY (result))
+    {
+      /* reset the status */
+      volume_hal->status &= ~THUNAR_VFS_VOLUME_STATUS_MOUNTED;
+
+      /* emit "changed" on the volume */
+      thunar_vfs_volume_changed (THUNAR_VFS_VOLUME (volume_hal));
+    }
+
   /* cleanup */
   g_free (command_line);
 
-- 
GitLab