[ekiga/ds-gsettings3] Local Roster: Ported to GSettings.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gsettings3] Local Roster: Ported to GSettings.
- Date: Sun, 17 Nov 2013 16:55:06 +0000 (UTC)
commit 7bef5486d7bab20ab128b6aa4bcd42f57188e9d8
Author: Damien Sandras <dsandras beip be>
Date: Sun Nov 17 17:37:36 2013 +0100
Local Roster: Ported to GSettings.
lib/engine/components/local-roster/local-heap.cpp | 14 ++++++--------
lib/engine/components/local-roster/local-heap.h | 3 +++
2 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/lib/engine/components/local-roster/local-heap.cpp
b/lib/engine/components/local-roster/local-heap.cpp
index 1111a74..5f2d1de 100644
--- a/lib/engine/components/local-roster/local-heap.cpp
+++ b/lib/engine/components/local-roster/local-heap.cpp
@@ -38,13 +38,13 @@
#include <set>
#include <glib/gi18n.h>
-#include "gmconf.h"
-
#include "form-request-simple.h"
#include "local-cluster.h"
#include "local-presentity.h"
+#define ROSTER_KEY "roster"
+
/*
* Public API
*/
@@ -53,12 +53,12 @@ Local::Heap::Heap (boost::shared_ptr<Ekiga::PresenceCore> _presence_core,
presence_core(_presence_core), local_cluster(_local_cluster), doc ()
{
xmlNodePtr root;
- gchar *c_raw = gm_conf_get_string (ROSTER_KEY);
+ contacts_settings = boost::shared_ptr<Ekiga::Settings> (new Ekiga::Settings (CONTACTS_SCHEMA));
+ std::string raw = contacts_settings->get_string (ROSTER_KEY);
// Build the XML document representing the contacts list from the configuration
- 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);
@@ -76,8 +76,6 @@ Local::Heap::Heap (boost::shared_ptr<Ekiga::PresenceCore> _presence_core,
&& xmlStrEqual (BAD_CAST ("entry"), child->name))
add (child);
- g_free (c_raw);
-
// Or create a new XML document
}
else {
@@ -377,7 +375,7 @@ Local::Heap::save () const
xmlDocDumpMemory (doc.get (), &buffer, &doc_size);
- gm_conf_set_string (ROSTER_KEY, (const char *)buffer);
+ contacts_settings->set_string (ROSTER_KEY, (const char *)buffer);
xmlFree (buffer);
}
diff --git a/lib/engine/components/local-roster/local-heap.h b/lib/engine/components/local-roster/local-heap.h
index 820e846..c94e9b0 100644
--- a/lib/engine/components/local-roster/local-heap.h
+++ b/lib/engine/components/local-roster/local-heap.h
@@ -41,6 +41,8 @@
#include "friend-or-foe.h"
#include "local-presentity.h"
+#include "ekiga-settings.h"
+
namespace Local
{
/**
@@ -208,6 +210,7 @@ namespace Local
boost::weak_ptr<Ekiga::PresenceCore> presence_core;
boost::weak_ptr<Local::Cluster> local_cluster;
boost::shared_ptr<xmlDoc> doc;
+ boost::shared_ptr<Ekiga::Settings> contacts_settings;
};
typedef boost::shared_ptr<Heap> HeapPtr;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]