diff options
author | Ali Abdallah <aliovx@gmail.com> | 2016-04-24 21:34:13 +0200 |
---|---|---|
committer | Ali Abdallah <aliovx@gmail.com> | 2016-04-24 21:34:13 +0200 |
commit | 78dfc78477050e97ad25a5e3f3040f7b306eaa07 (patch) | |
tree | 1057df32554b404c9eccdfbddb5a08601d1514cc /xfconfd | |
parent | c62a1273806a0c2113ff7d589175c8f977968fe9 (diff) | |
download | xfconf-78dfc78477050e97ad25a5e3f3040f7b306eaa07.tar.gz |
Port the xfcond daemon to gdbus.
To simplify things, XfconfDaemon is now a subclass of
the exported XfconfExportedSkeleton.
Diffstat (limited to 'xfconfd')
-rw-r--r-- | xfconfd/main.c | 22 | ||||
-rw-r--r-- | xfconfd/xfconf-backend.c | 2 | ||||
-rw-r--r-- | 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)) |