Blame SOURCES/dconf-0.26.0-Remove-libdbus-1-support.patch

844e06
From 1fb178fddf7adb041806078b20b00c89cb8a4cd1 Mon Sep 17 00:00:00 2001
844e06
From: Allison Ryan Lortie <desrt@desrt.ca>
844e06
Date: Wed, 16 Dec 2015 14:54:31 +0000
844e06
Subject: [PATCH 35/47] Remove libdbus-1 support
844e06
844e06
Stop building the dconf-dbus-1 client library.  Nobody is using it
844e06
anymore and we will soon be taking a non-conditional dependency on
844e06
libgio in any case.
844e06
844e06
It is now only possible to use dconf with GDBus.
844e06
---
844e06
 Makefile.am               |   2 +-
844e06
 configure.ac              |   3 -
844e06
 dbus-1/.gitignore         |   6 -
844e06
 dbus-1/Makefile.am        |  47 ------
844e06
 dbus-1/dconf-dbus-1.c     | 188 ------------------------
844e06
 dbus-1/dconf-dbus-1.h     |  56 -------
844e06
 dbus-1/dconf-dbus-1.pc.in |  11 --
844e06
 dbus-1/dconf-libdbus-1.c  | 365 ----------------------------------------------
844e06
 dbus-1/dconf-libdbus-1.h  |  11 --
844e06
 tests/Makefile.am         |   8 -
844e06
 10 files changed, 1 insertion(+), 696 deletions(-)
844e06
 delete mode 100644 dbus-1/.gitignore
844e06
 delete mode 100644 dbus-1/Makefile.am
844e06
 delete mode 100644 dbus-1/dconf-dbus-1.c
844e06
 delete mode 100644 dbus-1/dconf-dbus-1.h
844e06
 delete mode 100644 dbus-1/dconf-dbus-1.pc.in
844e06
 delete mode 100644 dbus-1/dconf-libdbus-1.c
844e06
 delete mode 100644 dbus-1/dconf-libdbus-1.h
844e06
844e06
diff --git a/Makefile.am b/Makefile.am
844e06
index 83cd492..dd3571a 100644
844e06
--- a/Makefile.am
844e06
+++ b/Makefile.am
844e06
@@ -2,7 +2,7 @@ include Makefile.gtester
844e06
 
844e06
 ACLOCAL_AMFLAGS = -I m4
844e06
 
844e06
-SUBDIRS = shm gvdb common engine service gdbus gsettings dbus-1 client bin docs tests
844e06
+SUBDIRS = shm gvdb common engine service gdbus gsettings client bin docs tests
844e06
 
844e06
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
844e06
 EXTRA_DIST = trim-lcov.py m4
844e06
diff --git a/configure.ac b/configure.ac
844e06
index 21b57cb..95ca9d9 100644
844e06
--- a/configure.ac
844e06
+++ b/configure.ac
844e06
@@ -47,7 +47,6 @@ GTK_DOC_CHECK([1.15])
844e06
 # Dependencies
844e06
 PKG_CHECK_MODULES(glib, glib-2.0 >= 2.44.0)
844e06
 PKG_CHECK_MODULES(gio, gio-unix-2.0)
844e06
-PKG_CHECK_MODULES(dbus, dbus-1)
844e06
 
844e06
 AC_ARG_WITH(gio_modules_dir, [  --with-gio-modules-dir=PATH choose directory for the GIO module, [default=LIBDIR/gio/modules]], giomodulesdir="$withval", giomodulesdir=${libdir}/gio/modules)
844e06
 AC_SUBST(giomodulesdir)
