[gnome-online-accounts/wip/rishi/account-remove: 2/6] provider: Add a new vfunc for backend-specific initialization



commit 7695d9423092f1f98c847a89467ce4945dc7e4fa
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu May 26 19:08:41 2016 +0200

    provider: Add a new vfunc for backend-specific initialization
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766733

 src/goabackend/goaprovider-priv.h |    4 ++++
 src/goabackend/goaprovider.c      |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goaprovider-priv.h b/src/goabackend/goaprovider-priv.h
index ae06d95..d868bc9 100644
--- a/src/goabackend/goaprovider-priv.h
+++ b/src/goabackend/goaprovider-priv.h
@@ -52,6 +52,7 @@ struct _GoaProvider
  * @ensure_credentials_sync: Virtual function for goa_provider_ensure_credentials_sync().
  * @show_account: Virtual function for goa_provider_show_account().
  * @get_credentials_generation: Virtual function for goa_provider_get_credentials_generation().
+ * @initialize: Virtual function for goa_provider_initialize().
  *
  * Class structure for #GoaProvider.
  */
@@ -92,6 +93,7 @@ struct _GoaProviderClass
   guint                   (*get_credentials_generation)   (GoaProvider            *self);
   GIcon                  *(*get_provider_icon)            (GoaProvider            *self,
                                                            GoaObject              *object);
+  void                    (*initialize)                   (GoaProvider            *self);
   void                    (*remove_account)               (GoaProvider            *self,
                                                            GoaObject              *object,
                                                            GCancellable           *cancellable,
@@ -126,6 +128,8 @@ void        goa_provider_ensure_builtins_loaded                (void);
 
 void        goa_provider_ensure_extension_points_registered    (void);
 
+void        goa_provider_initialize                            (GoaProvider             *self);
+
 void        goa_provider_remove_account                        (GoaProvider             *self,
                                                                 GoaObject               *object,
                                                                 GCancellable            *cancellable,
diff --git a/src/goabackend/goaprovider.c b/src/goabackend/goaprovider.c
index 336bbcb..4721bad 100644
--- a/src/goabackend/goaprovider.c
+++ b/src/goabackend/goaprovider.c
@@ -82,6 +82,8 @@ static guint goa_provider_get_credentials_generation_real (GoaProvider *self);
 static GIcon *goa_provider_get_provider_icon_real (GoaProvider *self,
                                                    GoaObject   *object);
 
+static void goa_provider_initialize_real (GoaProvider *self);
+
 static void goa_provider_remove_account_real (GoaProvider          *self,
                                               GoaObject            *object,
                                               GCancellable         *cancellable,
@@ -246,6 +248,7 @@ goa_provider_class_init (GoaProviderClass *klass)
   klass->ensure_credentials_sync = goa_provider_ensure_credentials_sync_real;
   klass->get_credentials_generation = goa_provider_get_credentials_generation_real;
   klass->get_provider_icon = goa_provider_get_provider_icon_real;
+  klass->initialize = goa_provider_initialize_real;
   klass->remove_account = goa_provider_remove_account_real;
   klass->remove_account_finish = goa_provider_remove_account_finish_real;
   klass->show_account = goa_provider_show_account_real;
@@ -415,6 +418,21 @@ goa_provider_get_provider_features (GoaProvider *self)
 
 /* ---------------------------------------------------------------------------------------------------- */
 
+void
+goa_provider_initialize (GoaProvider *self)
+{
+  g_return_if_fail (GOA_IS_PROVIDER (self));
+
+  GOA_PROVIDER_GET_CLASS (self)->initialize (self);
+}
+
+static void
+goa_provider_initialize_real (GoaProvider *self)
+{
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
 /**
  * goa_provider_add_account:
  * @self: A #GoaProvider.


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