diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-06-03 08:54:49 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-06-03 08:54:49 +0200 |
commit | 7dec5f41b2cffafe4d743273600e2868d116166d (patch) | |
tree | 1ea5e30103db6e2e8454f5c5c2e885008dc7d99d /src/DirectoryMonitor.vala | |
parent | 9e7cd144725a270e0460b21747619f447ca87684 (diff) |
New upstream version 0.26.2upstream/0.26.2
Diffstat (limited to 'src/DirectoryMonitor.vala')
-rw-r--r-- | src/DirectoryMonitor.vala | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/DirectoryMonitor.vala b/src/DirectoryMonitor.vala index 50d0048..a37b124 100644 --- a/src/DirectoryMonitor.vala +++ b/src/DirectoryMonitor.vala @@ -109,6 +109,10 @@ public class DirectoryMonitor : Object { // finish the async operation to get the result try { info = source_file.query_info_async.end(aresult); + if (get_file_info_id(info) == null) { + info.set_attribute_string(FileAttribute.ID_FILE, + file.get_uri()); + } } catch (Error err) { this.err = err; } @@ -267,8 +271,10 @@ public class DirectoryMonitor : Object { return null; string? id = info.get_attribute_string(FileAttribute.ID_FILE); - if (id == null) - return null; + if (id == null) { + info.set_attribute_string(FileAttribute.ID_FILE, + file.get_uri()); + } File? normalized = id_map.get(id); if (normalized == null) @@ -874,14 +880,10 @@ public class DirectoryMonitor : Object { } // File ID is required for directory monitoring. No ID, no ride! - // TODO: Replace the warning with notify_discovery_failed() and provide a user-visible - // string. + // So we just fake it by using the URI if (get_file_info_id(local_dir_info) == null) { - warning("Unable to retrieve file ID on %s: skipping", dir.get_path()); - - explore_directory_completed(in_discovery); - - return; + local_dir_info.set_attribute_string(FileAttribute.ID_FILE, + dir.get_uri()); } // verify this is a directory @@ -911,6 +913,10 @@ public class DirectoryMonitor : Object { break; foreach (FileInfo info in infos) { + if (get_file_info_id(info) == null) { + info.set_attribute_string(FileAttribute.ID_FILE, + dir.get_uri()); + } // we don't deal with hidden files or directories if (info.get_is_hidden()) { warning("Skipping hidden file/directory %s", |