[baobab/wip/grid-layout] Update volume information when it is mounted



commit 72a00269b78165f6a9fc04d24febb20300f7b154
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Wed Apr 25 23:21:25 2012 +0200

    Update volume information when it is mounted

 src/baobab-location-monitor.vala |   10 +++++++++-
 src/baobab-location.vala         |    4 ++++
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-location-monitor.vala b/src/baobab-location-monitor.vala
index 47c45e1..a8d80ff 100644
--- a/src/baobab-location-monitor.vala
+++ b/src/baobab-location-monitor.vala
@@ -89,8 +89,16 @@ namespace Baobab {
         }
 
         void mount_added (Mount mount) {
-            if (mount.get_volume () == null) {
+            var volume = mount.get_volume ();
+            if (volume == null) {
                 locations.append (new Location.from_mount (mount));
+            } else {
+                foreach (var location in locations) {
+                    if (location.volume == volume) {
+                        location.update ();
+                        break;
+                    }
+                }
             }
 
             changed ();
diff --git a/src/baobab-location.vala b/src/baobab-location.vala
index 240fe26..def267e 100644
--- a/src/baobab-location.vala
+++ b/src/baobab-location.vala
@@ -74,6 +74,10 @@ namespace Baobab {
             make_this_home_location ();
         }
 
+        public void update () {
+            update_volume_info ();
+        }
+
         void make_this_home_location () {
             name = _("Home folder");
             icon = new ThemedIcon ("user-home");



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