[rygel-gst-0-10-plugins] Make monitoring enabled by default.



commit 8c0febfa2dd9fc69aac0321569da1ac6c23b538b
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Tue Feb 5 16:02:24 2013 +0100

    Make monitoring enabled by default.

 .../rygel-media-export-recursive-file-monitor.c    |   37 +++++++++++++++----
 1 files changed, 29 insertions(+), 8 deletions(-)
---
diff --git a/src/media-export/rygel-media-export-recursive-file-monitor.c b/src/media-export/rygel-media-export-recursive-file-monitor.c
index 613104a..419c136 100644
--- a/src/media-export/rygel-media-export-recursive-file-monitor.c
+++ b/src/media-export/rygel-media-export-recursive-file-monitor.c
@@ -54,6 +54,8 @@ static void rygel_media_export_recursive_file_monitor_on_cancelled (GCancellable
 static void
 rygel_media_export_recursive_file_monitor_on_config_changed (RygelConfiguration *config, const gchar *section, const gchar *key, gpointer user_data) {
   RygelMediaExportRecursiveFileMonitor *self = RYGEL_MEDIA_EXPORT_RECURSIVE_FILE_MONITOR (user_data);
+  gboolean setting;
+  GError *inner_error = NULL;
 
   g_return_if_fail (self);
   g_return_if_fail (config);
@@ -65,9 +67,15 @@ rygel_media_export_recursive_file_monitor_on_config_changed (RygelConfiguration
     return;
   }
 
-  self->priv->monitor_changes = rygel_configuration_get_bool (config,
-    RYGEL_MEDIA_EXPORT_PLUGIN_NAME,
-    "monitor-changes", NULL);
+  setting = rygel_configuration_get_bool (config,
+					  RYGEL_MEDIA_EXPORT_PLUGIN_NAME,
+					  "monitor-changes",
+					  &inner_error);
+  if (inner_error) {
+    setting = TRUE;
+    g_error_free (inner_error);
+  }
+  self->priv->monitor_changes = setting;
 }
 
 
@@ -75,9 +83,10 @@ static RygelMediaExportRecursiveFileMonitor*
 rygel_media_export_recursive_file_monitor_construct (GType object_type, GCancellable *cancellable) {
   RygelMediaExportRecursiveFileMonitor *self;
   RygelMetaConfig *config;
+  GError *inner_error;
+  gboolean setting;
   
   self = RYGEL_MEDIA_EXPORT_RECURSIVE_FILE_MONITOR (g_object_new (object_type, NULL));
-  self->priv->monitor_changes = TRUE;
   
   config = rygel_meta_config_get_default ();
   
@@ -87,11 +96,23 @@ rygel_media_export_recursive_file_monitor_construct (GType object_type, GCancell
   rygel_media_export_recursive_file_monitor_on_config_changed (RYGEL_CONFIGURATION (config),
     RYGEL_MEDIA_EXPORT_PLUGIN_NAME, "monitor-changes", self);
 
-  if(!rygel_configuration_get_bool (RYGEL_CONFIGURATION (config),
-    "MediaExport", "monitor-changes", NULL)) {
-    g_message ("rygel-media-export-recursive-file-monitor.c: %s",
-      _("Will not monitor file changes"));
+  inner_error = NULL;
+  setting = rygel_configuration_get_bool (RYGEL_CONFIGURATION (config),
+					  "MediaExport",
+					  "monitor-changes",
+					  &inner_error);
+
+  if (inner_error) {
+    setting = TRUE;
+    g_error_free (inner_error);
+  }
+
+  if (!setting) {
+    g_message (_("Will not monitor file changes"));
   }
+
+  self->priv->monitor_changes = setting;
+
   
   self->priv->monitors = gee_hash_map_new (G_TYPE_FILE,
     (GBoxedCopyFunc) g_object_ref, g_object_unref,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]