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



commit e35e654929ed585caf062d165657d7eceb8e57b9
Author: Damien Sandras <dsandras beip be>
Date:   Thu Nov 14 19:37:15 2013 +0100

    Jabber: Ported to GSettings.

 org.gnome.ekiga.gschema.xml.in.in    |    3 +++
 plugins/loudmouth/Makefile.am        |    2 +-
 plugins/loudmouth/loudmouth-bank.cpp |    9 ++++-----
 plugins/loudmouth/loudmouth-bank.h   |    3 +++
 4 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/org.gnome.ekiga.gschema.xml.in.in b/org.gnome.ekiga.gschema.xml.in.in
index 9610641..208644a 100644
--- a/org.gnome.ekiga.gschema.xml.in.in
+++ b/org.gnome.ekiga.gschema.xml.in.in
@@ -515,6 +515,9 @@
       <_summary>Resource lists</_summary>
       <_description>List of configured resource lists</_description>
     </key>
+    <key name="jabber" type="s">
+      <default>''</default>
+    </key>
     <key name="call-history" type="s">
       <default>''</default>
       <_summary>Calls history</_summary>
diff --git a/plugins/loudmouth/Makefile.am b/plugins/loudmouth/Makefile.am
index 6613bc2..138068c 100644
--- a/plugins/loudmouth/Makefile.am
+++ b/plugins/loudmouth/Makefile.am
@@ -2,7 +2,7 @@ plugin_LTLIBRARIES = libgmloudmouth.la
 
 AM_CXXFLAGS = \
        $(BOOST_CPPFLAGS) $(XML_CFLAGS) $(LOUDMOUTH_CFLAGS) \
-       -I$(top_srcdir)/lib/gmconf \
+       -I$(top_srcdir)/lib/ \
        -I$(top_srcdir)/lib/engine/framework \
        -I$(top_srcdir)/lib/engine/account \
        -I$(top_srcdir)/lib/engine/presence \
diff --git a/plugins/loudmouth/loudmouth-bank.cpp b/plugins/loudmouth/loudmouth-bank.cpp
index 3f27430..cdcab55 100644
--- a/plugins/loudmouth/loudmouth-bank.cpp
+++ b/plugins/loudmouth/loudmouth-bank.cpp
@@ -41,18 +41,18 @@
 
 #include "form-request-simple.h"
 
-#define JABBER_KEY CONTACTS_KEY "jabber"
+#define JABBER_KEY "jabber"
 
 LM::Bank::Bank (boost::shared_ptr<Ekiga::PersonalDetails> details_,
                boost::shared_ptr<Dialect> dialect_,
                boost::shared_ptr<Cluster> cluster_):
   details(details_), cluster(cluster_), dialect(dialect_), doc (NULL)
 {
-  gchar* c_raw = gm_conf_get_string (JABBER_KEY);
+  contacts_settings = boost::shared_ptr<Ekiga::Settings> (new Ekiga::Settings (CONTACTS_SCHEMA));
+  std::string raw = contacts_settings->get_string (JABBER_KEY);
 
-  if (c_raw != NULL) { // we already have it in store
+  if (!raw.empty ()) { // we already have it in store
 
-    const std::string raw = c_raw;
     doc = xmlRecoverMemory (raw.c_str (), raw.length ());
     xmlNodePtr root = xmlDocGetRootElement (doc);
     if (root == NULL) {
@@ -69,7 +69,6 @@ LM::Bank::Bank (boost::shared_ptr<Ekiga::PersonalDetails> details_,
        add (account);
       }
     }
-    g_free (c_raw);
 
   } else { // create a new XML document
 
diff --git a/plugins/loudmouth/loudmouth-bank.h b/plugins/loudmouth/loudmouth-bank.h
index 4e91630..8875a2f 100644
--- a/plugins/loudmouth/loudmouth-bank.h
+++ b/plugins/loudmouth/loudmouth-bank.h
@@ -43,6 +43,8 @@
 #include "loudmouth-account.h"
 #include "loudmouth-dialect.h"
 
+#include "ekiga-settings.h"
+
 namespace LM
 {
 
@@ -88,6 +90,7 @@ namespace LM
   };
 
   typedef boost::shared_ptr<Bank> BankPtr;
+  boost::shared_ptr<Ekiga::Settings> contacts_settings;
 };
 
 #endif


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