diff --git a/obexd/plugins/syncevolution.c b/obexd/plugins/syncevolution.c
index 05f5cce..711b5a0 100644
--- a/obexd/plugins/syncevolution.c
+++ b/obexd/plugins/syncevolution.c
struct callback_data *cb_data;
struct synce_context *context;
- conn = dbus_bus_get(DBUS_BUS_SESSION, NULL);
+ conn = obex_dbus_get_connection();
if (!conn)
goto failed;
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index be0af44..e1778e1 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
g_free(path);
}
+DBusConnection *obex_dbus_get_connection(void)
+{
+ if (connection == NULL)
+ return NULL;
+ return dbus_connection_ref(connection);
+}
diff --git a/obexd/src/obexd.h b/obexd/src/obexd.h
index e69872d..94ec795 100644
--- a/obexd/src/obexd.h
+++ b/obexd/src/obexd.h
*
*/
+#include <dbus/dbus.h>
+
#define OPENOBEX_SERVICE "org.openobex"
#define OPENOBEX_MANAGER_PATH "/"
gboolean plugin_init(void);
void plugin_cleanup(void);
+
+DBusConnection *obex_dbus_get_connection(void);