diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-15 20:38:57 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-12-15 20:38:57 +0100 |
commit | f1353e9ffd34db5f755c7da0b3f9c10638fbfd38 (patch) | |
tree | a1f2ab30332a6383b0677bfcc2aec687b98851d6 /src/DirectoryMonitor.vala | |
parent | f8ca421bdacee8851965a4b802ada1d2366bdbc1 (diff) | |
parent | ede50c561ec9811704821a9ea0f04c3d6c20b5af (diff) |
Merge branch 'release/0.26.4-1'0.26.4-1
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", |