[tracker/gconf-dbus] squash
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/gconf-dbus] squash
- Date: Fri, 1 Apr 2011 12:28:40 +0000 (UTC)
commit 5bd4654754fd9dcb5345f234476a61db60152be5
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Apr 1 14:28:29 2011 +0200
squash
src/libtracker-common/tracker-locale-gconfdbus.c | 33 ++++++++++++++++------
1 files changed, 24 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-common/tracker-locale-gconfdbus.c b/src/libtracker-common/tracker-locale-gconfdbus.c
index 1e512b8..1f15fdb 100644
--- a/src/libtracker-common/tracker-locale-gconfdbus.c
+++ b/src/libtracker-common/tracker-locale-gconfdbus.c
@@ -23,6 +23,8 @@
#include <string.h>
#include <glib.h>
+#include <glib-object.h>
+#include <gio/gio.h>
#include "tracker-locale-gconfdbus.h"
@@ -45,6 +47,7 @@ static gboolean service_running = FALSE;
static guint watch_name_id = 0;
static guint registration_id = 0;
static GStaticMutex subscribers_mutex = G_STATIC_MUTEX_INIT;
+GDBusNodeInfo *introspection_data = NULL;
/* gconf keys for tracker locales, as defined in:
* http://apidocs.meego.com/1.0/mtf/i18n.html
@@ -83,6 +86,7 @@ static gboolean
add_notify (void)
{
GVariant *reply;
+ GError *error = NULL;
reply = g_dbus_connection_call_sync (connection,
GCONF_DBUS_SERVICE,
@@ -121,10 +125,11 @@ handle_method_call (GDBusConnection *connection,
if (g_strcmp0 (method_name, "Notify") == 0) {
const gchar *key, *value, *schema, *database, *namespace_name;
- gboolean is_set, is_default, is_writable, found = FALSE;
+ gboolean is_set, is_default, is_writable;
gint type, i;
+ GSList *li;
- g_variant_get (reply, "(&s&s" VALUE_SIGNATURE ")",
+ g_variant_get (parameters, "(&s&s" VALUE_SIGNATURE ")",
&database, &namespace_name,
&key, &type, &value,
&is_set, &schema,
@@ -220,25 +225,28 @@ static void
on_gconfd_dbus_disappeared (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
+{
service_running = FALSE;
}
static gchar *
-get_value_from_config (const gchar *key)
+get_value_from_config (const gchar *key_in)
{
const gchar *locale = setlocale (LC_CTYPE, NULL);
const gchar *key, *value, *schema;
gchar *val;
gboolean is_set, is_default, is_writable;
gint type;
+ GError *error = NULL;
+ GVariant *reply;
reply = g_dbus_connection_call_sync (connection,
GCONF_DBUS_SERVICE,
gconf_dbus_default_db,
GCONF_DBUS_DATABASE_INTERFACE,
"LookupExtended",
- g_variant_new ("(ssb)", key, locale, TRUE),
+ g_variant_new ("(ssb)", key_in, locale, TRUE),
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
@@ -280,6 +288,8 @@ tracker_locale_gconfdbus_init (void)
if (g_getenv (TRACKER_DISABLE_MEEGOTOUCH_LOCALE_ENV)) {
GError *error = NULL;
GVariant *reply;
+ guint i;
+
GDBusInterfaceVTable interface_vtable = {
handle_method_call,
handle_get_property,
@@ -318,7 +328,7 @@ tracker_locale_gconfdbus_init (void)
return;
}
- gconf_dbus_default_db = g_variant_get_string (reply);
+ gconf_dbus_default_db = g_variant_dup_string (reply, NULL);
g_variant_unref (reply);
@@ -358,7 +368,7 @@ tracker_locale_gconfdbus_init (void)
for (i = 0; i < TRACKER_LOCALE_LAST; i++) {
gchar *str;
- str = get_value_from_config (gconf_locales[i])
+ str = get_value_from_config (gconf_locales[i]);
tracker_locale_set (i, str);
g_free (str);
}
@@ -370,6 +380,7 @@ tracker_locale_gconfdbus_shutdown (void)
{
if (gconf_dbus_default_db != NULL && connection != NULL) {
GVariant *reply;
+ GError *error = NULL;
reply = g_dbus_connection_call_sync (connection,
GCONF_DBUS_SERVICE,
@@ -401,6 +412,10 @@ tracker_locale_gconfdbus_shutdown (void)
g_free (gconf_dbus_default_db);
+ if (introspection_data) {
+ g_dbus_node_info_unref (introspection_data);
+ }
+
if (connection) {
g_object_unref (connection);
}
@@ -426,13 +441,13 @@ tracker_locale_gconfdbus_notify_add (TrackerLocaleID id,
g_static_mutex_lock (&subscribers_mutex);
subscribers = g_slist_prepend (subscribers, data);
- g_static_mutex_unlock (&subscribers_mutex)
+ g_static_mutex_unlock (&subscribers_mutex);
return data;
}
static gboolean
-destroy_locale_notify (gpointer data_p, gpointer user_data)
+destroy_locale_notify (gpointer data_p)
{
/* Always on mainloop */
@@ -468,5 +483,5 @@ tracker_locale_gconfdbus_notify_remove (gpointer notification_id)
g_idle_add (destroy_locale_notify, data);
}
- g_static_mutex_unlock (&subscribers_mutex)
+ g_static_mutex_unlock (&subscribers_mutex);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]