[telepathy-mission-control/master] McdAccountManager: pass properties around internally

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Apr 30 07:18:44 PDT 2009


---
 src/mcd-account-manager-creation.c |    3 ++-
 src/mcd-account-manager-priv.h     |    2 +-
 src/mcd-account-manager.c          |   11 ++++++++++-
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/mcd-account-manager-creation.c b/src/mcd-account-manager-creation.c
index 55b0c33..9d65b27 100644
--- a/src/mcd-account-manager-creation.c
+++ b/src/mcd-account-manager-creation.c
@@ -121,7 +121,8 @@ account_manager_create_account (McSvcAccountManagerInterfaceCreation *self,
     cd->context = context;
     _mcd_account_manager_create_account (MCD_ACCOUNT_MANAGER (self),
                                          manager, protocol, display_name,
-                                         parameters, create_account_cb, cd,
+                                         parameters, properties,
+                                         create_account_cb, cd,
                                          (GDestroyNotify)mcd_creation_data_free);
 }
 
diff --git a/src/mcd-account-manager-priv.h b/src/mcd-account-manager-priv.h
index e4f6203..80465d8 100644
--- a/src/mcd-account-manager-priv.h
+++ b/src/mcd-account-manager-priv.h
@@ -42,7 +42,7 @@ typedef void (*McdGetAccountCb) (McdAccountManager *account_manager,
 G_GNUC_INTERNAL void _mcd_account_manager_create_account
     (McdAccountManager *account_manager,
      const gchar *manager, const gchar *protocol,
-     const gchar *display_name, GHashTable *params,
+     const gchar *display_name, GHashTable *params, GHashTable *properties,
      McdGetAccountCb callback, gpointer user_data, GDestroyNotify destroy);
 
 G_GNUC_INTERNAL
diff --git a/src/mcd-account-manager.c b/src/mcd-account-manager.c
index 6096a23..19cd065 100644
--- a/src/mcd-account-manager.c
+++ b/src/mcd-account-manager.c
@@ -99,6 +99,7 @@ typedef struct
 {
     McdAccountManager *account_manager;
     GHashTable *parameters;
+    GHashTable *properties;
     McdGetAccountCb callback;
     gpointer user_data;
     GDestroyNotify destroy;
@@ -312,6 +313,12 @@ static void
 mcd_create_account_data_free (McdCreateAccountData *cad)
 {
     g_hash_table_unref (cad->parameters);
+
+    if (cad->properties != NULL)
+    {
+        g_hash_table_unref (cad->properties);
+    }
+
     g_slice_free (McdCreateAccountData, cad);
 }
 
@@ -407,6 +414,7 @@ _mcd_account_manager_create_account (McdAccountManager *account_manager,
                                      const gchar *protocol,
                                      const gchar *display_name,
                                      GHashTable *params,
+                                     GHashTable *properties,
                                      McdGetAccountCb callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy)
@@ -449,6 +457,7 @@ _mcd_account_manager_create_account (McdAccountManager *account_manager,
         cad = g_slice_new (McdCreateAccountData);
         cad->account_manager = account_manager;
         cad->parameters = g_hash_table_ref (params);
+        cad->properties = (properties ? g_hash_table_ref (properties) : NULL);
         cad->callback = callback;
         cad->user_data = user_data;
         cad->destroy = destroy;
@@ -490,7 +499,7 @@ account_manager_create_account (McSvcAccountManager *self,
 {
     _mcd_account_manager_create_account (MCD_ACCOUNT_MANAGER (self),
                                          manager, protocol, display_name,
-                                         parameters,
+                                         parameters, NULL,
                                          create_account_cb, context, NULL);
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list