[tracker/collation-gconf-locale: 5/15] tracker-locale: Fix compilation when maemo support enabled



commit 9222ba09e235de72ce7073e17fb7837de39e3a14
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Oct 28 12:12:22 2010 +0200

    tracker-locale: Fix compilation when maemo support enabled

 configure.ac                           |   17 +++++++++++++++++
 src/libtracker-common/tracker-locale.c |   14 ++++++++++----
 2 files changed, 27 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8966a37..468384e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -601,6 +601,23 @@ AC_ARG_ENABLE(maemo,
 
 AM_CONDITIONAL(HAVE_MAEMO, test "x$enable_maemo" = "xyes")
 
+if test "x$enable_maemo" = "xyes" ; then
+
+   AC_DEFINE(HAVE_MAEMO, 1, [Define if we enable Maemo specific features])
+
+   PKG_CHECK_MODULES(GCONF,
+                     [gconf-2.0],
+                     [have_gconf=yes],
+                     [have_gconf=no])
+
+   LIBTRACKER_COMMON_CFLAGS="$LIBTRACKER_COMMON_CFLAGS $GCONF_CFLAGS"
+   LIBTRACKER_COMMON_LIBS="$LIBTRACKER_COMMON_LIBS $GCONF_LIBS"
+
+   if test "x$have_gconf" != "xyes"; then
+      AC_MSG_ERROR([Couldn't find gconf, needed when enabling maemo support])
+   fi
+fi
+
 ####################################################################
 # Check for SQLite
 ####################################################################
diff --git a/src/libtracker-common/tracker-locale.c b/src/libtracker-common/tracker-locale.c
index e41e5e0..5fbd712 100644
--- a/src/libtracker-common/tracker-locale.c
+++ b/src/libtracker-common/tracker-locale.c
@@ -27,7 +27,7 @@
 #include "tracker-locale.h"
 
 #ifdef HAVE_MAEMO
-#include <gconf-client.h>
+#include <gconf/gconf-client.h>
 #endif /* HAVE_MAEMO */
 
 #ifdef HAVE_MAEMO
@@ -158,11 +158,15 @@ tracker_locale_init (void)
 	guint i;
 
 #ifdef HAVE_MAEMO
-	if (!g_getenv (DISABLE_MEEGOTOUCH_LOCALE_ENV)) {
+	if (g_getenv (DISABLE_MEEGOTOUCH_LOCALE_ENV)) {
+		g_message ("Retrieving locale from GConf is DISABLED");
+	} else {
 		GError *error = NULL;
 
+		g_message ("Retrieving locale from GConf is ENABLED");
+
 		/* Get default gconf client to query the locale values */
-		client = g_conf_client_get_default ();
+		client = gconf_client_get_default ();
 
 		/* We want to be notified when locales are changed in gconf */
 		gconf_client_add_dir (client,
@@ -302,6 +306,8 @@ tracker_locale_notify_add (TrackerLocaleID         id,
 	LOCK_SUBSCRIBERS;
 	subscribers = g_slist_prepend (subscribers, data);
 	UNLOCK_SUBSCRIBERS;
+
+	return data;
 #else
 	/* If not using gconf locales, this is a no-op... */
 	return NULL;
@@ -326,7 +332,7 @@ tracker_locale_notify_remove (gpointer notification_id)
 		if (data->destroy_notify)
 			data->destroy_notify (data->user_data);
 		/* And fully dispose the notification data */
-		g_slice_free (data);
+		g_slice_free (TrackerLocaleNotification, data);
 	}
 	UNLOCK_SUBSCRIBERS;
 #else



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