[nautilus-actions] NAIContext:is_candidate_for_show_if_registered(): consider having either gdbus or dbus-glib



commit b8b149c1767ecb5dee3893363433e36fe05419f1
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Jan 29 11:28:43 2012 +0100

    NAIContext:is_candidate_for_show_if_registered(): consider having either gdbus or dbus-glib

 ChangeLog              |    3 +++
 src/core/na-icontext.c |   11 +++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f5feb17..0cd574b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-01-29 Pierre Wieser <pwieser trychlos org>
 
+	* src/core/na-icontext.c (is_candidate_for_show_if_registered):
+	Consider having either GDBus or DBus-GLib.
+
 	* m4/na-check-for-gdbus.m4: Setup CFLAGS and LIBS flags.
 
 2012-01-28 Pierre Wieser <pwieser trychlos org>
diff --git a/src/core/na-icontext.c b/src/core/na-icontext.c
index 502d049..945e055 100644
--- a/src/core/na-icontext.c
+++ b/src/core/na-icontext.c
@@ -32,7 +32,13 @@
 #include <config.h>
 #endif
 
+#ifdef HAVE_GDBUS
+#include <gio/gio.h>
+#else
+# ifdef HAVE_DBUS_GLIB
 #include <dbus/dbus-glib.h>
+# endif
+#endif
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -597,6 +603,9 @@ is_candidate_for_show_if_registered( const NAIContext *object, guint target, GLi
 
 	if( name && strlen( name )){
 		ok = FALSE;
+#ifdef HAVE_GDBUS
+#else
+# ifdef HAVE_DBUS_GLIB
 		GError *error = NULL;
 		DBusGConnection *connection = dbus_g_bus_get( DBUS_BUS_SESSION, &error );
 
@@ -611,6 +620,8 @@ is_candidate_for_show_if_registered( const NAIContext *object, guint target, GLi
 			ok = ( proxy != NULL );
 			dbus_g_connection_unref( connection );
 		}
+# endif
+#endif
 	}
 
 	if( !ok ){



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