[rygel/config] Don't use GConf.Client.get_bool ()



commit 50c201faeca8887efa77889ffe9fc52cc5d3c1d3
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Apr 23 18:44:49 2009 +0300

    Don't use GConf.Client.get_bool ()
    
    When an entry is not found, this method just returns false instead of
    signaling an error so we never know if key is not there or it's value is
    set to false.
---
 src/rygel/rygel-config-reader.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/rygel/rygel-config-reader.vala b/src/rygel/rygel-config-reader.vala
index 4a4e240..7ab2cde 100644
--- a/src/rygel/rygel-config-reader.vala
+++ b/src/rygel/rygel-config-reader.vala
@@ -116,7 +116,12 @@ public class Rygel.ConfigReader {
         var path = ROOT_GCONF_PATH + section + "/" + key;
 
         try {
-            val = this.gconf.get_bool (path);
+            unowned GConf.Value value = this.gconf.get (path);
+            if (value != null) {
+                val = value.get_bool ();
+            } else {
+                val = default_value;
+            }
         } catch (GLib.Error error) {
             val = default_value;
         }



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