[rygel/rygel-0-30] media-export: Suppress useless warning
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/rygel-0-30] media-export: Suppress useless warning
- Date: Sat, 21 May 2016 10:26:09 +0000 (UTC)
commit 4eff8121b53ae54dd6e3442934486f9902f86feb
Author: Jens Georg <mail jensge org>
Date: Sat Apr 30 17:58:49 2016 +0200
media-export: Suppress useless warning
If the backend does not support monitoring, just issue a debug and not a
warning that we were not able to get the file information.
Signed-off-by: Jens Georg <mail jensge org>
https://bugzilla.gnome.org/show_bug.cgi?id=685800
.../rygel-media-export-recursive-file-monitor.vala | 26 +++++++++++--------
1 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala
b/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala
index 48772be..60df2e8 100644
--- a/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala
+++ b/src/plugins/media-export/rygel-media-export-recursive-file-monitor.vala
@@ -84,23 +84,27 @@ public class Rygel.MediaExport.RecursiveFileMonitor : Object {
FileQueryInfoFlags.NONE,
Priority.DEFAULT,
null);
- if (info.get_file_type () == FileType.DIRECTORY) {
- var file_monitor = file.monitor_directory
- (FileMonitorFlags.NONE,
- this.cancellable);
- this.monitors.set (file, file_monitor);
- file_monitor.changed.connect (this.on_monitor_changed);
+ if (info.get_file_type () != FileType.DIRECTORY) {
+ return;
}
+
+ var file_monitor = file.monitor_directory (FileMonitorFlags.NONE,
+ this.cancellable);
+ this.monitors.set (file, file_monitor);
+ file_monitor.changed.connect (this.on_monitor_changed);
} catch (Error err) {
- if (!(err is IOError.NOT_FOUND)) {
+ if (err is IOError.NOT_FOUND) {
+ debug ("File %s disappeared while trying to get information",
+ file.get_uri ());
+ } else if (err is IOError.NOT_SUPPORTED) {
+ debug ("File monitoring is not supported for %s",
+ file.get_uri ());
+ } else {
// Avoid warning when file is removed in the meantime, e.g. in
// upload case.
- warning (_("Failed to get file information for %s: %s"),
+ warning (("Failed to setup up file monitor for %s: %s"),
file.get_uri (),
err.message);
- } else {
- debug ("File %s disappeared while trying to get information",
- file.get_uri ());
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]