[Xfce4-commits] [xfce/xfconf] 15/31: Port the xfcond daemon to gdbus.

noreply at xfce.org noreply at xfce.org
Thu Jun 1 13:33:08 CEST 2017


This is an automated email from the git hooks/post-receive script.

a   l   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfconf.

commit 78dfc78477050e97ad25a5e3f3040f7b306eaa07
Author: Ali Abdallah <aliovx at gmail.com>
Date:   Sun Apr 24 21:34:13 2016 +0200

    Port the xfcond daemon to gdbus.
    
    To simplify things, XfconfDaemon is now a subclass of
    the exported XfconfExportedSkeleton.
---
 xfconfd/main.c           | 22 ++++++++++++++++++++++
 xfconfd/xfconf-backend.c |  2 --
 xfconfd/xfconf-backend.h |  1 +
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/xfconfd/main.c b/xfconfd/main.c
index 4488b24..ad02d9c 100644
--- a/xfconfd/main.c
+++ b/xfconfd/main.c
@@ -48,6 +48,7 @@
 #endif
 
 #include <libxfce4util/libxfce4util.h>
+#include <gio/gio.h>
 
 #include "xfconf-daemon.h"
 #include "xfconf-backend-factory.h"
@@ -114,6 +115,18 @@ signal_pipe_io(GIOChannel *source,
     return TRUE;
 }
 
+static void
+xfconf_dbus_name_lost (GDBusConnection *connection,
+                       const gchar     *name,
+                       gpointer         user_data) {
+    GMainLoop *main_loop;
+
+    g_critical (_("Name %s lost on the message dbus, exiting."), name);
+    main_loop = (GMainLoop*)user_data;
+    g_main_loop_quit(main_loop);
+}
+
+
 int
 main(int argc,
      char **argv)
@@ -216,6 +229,15 @@ main(int argc,
         return EXIT_FAILURE;
     }
     g_strfreev(backends);
+    
+    /* acquire name */
+    g_bus_own_name (G_BUS_TYPE_SESSION,
+                    "org.xfce.Xfconf",
+                    G_BUS_NAME_OWNER_FLAGS_NONE,
+                    NULL,
+                    NULL,
+                    xfconf_dbus_name_lost,
+                    mloop, NULL);
 
     if(do_daemon) {
         pid_t child_pid;
diff --git a/xfconfd/xfconf-backend.c b/xfconfd/xfconf-backend.c
index 3be446a..fce42ac 100644
--- a/xfconfd/xfconf-backend.c
+++ b/xfconfd/xfconf-backend.c
@@ -21,8 +21,6 @@
 #include <config.h>
 #endif
 
-#include <dbus/dbus-glib.h>
-
 #include "xfconf-backend.h"
 
 
diff --git a/xfconfd/xfconf-backend.h b/xfconfd/xfconf-backend.h
index c94bdc5..fed0485 100644
--- a/xfconfd/xfconf-backend.h
+++ b/xfconfd/xfconf-backend.h
@@ -29,6 +29,7 @@
 #endif
 
 #include <xfconf/xfconf-errors.h>
+#include "xfconf-daemon.h"
 
 #define XFCONF_TYPE_BACKEND                (xfconf_backend_get_type())
 #define XFCONF_BACKEND(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), XFCONF_TYPE_BACKEND, XfconfBackend))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list