[Xfce4-commits] [xfce/xfconf] 12/31: Register xfconf-errors in g_dbus.

noreply at xfce.org noreply at xfce.org
Thu Jun 1 13:33:05 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 02c11f80266fb87946a0d16295c13a5832624e09
Author: Ali Abdallah <aliovx at gmail.com>
Date:   Sun Apr 24 16:36:31 2016 +0200

    Register xfconf-errors in g_dbus.
---
 common/xfconf-errors.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/common/xfconf-errors.c b/common/xfconf-errors.c
index 38d1201..a565018 100644
--- a/common/xfconf-errors.c
+++ b/common/xfconf-errors.c
@@ -22,10 +22,24 @@
 #include <config.h>
 #endif
 
+#include <gio/gio.h>
+
 #include "xfconf/xfconf-errors.h"
 #include "xfconf-alias.h"
 
-static GQuark xfconf_error_quark = 0;
+static const GDBusErrorEntry xfconf_daemon_dbus_error_entries[] = 
+{
+    { XFCONF_ERROR_UNKNOWN, "org.xfce.Xfconf.Error.Unknown" },
+    { XFCONF_ERROR_CHANNEL_NOT_FOUND, "org.xfce.Xfconf.Error.ChannelNotFound" },
+    { XFCONF_ERROR_PROPERTY_NOT_FOUND, "org.xfce.Xfconf.Error.PropertyNotFound" },
+    { XFCONF_ERROR_READ_FAILURE, "org.xfce.Xfconf.Error.ReadFailure" },
+    { XFCONF_ERROR_WRITE_FAILURE, "org.xfce.Xfconf.Error.WriteFailure" },
+    { XFCONF_ERROR_PERMISSION_DENIED, "org.xfce.Xfconf.Error.PermissionDenied" },
+    { XFCONF_ERROR_INTERNAL_ERROR, "org.xfce.Xfconf.Error.InternalError" },
+    { XFCONF_ERROR_NO_BACKEND, "org.xfce.Xfconf.Error.NoBackend" },
+    { XFCONF_ERROR_INVALID_PROPERTY, "org.xfce.Xfconf.Error.InvalidProperty" },
+    { XFCONF_ERROR_INVALID_CHANNEL, "org.xfce.Xfconf.Error.InvalidChannel" },
+};
 
 /**
  * XFCONF_ERROR:
@@ -34,6 +48,7 @@ static GQuark xfconf_error_quark = 0;
  **/
 
 
+
 /**
  * XFCONF_TYPE_ERROR:
  *
@@ -51,10 +66,14 @@ static GQuark xfconf_error_quark = 0;
 GQuark
 xfconf_get_error_quark(void)
 {
-    if(!xfconf_error_quark)
-        xfconf_error_quark = g_quark_from_static_string("xfconf-error-quark");
+    static volatile gsize quark_volatile = 0;
+    
+    g_dbus_error_register_error_domain ("xfconf_daemon_error",
+                                        &quark_volatile,
+                                        xfconf_daemon_dbus_error_entries,
+                                        G_N_ELEMENTS (xfconf_daemon_dbus_error_entries));
     
-    return xfconf_error_quark;
+    return quark_volatile;
 }
 
 /* unfortunately glib-mkenums can't generate types that are compatible with

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


More information about the Xfce4-commits mailing list