[baobab/reroot-view: 8/30] Make sure a location has always a name
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/reroot-view: 8/30] Make sure a location has always a name
- Date: Tue, 23 Jun 2020 10:38:42 +0000 (UTC)
commit 42a5eb9e16e673b3060ee0346b5b9d5a4add0512
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]