[ekiga/ds-gsettings3] RL: Ported to GSettings.



commit c65d6f0c3f15c93b864cac62d13cfb9f1372c73b
Author: Damien Sandras <dsandras beip be>
Date:   Thu Nov 14 19:27:03 2013 +0100

    RL: Ported to GSettings.

 org.gnome.ekiga.gschema.xml.in.in    |    5 +++++
 plugins/resource-list/rl-cluster.cpp |   13 ++++---------
 plugins/resource-list/rl-cluster.h   |    3 ++-
 3 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/org.gnome.ekiga.gschema.xml.in.in b/org.gnome.ekiga.gschema.xml.in.in
index e86b03f..9610641 100644
--- a/org.gnome.ekiga.gschema.xml.in.in
+++ b/org.gnome.ekiga.gschema.xml.in.in
@@ -510,6 +510,11 @@
       <_summary>LDAP servers</_summary>
       <_description>List of configured LDAP servers</_description>
     </key>
+    <key name="resource-lists" type="s">
+      <default>''</default>
+      <_summary>Resource lists</_summary>
+      <_description>List of configured resource lists</_description>
+    </key>
     <key name="call-history" type="s">
       <default>''</default>
       <_summary>Calls history</_summary>
diff --git a/plugins/resource-list/rl-cluster.cpp b/plugins/resource-list/rl-cluster.cpp
index dc57c94..397e4c3 100644
--- a/plugins/resource-list/rl-cluster.cpp
+++ b/plugins/resource-list/rl-cluster.cpp
@@ -40,28 +40,24 @@
 
 #include "rl-cluster.h"
 
-#include "gmconf.h"
 #include "form-request-simple.h"
 #include "presence-core.h"
 
 #include <iostream>
 
-#define RL_KEY CONTACTS_KEY "resource-lists"
+#define RL_KEY "resource-lists"
 
 RL::Cluster::Cluster (Ekiga::ServiceCore& core_): core(core_), doc()
 {
-  gchar* c_raw = NULL;
-
   boost::shared_ptr<Ekiga::PresenceCore> presence_core = core.get<Ekiga::PresenceCore> ("presence-core");
 
   presence_core->presence_received.connect (boost::bind (&RL::Cluster::on_presence_received, this, _1, _2));
   presence_core->status_received.connect (boost::bind (&RL::Cluster::on_status_received, this, _1, _2));
+  contacts_settings = boost::shared_ptr<Ekiga::Settings> (new Ekiga::Settings (CONTACTS_SCHEMA));
+  std::string raw = contacts_settings->get_string (RL_KEY);
 
-  c_raw = gm_conf_get_string (RL_KEY);
-
-  if (c_raw != NULL) {
+  if (!raw.empty ()) {
 
-    const std::string raw = c_raw;
     doc = boost::shared_ptr<xmlDoc> (xmlRecoverMemory (raw.c_str (), raw.length ()), xmlFreeDoc);
     if ( !doc)
       doc = boost::shared_ptr<xmlDoc> (xmlNewDoc (BAD_CAST "1.0"), xmlFreeDoc);
@@ -81,7 +77,6 @@ RL::Cluster::Cluster (Ekiga::ServiceCore& core_): core(core_), doc()
            && xmlStrEqual (BAD_CAST "entry", child->name))
          add (child);
     }
-    g_free (c_raw);
 
   } else {
 
diff --git a/plugins/resource-list/rl-cluster.h b/plugins/resource-list/rl-cluster.h
index 5e169fc..bdee83d 100644
--- a/plugins/resource-list/rl-cluster.h
+++ b/plugins/resource-list/rl-cluster.h
@@ -41,6 +41,7 @@
 #include "cluster-impl.h"
 
 #include "rl-heap.h"
+#include "ekiga-settings.h"
 
 namespace RL {
 
@@ -94,7 +95,7 @@ namespace RL {
   };
 
   typedef boost::shared_ptr<Cluster> ClusterPtr;
-
+  boost::shared_ptr<Ekiga::Settings> contacts_settings;
 };
 
 #endif


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