watchlist,watchedpath: Query file type directly
I'm not entirely sure why, possibly a bug in some version(s) of GLib, the file type returned by the `get_file_type` method of a `FileInfo` object yielded by a `FileEnumerator` is always `UNKNOWN`. Querying the file type directly using `File.query_file_type` works much more reliably.master
parent
299be2cb38
commit
9394984137
|
@ -70,7 +70,8 @@ namespace onchanged {
|
||||||
FileInfo info;
|
FileInfo info;
|
||||||
while ((info = enumerator.next_file()) != null) {
|
while ((info = enumerator.next_file()) != null) {
|
||||||
var f = dir.resolve_relative_path(info.get_name());
|
var f = dir.resolve_relative_path(info.get_name());
|
||||||
if (info.get_file_type() == FileType.DIRECTORY) {
|
var ftype = f.query_file_type(FileQueryInfoFlags.NONE);
|
||||||
|
if (ftype == FileType.DIRECTORY) {
|
||||||
watch(f);
|
watch(f);
|
||||||
watch_children(f);
|
watch_children(f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,8 @@ namespace onchanged {
|
||||||
FileInfo info;
|
FileInfo info;
|
||||||
while ((info = enumerator.next_file()) != null) {
|
while ((info = enumerator.next_file()) != null) {
|
||||||
var f = dir.resolve_relative_path(info.get_name());
|
var f = dir.resolve_relative_path(info.get_name());
|
||||||
if (info.get_file_type() == FileType.DIRECTORY) {
|
var ftype = f.query_file_type(FileQueryInfoFlags.NONE);
|
||||||
|
if (ftype == FileType.DIRECTORY) {
|
||||||
read_config_dir(f);
|
read_config_dir(f);
|
||||||
} else {
|
} else {
|
||||||
read_config(f.get_path());
|
read_config(f.get_path());
|
||||||
|
|
Loading…
Reference in New Issue