[baobab/reroot-view: 10/35] Make sure a location has always a name



commit 96bc224eb126c287851034cf07efbef1655c42da
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Wed Jun 17 19:23:53 2020 +0200

    Make sure a location has always a name

 src/baobab-location.vala | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/baobab-location.vala b/src/baobab-location.vala
index e5f85fe..5d04747 100644
--- a/src/baobab-location.vala
+++ b/src/baobab-location.vala
@@ -123,6 +123,13 @@ namespace Baobab {
         public Location.for_file (File file_, ScanFlags flags) {
             file = file_;
 
+            try {
+                var info = file.query_info (FileAttribute.STANDARD_DISPLAY_NAME, FileQueryInfoFlags.NONE, 
null);
+                name = info.get_display_name ();
+            } catch {
+                name = Filename.display_name (file.get_parse_name ());
+            }
+
             scanner = new Scanner (file, flags);
         }
 


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