[gnome-online-accounts] kerberos: Register the GOA_IDENTITY_MANAGER_ERROR domain with D-Bus



commit 8525de70beed3c6f680a37a076fdfade475cd7eb
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue May 30 20:29:44 2017 +0200

    kerberos: Register the GOA_IDENTITY_MANAGER_ERROR domain with D-Bus
    
    This will let us detect such errors thrown by goa-identity-service.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686131

 src/goabackend/Makefile.am           |    1 +
 src/goabackend/goakerberosprovider.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/Makefile.am b/src/goabackend/Makefile.am
index 563a4dc..7062d77 100644
--- a/src/goabackend/Makefile.am
+++ b/src/goabackend/Makefile.am
@@ -99,6 +99,7 @@ libgoa_backend_1_0_la_SOURCES =                                               \
        nautilus-floating-bar.h         nautilus-floating-bar.c         \
        $(top_builddir)/src/goaidentity/org.gnome.Identity.c            \
        $(top_builddir)/src/goaidentity/org.freedesktop.realmd.c        \
+       $(top_srcdir)/src/goaidentity/goaidentitymanagererror.c         \
        $(NULL)
 
 if BUILD_KERBEROS
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index dfd91d6..d26b15b 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -24,6 +24,7 @@
 #include "goakerberosprovider.h"
 #include "goautils.h"
 #include "goaidentity.h"
+#include "goaidentitymanagererror.h"
 
 #include <gcr/gcr.h>
 
@@ -1760,6 +1761,7 @@ goa_kerberos_provider_init (GoaKerberosProvider *provider)
 static void
 goa_kerberos_provider_class_init (GoaKerberosProviderClass *kerberos_class)
 {
+  static volatile GQuark goa_identity_manager_error_domain = 0;
   GoaProviderClass *provider_class;
 
   provider_class = GOA_PROVIDER_CLASS (kerberos_class);
@@ -1774,4 +1776,12 @@ goa_kerberos_provider_class_init (GoaKerberosProviderClass *kerberos_class)
   provider_class->ensure_credentials_sync    = ensure_credentials_sync;
   provider_class->remove_account             = remove_account;
   provider_class->remove_account_finish      = remove_account_finish;
+
+  /* this will force associating errors in the
+   * GOA_IDENTITY_MANAGER_ERROR error domain with
+   * org.gnome.Identity.Manager.Error.* errors via
+   * g_dbus_error_register_error_domain().
+   */
+  goa_identity_manager_error_domain = GOA_IDENTITY_MANAGER_ERROR;
+  goa_identity_manager_error_domain; /* shut up -Wunused-but-set-variable */
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]