[empathy/mc5: 476/483] Let the cached parameters asv own the key strings



commit 0f736265600a180423b1640841923f560fba70c2
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Fri Aug 21 16:11:17 2009 +0100

    Let the cached parameters asv own the key strings

 libempathy/empathy-account-settings.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index cede5fd..5c4644d 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -85,7 +85,9 @@ empathy_account_settings_init (EmpathyAccountSettings *obj)
   priv->managers = empathy_connection_managers_dup_singleton ();
   priv->account_manager = empathy_account_manager_dup_singleton ();
 
-  priv->parameters = tp_asv_new (NULL, NULL);
+  priv->parameters = g_hash_table_new_full (g_str_hash, g_str_equal,
+     g_free, (GDestroyNotify) tp_g_value_slice_free);
+
   priv->unset_parameters = g_array_new (TRUE, FALSE, sizeof (gchar *));
 }
 
@@ -765,7 +767,7 @@ empathy_account_settings_set_string (EmpathyAccountSettings *settings,
 {
   EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
 
-  tp_asv_set_string (priv->parameters, param, value);
+  tp_asv_set_string (priv->parameters, g_strdup (param), value);
 }
 
 void
@@ -775,7 +777,7 @@ empathy_account_settings_set_int32 (EmpathyAccountSettings *settings,
 {
   EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
 
-  tp_asv_set_int32 (priv->parameters, param, value);
+  tp_asv_set_int32 (priv->parameters, g_strdup (param), value);
 }
 
 void
@@ -785,7 +787,7 @@ empathy_account_settings_set_int64 (EmpathyAccountSettings *settings,
 {
   EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
 
-  tp_asv_set_int64 (priv->parameters, param, value);
+  tp_asv_set_int64 (priv->parameters, g_strdup (param), value);
 }
 
 void
@@ -795,7 +797,7 @@ empathy_account_settings_set_uint32 (EmpathyAccountSettings *settings,
 {
   EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
 
-  tp_asv_set_uint32 (priv->parameters, param, value);
+  tp_asv_set_uint32 (priv->parameters, g_strdup (param), value);
 }
 
 void
@@ -805,7 +807,7 @@ empathy_account_settings_set_uint64 (EmpathyAccountSettings *settings,
 {
   EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
 
-  tp_asv_set_uint64 (priv->parameters, param, value);
+  tp_asv_set_uint64 (priv->parameters, g_strdup (param), value);
 }
 
 void
@@ -815,7 +817,7 @@ empathy_account_settings_set_boolean (EmpathyAccountSettings *settings,
 {
   EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
 
-  tp_asv_set_boolean (priv->parameters, param, value);
+  tp_asv_set_boolean (priv->parameters, g_strdup (param), value);
 }
 
 static void



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