844e06
@@ -83,11 +82,9 @@ AC_CONFIG_FILES([
844e06
   engine/Makefile
844e06
   gdbus/Makefile
844e06
   gsettings/Makefile
844e06
-  dbus-1/dconf-dbus-1.pc
844e06
   client/dconf.pc
844e06
   client/Makefile
844e06
   service/Makefile
844e06
-  dbus-1/Makefile
844e06
   bin/Makefile
844e06
   tests/Makefile
844e06
   docs/Makefile
844e06
diff --git a/dbus-1/.gitignore b/dbus-1/.gitignore
844e06
deleted file mode 100644
844e06
index 36fad9e..0000000
844e06
--- a/dbus-1/.gitignore
844e06
+++ /dev/null
844e06
@@ -1,6 +0,0 @@
844e06
-libdconf-libdbus-1.a
844e06
-libdconf-libdbus-1-shared.a
844e06
-libdconf-dbus-1.so
844e06
-libdconf-dbus-1.so.0
844e06
-libdconf-dbus-1.so.0.0.0
844e06
-dconf-dbus-1.pc
844e06
diff --git a/dbus-1/Makefile.am b/dbus-1/Makefile.am
844e06
deleted file mode 100644
844e06
index 4e60d01..0000000
844e06
--- a/dbus-1/Makefile.am
844e06
+++ /dev/null
844e06
@@ -1,47 +0,0 @@
844e06
-include $(top_srcdir)/Makefile.gtester
844e06
-
844e06
-noinst_LIBRARIES = libdconf-libdbus-1.a libdconf-libdbus-1-shared.a
844e06
-
844e06
-libdconf_libdbus_1_a_CFLAGS = $(dbus_CFLAGS) $(glib_CFLAGS) -DG_LOG_DOMAIN=\"dconf\"
844e06
-libdconf_libdbus_1_a_SOURCES = \
844e06
-	dconf-libdbus-1.h		\
844e06
-	dconf-libdbus-1.c
844e06
-
844e06
-libdconf_libdbus_1_shared_a_CFLAGS = $(libdconf_libdbus_1_a_CFLAGS) -fPIC -DPIC
844e06
-libdconf_libdbus_1_shared_a_SOURCES = $(libdconf_libdbus_1_a_SOURCES)
844e06
-
844e06
-dconf_dbus_1includedir = $(includedir)/dconf-dbus-1
844e06
-dconf_dbus_1include_HEADERS = dconf-dbus-1.h
844e06
-
844e06
-pkgconfigdir = $(libdir)/pkgconfig
844e06
-pkgconfig_DATA = dconf-dbus-1.pc
844e06
-
844e06
-shlibdir = $(libdir)
844e06
-shlib_PROGRAMS = libdconf-dbus-1.so.0.0.0
844e06
-
844e06
-libdconf_dbus_1_so_0_0_0_CFLAGS = $(dbus_CFLAGS) $(gio_CFLAGS) -fPIC -DPIC
844e06
-libdconf_dbus_1_so_0_0_0_LDADD = \
844e06
-	../engine/libdconf-engine-shared.a		\
844e06
-	../common/libdconf-common-hidden.a		\
844e06
-	./libdconf-libdbus-1-shared.a			\
844e06
-	../gvdb/libgvdb-shared.a			\
844e06
-	../shm/libdconf-shm-shared.a			\
844e06
-	 $(dbus_LIBS)					\
844e06
-	$(glib_LIBS)
844e06
-libdconf_dbus_1_so_0_0_0_LDFLAGS = -shared -Wl,-soname=libdconf-dbus-1.so.0
844e06
-libdconf_dbus_1_so_0_0_0_SOURCES = dconf-dbus-1.c
844e06
-
844e06
-nodist_noinst_DATA = libdconf-dbus-1.so libdconf-dbus-1.so.0
844e06
-
844e06
-libdconf-dbus-1.so.0 libdconf-dbus-1.so: libdconf-dbus-1.so.0.0.0
844e06
-	$(AM_V_GEN) ln -fs libdconf-dbus-1.so.0.0.0 $@
844e06
-
844e06
-install-data-hook:
844e06
-	ln -fs libdconf-dbus-1.so.0.0.0 $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so.0
844e06
-	ln -fs libdconf-dbus-1.so.0.0.0 $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so
844e06
-
844e06
-uninstall-hook:
844e06
-	rm -f $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so.0
844e06
-	rm -f $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so
844e06
-
844e06
-CLEANFILES = libdconf-dbus-1.so.0 libdconf-dbus-1.so
844e06
diff --git a/dbus-1/dconf-dbus-1.c b/dbus-1/dconf-dbus-1.c
844e06
deleted file mode 100644
844e06
index 67de4a0..0000000
844e06
--- a/dbus-1/dconf-dbus-1.c
844e06
+++ /dev/null
844e06
@@ -1,188 +0,0 @@
844e06
-/**
844e06
- * Copyright © 2010 Canonical Limited
844e06
- *
844e06
- * This program is free software: you can redistribute it and/or modify
844e06
- * it under the terms of the GNU General Public License as published by
844e06
- * the Free Software Foundation, either version 3 of the licence, or (at
844e06
- * your option) any later version.
844e06
- *
844e06
- * This program is distributed in the hope that it will be useful, but
844e06
- * WITHOUT ANY WARRANTY; without even the implied warranty of
844e06
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
844e06
- * General Public License for more details.
844e06
- *
844e06
- * You should have received a copy of the GNU General Public License
844e06
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
844e06
- *
844e06
- * Author: Ryan Lortie <desrt@desrt.ca>
844e06
- **/
844e06
-
844e06
-#include "config.h"
844e06
-
844e06
-#include "dconf-dbus-1.h"
844e06
-
844e06
-#include "../engine/dconf-engine.h"
844e06
-#include "dconf-libdbus-1.h"
844e06
-
844e06
-#include <string.h>
844e06
-
844e06
-struct _DConfDBusClient
844e06
-{
844e06
-  DConfEngine *engine;
844e06
-  GSList *watches;
844e06
-  gint ref_count;
844e06
-};
844e06
-
844e06
-typedef struct
844e06
-{
844e06
-  gchar           *path;
844e06
-  DConfDBusNotify  notify;
844e06
-  gpointer         user_data;
844e06
-} Watch;
844e06
-
844e06
-void
844e06
-dconf_engine_change_notify (DConfEngine         *engine,
844e06
-                            const gchar         *prefix,
844e06
-                            const gchar * const *changes,
844e06
-                            const gchar         *tag,
844e06
-                            gboolean             is_writability,
844e06
-                            gpointer             origin_tag,
844e06
-                            gpointer             user_data)
844e06
-{
844e06
-  DConfDBusClient *dcdbc = user_data;
844e06
-  gchar **my_changes;
844e06
-  gint n_changes;
844e06
-  GSList *iter;
844e06
-  gint i;
844e06
-
844e06
-  n_changes = g_strv_length ((gchar **) changes);
844e06
-  my_changes = g_new (gchar *, n_changes + 1);
844e06
-
844e06
-  for (i = 0; i < n_changes; i++)
844e06
-    my_changes[i] = g_strconcat (prefix, changes[i], NULL);
844e06
-  my_changes[i] = NULL;
844e06
-
844e06
-  for (iter = dcdbc->watches; iter; iter = iter->next)
844e06
-    {
844e06
-      Watch *watch = iter->data;
844e06
-
844e06
-      for (i = 0; i < n_changes; i++)
844e06
-        if (g_str_has_prefix (my_changes[i], watch->path))
844e06
-          watch->notify (dcdbc, my_changes[i], watch->user_data);
844e06
-    }
844e06
-
844e06
-  g_strfreev (my_changes);
844e06
-}
844e06
-
844e06
-GVariant *
844e06
-dconf_dbus_client_read (DConfDBusClient *dcdbc,
844e06
-                        const gchar     *key)
844e06
-{
844e06
-  return dconf_engine_read (dcdbc->engine, NULL, key);
844e06
-}
844e06
-
844e06
-gboolean
844e06
-dconf_dbus_client_write (DConfDBusClient *dcdbc,
844e06
-                         const gchar     *key,
844e06
-                         GVariant        *value)
844e06
-{
844e06
-  DConfChangeset *changeset;
844e06
-  gboolean success;
844e06
-
844e06
-  changeset = dconf_changeset_new_write (key, value);
844e06
-  success = dconf_engine_change_fast (dcdbc->engine, changeset, NULL, NULL);
844e06
-  dconf_changeset_unref (changeset);
844e06
-
844e06
-  return success;
844e06
-}
844e06
-
844e06
-void
844e06
-dconf_dbus_client_subscribe (DConfDBusClient *dcdbc,
844e06
-                             const gchar     *path,
844e06
-                             DConfDBusNotify  notify,
844e06
-                             gpointer         user_data)
844e06
-{
844e06
-  Watch *watch;
844e06
-
844e06
-  watch = g_slice_new (Watch);
844e06
-  watch->path = g_strdup (path);
844e06
-  watch->notify = notify;
844e06
-  watch->user_data = user_data;
844e06
-
844e06
-  dcdbc->watches = g_slist_prepend (dcdbc->watches, watch);
844e06
-
844e06
-  dconf_engine_watch_fast (dcdbc->engine, path);
844e06
-}
844e06
-
844e06
-void
844e06
-dconf_dbus_client_unsubscribe (DConfDBusClient *dcdbc,
844e06
-                               DConfDBusNotify  notify,
844e06
-                               gpointer         user_data)
844e06
-{
844e06
-  GSList **ptr;
844e06
-
844e06
-  for (ptr = &dcdbc->watches; *ptr; ptr = &(*ptr)->next)
844e06
-    {
844e06
-      Watch *watch = (*ptr)->data;
844e06
-
844e06
-      if (watch->notify == notify && watch->user_data == user_data)
844e06
-        {
844e06
-          *ptr = g_slist_remove_link (*ptr, *ptr);
844e06
-          dconf_engine_unwatch_fast (dcdbc->engine, watch->path);
844e06
-          g_free (watch->path);
844e06
-          g_slice_free (Watch, watch);
844e06
-          return;
844e06
-        }
844e06
-    }
844e06
-
844e06
-  g_warning ("No matching watch found to unsubscribe");
844e06
-}
844e06
-
844e06
-gboolean
844e06
-dconf_dbus_client_has_pending (DConfDBusClient *dcdbc)
844e06
-{
844e06
-  return dconf_engine_has_outstanding (dcdbc->engine);
844e06
-}
844e06
-
844e06
-DConfDBusClient *
844e06
-dconf_dbus_client_new (const gchar    *profile,
844e06
-                       DBusConnection *session,
844e06
-                       DBusConnection *system)
844e06
-{
844e06
-  DConfDBusClient *dcdbc;
844e06
-
844e06
-  if (session == NULL)
844e06
-    session = dbus_bus_get (DBUS_BUS_SESSION, NULL);
844e06
-
844e06
-  if (system == NULL)
844e06
-    system = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
844e06
-
844e06
-  dconf_libdbus_1_provide_bus (G_BUS_TYPE_SESSION, session);
844e06
-  dconf_libdbus_1_provide_bus (G_BUS_TYPE_SYSTEM, system);
844e06
-
844e06
-  dcdbc = g_slice_new (DConfDBusClient);
844e06
-  dcdbc->engine = dconf_engine_new (NULL, dcdbc, NULL);
844e06
-  dcdbc->watches = NULL;
844e06
-  dcdbc->ref_count = 1;
844e06
-
844e06
-  return dcdbc;
844e06
-}
844e06
-
844e06
-void
844e06
-dconf_dbus_client_unref (DConfDBusClient *dcdbc)
844e06
-{
844e06
-  if (--dcdbc->ref_count == 0)
844e06
-    {
844e06
-      g_return_if_fail (dcdbc->watches == NULL);
844e06
-
844e06
-      g_slice_free (DConfDBusClient, dcdbc);
844e06
-    }
844e06
-}
844e06
-
844e06
-DConfDBusClient *
844e06
-dconf_dbus_client_ref (DConfDBusClient *dcdbc)
844e06
-{
844e06
-  dcdbc->ref_count++;
844e06
-
844e06
-  return dcdbc;
844e06
-}
844e06
diff --git a/dbus-1/dconf-dbus-1.h b/dbus-1/dconf-dbus-1.h
844e06
deleted file mode 100644
844e06
index bd204be..0000000
844e06
--- a/dbus-1/dconf-dbus-1.h
844e06
+++ /dev/null
844e06
@@ -1,56 +0,0 @@
844e06
-/**
844e06
- * Copyright © 2010 Canonical Limited
844e06
- *
844e06
- * This program is free software: you can redistribute it and/or modify
844e06
- * it under the terms of the GNU General Public License as published by
844e06
- * the Free Software Foundation, either version 3 of the licence, or (at
844e06
- * your option) any later version.
844e06
- *
844e06
- * This program is distributed in the hope that it will be useful, but
844e06
- * WITHOUT ANY WARRANTY; without even the implied warranty of
844e06
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
844e06
- * General Public License for more details.
844e06
- *
844e06
- * You should have received a copy of the GNU General Public License
844e06
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
844e06
- *
844e06
- * Author: Ryan Lortie <desrt@desrt.ca>
844e06
- **/
844e06
-
844e06
-#ifndef _dconf_dbus_1_h_
844e06
-#define _dconf_dbus_1_h_
844e06
-
844e06
-#include <dbus/dbus.h>
844e06
-#include <glib.h>
844e06
-
844e06
-G_BEGIN_DECLS
844e06
-
844e06
-typedef struct _DConfDBusClient DConfDBusClient;
844e06
-
844e06
-typedef void         (* DConfDBusNotify)                                (DConfDBusClient *dcdbc,
844e06
-                                                                         const gchar     *key,
844e06
-                                                                         gpointer         user_data);
844e06
-
844e06
-DConfDBusClient *       dconf_dbus_client_new                           (const gchar     *profile,
844e06
-                                                                         DBusConnection  *session,
844e06
-                                                                         DBusConnection  *system);
844e06
-void                    dconf_dbus_client_unref                         (DConfDBusClient *dcdbc);
844e06
-DConfDBusClient *       dconf_dbus_client_ref                           (DConfDBusClient *dcdbc);
844e06
-
844e06
-GVariant *              dconf_dbus_client_read                          (DConfDBusClient *dcdbc,
844e06
-                                                                         const gchar     *key);
844e06
-gboolean                dconf_dbus_client_write                         (DConfDBusClient *dcdbc,
844e06
-                                                                         const gchar     *key,
844e06
-                                                                         GVariant        *value);
844e06
-void                    dconf_dbus_client_subscribe                     (DConfDBusClient *dcdbc,
844e06
-                                                                         const gchar     *name,
844e06
-                                                                         DConfDBusNotify  notify,
844e06
-                                                                         gpointer         user_data);
844e06
-void                    dconf_dbus_client_unsubscribe                   (DConfDBusClient *dcdbc,
844e06
-                                                                         DConfDBusNotify  notify,
844e06
-                                                                         gpointer         user_data);
844e06
-gboolean                dconf_dbus_client_has_pending                   (DConfDBusClient *dcdbc);
844e06
-
844e06
-G_END_DECLS
844e06
-
844e06
-#endif /* _dconf_dbus_1_h_ */
844e06
diff --git a/dbus-1/dconf-dbus-1.pc.in b/dbus-1/dconf-dbus-1.pc.in
844e06
deleted file mode 100644
844e06
index c4c3380..0000000
844e06
--- a/dbus-1/dconf-dbus-1.pc.in
844e06
+++ /dev/null
844e06
@@ -1,11 +0,0 @@
844e06
-prefix=@prefix@
844e06
-exec_prefix=@exec_prefix@
844e06
-libdir=@libdir@
844e06
-includedir=@includedir@
844e06
-
844e06
-Name: dconf-dbus-1
844e06
-Description: dconf client library for libdbus-1
844e06
-Version: @VERSION@
844e06
-Requires: dbus-1, glib-2.0
844e06
-Libs: -L${libdir} -ldconf-dbus-1
844e06
-Cflags: -I${includedir}/dconf-dbus-1
844e06
diff --git a/dbus-1/dconf-libdbus-1.c b/dbus-1/dconf-libdbus-1.c
844e06
deleted file mode 100644
844e06
index 8ea187b..0000000
844e06
--- a/dbus-1/dconf-libdbus-1.c
844e06
+++ /dev/null
844e06
@@ -1,365 +0,0 @@
844e06
-/**
844e06
- * Copyright © 2010 Canonical Limited
844e06
- *
844e06
- * This program is free software: you can redistribute it and/or modify
844e06
- * it under the terms of the GNU General Public License as published by
844e06
- * the Free Software Foundation, either version 3 of the licence, or (at
844e06
- * your option) any later version.
844e06
- *
844e06
- * This program is distributed in the hope that it will be useful, but
844e06
- * WITHOUT ANY WARRANTY; without even the implied warranty of
844e06
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
844e06
- * General Public License for more details.
844e06
- *
844e06
- * You should have received a copy of the GNU General Public License
844e06
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
844e06
- *
844e06
- * Author: Ryan Lortie <desrt@desrt.ca>
844e06
- **/
844e06
-
844e06
-#include "config.h"
844e06
-
844e06
-#include "dconf-libdbus-1.h"
844e06
-
844e06
-#include "../engine/dconf-engine.h"
844e06
-
844e06
-#include <string.h>
844e06
-
844e06
-static DBusConnection *dconf_libdbus_1_buses[5];
844e06
-
844e06
-struct _DConfDBusClient
844e06
-{
844e06
-  DConfEngine *engine;
844e06
-  GSList *watches;
844e06
-  gint ref_count;
844e06
-};
844e06
-
844e06
-#define DCONF_LIBDBUS_1_ERROR (g_quark_from_static_string("DCONF_LIBDBUS_1_ERROR"))
844e06
-#define DCONF_LIBDBUS_1_ERROR_FAILED 0
844e06
-
844e06
-static DBusMessage *
844e06
-dconf_libdbus_1_new_method_call (const gchar *bus_name,
844e06
-                                 const gchar *object_path,
844e06
-                                 const gchar *interface_name,
844e06
-                                 const gchar *method_name,
844e06
-                                 GVariant    *parameters)
844e06
-{
844e06
-  DBusMessageIter dbus_iter;
844e06
-  DBusMessage *message;
844e06
-  GVariantIter iter;
844e06
-  GVariant *child;
844e06
-
844e06
-  g_variant_ref_sink (parameters);
844e06
-
844e06
-  message = dbus_message_new_method_call (bus_name, object_path, interface_name, method_name);
844e06
-  dbus_message_iter_init_append (message, &dbus_iter);
844e06
-  g_variant_iter_init (&iter, parameters);
844e06
-
844e06
-  while ((child = g_variant_iter_next_value (&iter)))
844e06
-    {
844e06
-      if (g_variant_is_of_type (child, G_VARIANT_TYPE_STRING))
844e06
-        {
844e06
-          const gchar *str;
844e06
-
844e06
-          str = g_variant_get_string (child, NULL);
844e06
-          dbus_message_iter_append_basic (&dbus_iter, DBUS_TYPE_STRING, &str);
844e06
-        }
844e06
-
844e06
-      else if (g_variant_is_of_type (child, G_VARIANT_TYPE_UINT32))
844e06
-        {
844e06
-          guint32 uint;
844e06
-
844e06
-          uint = g_variant_get_uint32 (child);
844e06
-          dbus_message_iter_append_basic (&dbus_iter, DBUS_TYPE_UINT32, &uint);
844e06
-        }
844e06
-
844e06
-      else
844e06
-        {
844e06
-          DBusMessageIter subiter;
844e06
-          const guint8 *bytes;
844e06
-          gsize n_elements;
844e06
-
844e06
-          g_assert (g_variant_is_of_type (child, G_VARIANT_TYPE_BYTESTRING));
844e06
-
844e06
-          bytes = g_variant_get_fixed_array (child, &n_elements, sizeof (guint8));
844e06
-          dbus_message_iter_open_container (&dbus_iter, DBUS_TYPE_ARRAY, "y", &subiter);
844e06
-          dbus_message_iter_append_fixed_array (&subiter, DBUS_TYPE_BYTE, &bytes, n_elements);
844e06
-          dbus_message_iter_close_container (&dbus_iter, &subiter);
844e06
-        }
844e06
-
844e06
-      g_variant_unref (child);
844e06
-    }
844e06
-
844e06
-  g_variant_unref (parameters);
844e06
-
844e06
-  return message;
844e06
-}
844e06
-
844e06
-static GVariant *
844e06
-dconf_libdbus_1_get_message_body (DBusMessage  *message,
844e06
-                                  GError      **error)
844e06
-{
844e06
-  GVariantBuilder builder;
844e06
-  const gchar *signature;
844e06
-  DBusMessageIter iter;
844e06
-
844e06
-  /* We support two types: strings and arrays of strings.
844e06
-   *
844e06
-   * It's very simple to detect if the message contains only these
844e06
-   * types: check that the signature contains only the letters "a" and
844e06
-   * "s" and that it does not contain "aa".
844e06
-   */
844e06
-  signature = dbus_message_get_signature (message);
844e06
-  if (signature[strspn(signature, "as")] != '\0' || strstr (signature, "aa"))
844e06
-    {
844e06
-      g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED,
844e06
-                   "unable to handle message type '(%s)'", signature);
844e06
-      return NULL;
844e06
-    }
844e06
-
844e06
-  g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
844e06
-  dbus_message_iter_init (message, &iter);
844e06
-  while (dbus_message_iter_get_arg_type (&iter))
844e06
-    {
844e06
-      const gchar *string;
844e06
-
844e06
-      if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_STRING)
844e06
-        {
844e06
-          dbus_message_iter_get_basic (&iter, &string);
844e06
-          g_variant_builder_add (&builder, "s", string);
844e06
-        }
844e06
-      else
844e06
-        {
844e06
-          DBusMessageIter sub;
844e06
-
844e06
-          g_assert (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY &&
844e06
-                    dbus_message_iter_get_element_type (&iter) == DBUS_TYPE_STRING);
844e06
-
844e06
-          g_variant_builder_open (&builder, G_VARIANT_TYPE_STRING_ARRAY);
844e06
-          dbus_message_iter_recurse (&iter, &sub);
844e06
-
844e06
-          while (dbus_message_iter_get_arg_type (&sub))
844e06
-            {
844e06
-              const gchar *string;
844e06
-              dbus_message_iter_get_basic (&sub, &string);
844e06
-              g_variant_builder_add (&builder, "s", string);
844e06
-              dbus_message_iter_next (&sub);
844e06
-            }
844e06
-
844e06
-          g_variant_builder_close (&builder);
844e06
-        }
844e06
-      dbus_message_iter_next (&iter);
844e06
-    }
844e06
-
844e06
-  return g_variant_ref_sink (g_variant_builder_end (&builder));
844e06
-}
844e06
-
844e06
-static GVariant *
844e06
-dconf_libdbus_1_interpret_result (DBusMessage         *result,
844e06
-                                  const GVariantType  *expected_type,
844e06
-                                  GError             **error)
844e06
-{
844e06
-  GVariant *reply;
844e06
-
844e06
-  if (dbus_message_get_type (result) == DBUS_MESSAGE_TYPE_ERROR)
844e06
-    {
844e06
-      const gchar *errstr = "(no message)";
844e06
-
844e06
-      dbus_message_get_args (result, NULL, DBUS_TYPE_STRING, &errstr, DBUS_TYPE_INVALID);
844e06
-      g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED,
844e06
-                   "%s: %s", dbus_message_get_error_name (result), errstr);
844e06
-      return NULL;
844e06
-    }
844e06
-
844e06
-  reply = dconf_libdbus_1_get_message_body (result, error);
844e06
-
844e06
-  if (reply && expected_type && !g_variant_is_of_type (reply, expected_type))
844e06
-    {
844e06
-      gchar *expected_string;
844e06
-
844e06
-      expected_string = g_variant_type_dup_string (expected_type);
844e06
-      g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED,
844e06
-                   "received reply '%s' is not of the expected type %s",
844e06
-                   g_variant_get_type_string (reply), expected_string);
844e06
-      g_free (expected_string);
844e06
-
844e06
-      g_variant_unref (reply);
844e06
-      reply = NULL;
844e06
-    }
844e06
-
844e06
-  return reply;
844e06
-}
844e06
-
844e06
-static void
844e06
-dconf_libdbus_1_method_call_done (DBusPendingCall *pending,
844e06
-                                  gpointer         user_data)
844e06
-{
844e06
-  DConfEngineCallHandle *handle = user_data;
844e06
-  const GVariantType *expected_type;
844e06
-  DBusMessage *message;
844e06
-  GError *error = NULL;
844e06
-  GVariant *reply;
844e06
-
844e06
-  if (pending == NULL)
844e06
-    return;
844e06
-
844e06
-  message = dbus_pending_call_steal_reply (pending);
844e06
-  dbus_pending_call_unref (pending);
844e06
-
844e06
-  expected_type = dconf_engine_call_handle_get_expected_type (handle);
844e06
-  reply = dconf_libdbus_1_interpret_result (message, expected_type, &error);
844e06
-  dbus_message_unref (message);
844e06
-
844e06
-  dconf_engine_call_handle_reply (handle, reply, error);
844e06
-
844e06
-  if (reply)
844e06
-    g_variant_unref (reply);
844e06
-  if (error)
844e06
-    g_error_free (error);
844e06
-}
844e06
-
844e06
-gboolean
844e06
-dconf_engine_dbus_call_async_func (GBusType                bus_type,
844e06
-                                   const gchar            *bus_name,
844e06
-                                   const gchar            *object_path,
844e06
-                                   const gchar            *interface_name,
844e06
-                                   const gchar            *method_name,
844e06
-                                   GVariant               *parameters,
844e06
-                                   DConfEngineCallHandle  *handle,
844e06
-                                   GError                **error)
844e06
-{
844e06
-  DBusConnection *connection;
844e06
-  DBusPendingCall *pending;
844e06
-  DBusMessage *message;
844e06
-
844e06
-  g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_libdbus_1_buses));
844e06
-  connection = dconf_libdbus_1_buses[bus_type];
844e06
-  g_assert (connection != NULL);
844e06
-
844e06
-  message = dconf_libdbus_1_new_method_call (bus_name, object_path, interface_name, method_name, parameters);
844e06
-  dbus_connection_send_with_reply (connection, message, &pending, -1);
844e06
-  dbus_pending_call_set_notify (pending, dconf_libdbus_1_method_call_done, handle, NULL);
844e06
-  dbus_message_unref (message);
844e06
-
844e06
-  return TRUE;
844e06
-}
844e06
-
844e06
-static void
844e06
-dconf_libdbus_1_convert_error (DBusError  *dbus_error,
844e06
-                               GError    **error)
844e06
-{
844e06
-  g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED,
844e06
-               "%s: %s", dbus_error->name, dbus_error->message);
844e06
-}
844e06
-
844e06
-GVariant *
844e06
-dconf_engine_dbus_call_sync_func (GBusType             bus_type,
844e06
-                                  const gchar         *bus_name,
844e06
-                                  const gchar         *object_path,
844e06
-                                  const gchar         *interface_name,
844e06
-                                  const gchar         *method_name,
844e06
-                                  GVariant            *parameters,
844e06
-                                  const GVariantType  *expected_type,
844e06
-                                  GError             **error)
844e06
-{
844e06
-  DBusConnection *connection;
844e06
-  DBusMessage *message;
844e06
-  DBusError dbus_error;
844e06
-  DBusMessage *result;
844e06
-  GVariant *reply;
844e06
-
844e06
-  g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_libdbus_1_buses));
844e06
-  connection = dconf_libdbus_1_buses[bus_type];
844e06
-  g_assert (connection != NULL);
844e06
-
844e06
-  dbus_error_init (&dbus_error);
844e06
-  message = dconf_libdbus_1_new_method_call (bus_name, object_path, interface_name, method_name, parameters);
844e06
-  result = dbus_connection_send_with_reply_and_block (connection, message, -1, &dbus_error);
844e06
-  dbus_message_unref (message);
844e06
-
844e06
-  if (result == NULL)
844e06
-    {
844e06
-      dconf_libdbus_1_convert_error (&dbus_error, error);
844e06
-      dbus_error_free (&dbus_error);
844e06
-      return NULL;
844e06
-    }
844e06
-
844e06
-  reply = dconf_libdbus_1_interpret_result (result, expected_type, error);
844e06
-  dbus_message_unref (result);
844e06
-
844e06
-  return reply;
844e06
-}
844e06
-
844e06
-static DBusHandlerResult
844e06
-dconf_libdbus_1_filter (DBusConnection *connection,
844e06
-                        DBusMessage    *message,
844e06
-                        gpointer        user_data)
844e06
-{
844e06
-  GBusType bus_type = GPOINTER_TO_INT (user_data);
844e06
-
844e06
-  if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_SIGNAL)
844e06
-    {
844e06
-      const gchar *interface;
844e06
-
844e06
-      interface = dbus_message_get_interface (message);
844e06
-
844e06
-      if (interface && g_str_equal (interface, "ca.desrt.dconf.Writer"))
844e06
-        {
844e06
-          GVariant *parameters;
844e06
-
844e06
-          parameters = dconf_libdbus_1_get_message_body (message, NULL);
844e06
-
844e06
-          if (parameters != NULL)
844e06
-            {
844e06
-              dconf_engine_handle_dbus_signal (bus_type,
844e06
-                                               dbus_message_get_sender (message),
844e06
-                                               dbus_message_get_path (message),
844e06
-                                               dbus_message_get_member (message),
844e06
-                                               parameters);
844e06
-              g_variant_unref (parameters);
844e06
-            }
844e06
-        }
844e06
-    }
844e06
-
844e06
-  return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
844e06
-}
844e06
-
844e06
-void
844e06
-dconf_libdbus_1_provide_bus (GBusType        bus_type,
844e06
-                             DBusConnection *connection)
844e06
-{
844e06
-  g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_libdbus_1_buses));
844e06
-
844e06
-  if (!dconf_libdbus_1_buses[bus_type])
844e06
-    {
844e06
-      dconf_libdbus_1_buses[bus_type] = dbus_connection_ref (connection);
844e06
-      dbus_connection_add_filter (connection, dconf_libdbus_1_filter, GINT_TO_POINTER (bus_type), NULL);
844e06
-    }
844e06
-}
844e06
-
844e06
-#ifndef PIC
844e06
-static gboolean
844e06
-dconf_libdbus_1_check_connection (gpointer user_data)
844e06
-{
844e06
-  DBusConnection *connection = user_data;
844e06
-
844e06
-  dbus_connection_read_write (connection, 0);
844e06
-  dbus_connection_dispatch (connection);
844e06
-
844e06
-  return G_SOURCE_CONTINUE;
844e06
-}
844e06
-
844e06
-void
844e06
-dconf_engine_dbus_init_for_testing (void)
844e06
-{
844e06
-  DBusConnection *session;
844e06
-  DBusConnection *system;
844e06
-
844e06
-  dconf_libdbus_1_provide_bus (G_BUS_TYPE_SESSION, session = dbus_bus_get (DBUS_BUS_SESSION, NULL));
844e06
-  dconf_libdbus_1_provide_bus (G_BUS_TYPE_SYSTEM, system = dbus_bus_get (DBUS_BUS_SYSTEM, NULL));
844e06
-
844e06
-  /* "mainloop integration" */
844e06
-  g_timeout_add (1, dconf_libdbus_1_check_connection, session);
844e06
-  g_timeout_add (1, dconf_libdbus_1_check_connection, system);
844e06
-}
844e06
-#endif
844e06
diff --git a/dbus-1/dconf-libdbus-1.h b/dbus-1/dconf-libdbus-1.h
844e06
deleted file mode 100644
844e06
index 201096a..0000000
844e06
--- a/dbus-1/dconf-libdbus-1.h
844e06
+++ /dev/null
844e06
@@ -1,11 +0,0 @@
844e06
-#ifndef __dconf_libdbus_1_h__
844e06
-#define __dconf_libdbus_1_h__
844e06
-
844e06
-#include <dbus/dbus.h>
844e06
-#include <gio/gio.h>
844e06
-
844e06
-G_GNUC_INTERNAL
844e06
-void                    dconf_libdbus_1_provide_bus                     (GBusType        bus_type,
844e06
-                                                                         DBusConnection *connection);
844e06
-
844e06
-#endif /* __dconf_libdbus_1_h__ */
844e06
diff --git a/tests/Makefile.am b/tests/Makefile.am
844e06
index adc8519..0a53ee6 100644
844e06
--- a/tests/Makefile.am
844e06
+++ b/tests/Makefile.am
844e06
@@ -64,14 +64,6 @@ gdbus_filter_LDADD = \
844e06
 	$(gio_LIBS)
844e06
 gdbus_filter_SOURCES = dbus.c
844e06
 
844e06
-TEST_PROGS += libdbus-1
844e06
-libdbus_1_CFLAGS = $(gio_CFLAGS) -DDBUS_BACKEND=\"/libdbus-1\"
844e06
-libdbus_1_LDADD = \
844e06
-	../dbus-1/libdconf-libdbus-1.a		\
844e06
-	$(glib_LIBS)				\
844e06
-	$(dbus_LIBS)
844e06
-libdbus_1_SOURCES = dbus.c
844e06
-
844e06
 TEST_PROGS += engine
844e06
 engine_CFLAGS = $(glib_CFLAGS) -DSRCDIR=\"$(abs_srcdir)\"
844e06
 engine_LDADD = \
844e06
-- 
844e06
2.9.3
844e06