[tracker/direct-access] libtracker-bus: Fixed steroids detection



commit 0911044a0c7ccde332090381e1cab5b6a1612bbb
Author: Martyn Russell <martyn lanedo com>
Date:   Thu Jul 22 10:54:44 2010 +0100

    libtracker-bus: Fixed steroids detection
    
    Changed critical message to a dbus message now
    Also reverted the changes to avoid missing symbol warnings

 src/libtracker-bus/config.vapi             |    2 +-
 src/libtracker-bus/tracker-bus-fd-cursor.c |   16 +++++++++++++---
 src/libtracker-bus/tracker-bus.vala        |    5 +++--
 3 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-bus/config.vapi b/src/libtracker-bus/config.vapi
index 3c95394..8661b59 100644
--- a/src/libtracker-bus/config.vapi
+++ b/src/libtracker-bus/config.vapi
@@ -19,5 +19,5 @@
 
 [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
 namespace Config {
-	public const bool HAVE_DBUS_FD_PASSING_IN_VALA;
+	public const string HAVE_DBUS_FD_PASSING_IN_VALA;
 }
diff --git a/src/libtracker-bus/tracker-bus-fd-cursor.c b/src/libtracker-bus/tracker-bus-fd-cursor.c
index 5c7721b..0012188 100644
--- a/src/libtracker-bus/tracker-bus-fd-cursor.c
+++ b/src/libtracker-bus/tracker-bus-fd-cursor.c
@@ -32,8 +32,6 @@
 #include "tracker-bus.h"
 #include "tracker-bus-fd-cursor.h"
 
-#ifdef HAVE_DBUS_FD_PASSING
-
 #define TRACKER_TYPE_BUS_FD_CURSOR           (tracker_bus_fd_cursor_get_type ())
 #define TRACKER_BUS_FD_CURSOR(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_BUS_FD_CURSOR, TrackerBusFDCursor))
 #define TRACKER_BUS_FD_CURSOR_CLASS(c)       (G_TYPE_CHECK_CLASS_CAST ((c),      TRACKER_TYPE_BUS_FD_CURSOR, TrackerBusFDCursorClass))
@@ -226,6 +224,7 @@ tracker_bus_fd_query (DBusGConnection  *gconnection,
                       const gchar      *query,
                       GError          **error)
 {
+#ifdef HAVE_DBUS_FD_PASSING
 	DBusConnection *connection;
 	DBusMessage *message;
 	DBusMessageIter iter;
@@ -271,8 +270,14 @@ tracker_bus_fd_query (DBusGConnection  *gconnection,
 		cursor = NULL;
 	}
 	return TRACKER_SPARQL_CURSOR (cursor);
+#else  /* HAVE_DBUS_FD_PASSING */
+        g_assert_not_reached ();
+        return NULL;
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
+#ifdef HAVE_DBUS_FD_PASSING
+
 static void
 query_async_cb (gpointer  buffer,
                 gssize    buffer_size,
@@ -300,12 +305,15 @@ query_async_cb (gpointer  buffer,
 	g_object_unref (res);
 }
 
+#endif /* HAVE_DBUS_FD_PASSING */
+
 void
 tracker_bus_fd_query_async (DBusGConnection     *gconnection,
                             const gchar         *query,
                             GAsyncReadyCallback  callback,
                             gpointer             user_data)
 {
+#ifdef HAVE_DBUS_FD_PASSING
 	GSimpleAsyncResult *res;
 	DBusConnection *connection;
 	DBusMessage *message;
@@ -348,6 +356,9 @@ tracker_bus_fd_query_async (DBusGConnection     *gconnection,
 	                                    NULL,
 	                                    query_async_cb, res);
 	/* message is destroyed by tracker_dbus_send_and_splice_async */
+#else  /* HAVE_DBUS_FD_PASSING */
+        g_assert_not_reached ();
+#endif /* HAVE_DBUS_FD_PASSING */
 }
 
 TrackerSparqlCursor *
@@ -363,4 +374,3 @@ tracker_bus_fd_query_finish (GAsyncResult     *res,
 	return g_object_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)));
 }
 
-#endif /* HAVE_DBUS_FD_PASSING */
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index ff3e0bf..13112c9 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -57,12 +57,13 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 		initialized = true;
 		
 		try {
-			if (Config.HAVE_DBUS_FD_PASSING_IN_VALA) {
+			if (strcmp (Config.HAVE_DBUS_FD_PASSING_IN_VALA, "1") == 0) {
 				use_steroids = true;
 			} else {
 				use_steroids = false;
 			}
-			critical ("use steroids = %s", use_steroids ? "yes" : "no");
+
+			debug ("Using steroids = %s", use_steroids ? "yes" : "no");
 
 			connection = DBus.Bus.get (DBus.BusType.SESSION);
 



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