[baobab] Append new volumes before the "Home folder" location
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [baobab] Append new volumes before the "Home folder" location
- Date: Wed,  3 Oct 2012 17:00:42 +0000 (UTC)
commit f3895ad5778203ad3ea44bb7720ed3aacfa5f492
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Tue Oct 2 16:59:13 2012 +0200
    Append new volumes before the "Home folder" location
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685050
 src/baobab-location-list.vala |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/baobab-location-list.vala b/src/baobab-location-list.vala
index 469e080..5a89fe1 100644
--- a/src/baobab-location-list.vala
+++ b/src/baobab-location-list.vala
@@ -69,6 +69,10 @@ namespace Baobab {
             return false;
         }
 
+        void append_to_volumes (Location location) {
+            locations.insert_before (locations.find (Location.get_home_location ()), location);
+        }
+
         void volume_changed (Volume volume) {
             update ();
         }
@@ -85,8 +89,7 @@ namespace Baobab {
         }
 
         void volume_added (Volume volume) {
-            locations.append (new Location.from_volume (volume));
-
+            append_to_volumes (new Location.from_volume (volume));
             update ();
         }
 
@@ -108,7 +111,7 @@ namespace Baobab {
             var volume = mount.get_volume ();
             if (volume == null) {
                 if (!already_present (mount.get_root ())) {
-                    locations.append (new Location.from_mount (mount));
+                    append_to_volumes (new Location.from_mount (mount));
                 }
             } else {
                 foreach (var location in locations) {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]