[empathy] Add support for 'as' in account settings



commit 0d31be0718c4624eaa17778f60f953f261f7487d
Author: Nicolas Dufresne <nicolas dufresne collabora co uk>
Date:   Fri Sep 3 16:45:08 2010 -0400

    Add support for 'as' in account settings

 libempathy/empathy-account-settings.c |   26 ++++++++++++++++++++++++++
 libempathy/empathy-account-settings.h |    5 +++++
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index c470ce0..43bba44 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -682,6 +682,20 @@ empathy_account_settings_get_string (EmpathyAccountSettings *settings,
   return g_value_get_string (v);
 }
 
+const gchar * const *
+empathy_account_settings_get_strv (EmpathyAccountSettings *settings,
+    const gchar *param)
+{
+  const GValue *v;
+
+  v = empathy_account_settings_get (settings, param);
+
+  if (v == NULL || !G_VALUE_HOLDS (v, G_TYPE_STRV))
+    return NULL;
+
+  return g_value_get_boxed (v);
+}
+
 gint32
 empathy_account_settings_get_int32 (EmpathyAccountSettings *settings,
     const gchar *param)
@@ -857,6 +871,18 @@ empathy_account_settings_set_string (EmpathyAccountSettings *settings,
 }
 
 void
+empathy_account_settings_set_strv (EmpathyAccountSettings *settings,
+    const gchar *param,
+    gchar **value)
+{
+  EmpathyAccountSettingsPriv *priv = GET_PRIV (settings);
+
+  tp_asv_set_strv (priv->parameters, param, value);
+
+  account_settings_remove_from_unset (settings, param);
+}
+
+void
 empathy_account_settings_set_int32 (EmpathyAccountSettings *settings,
     const gchar *param,
     gint32 value)
diff --git a/libempathy/empathy-account-settings.h b/libempathy/empathy-account-settings.h
index 419476b..7b1a4d6 100644
--- a/libempathy/empathy-account-settings.h
+++ b/libempathy/empathy-account-settings.h
@@ -103,6 +103,9 @@ empathy_account_settings_get_default (EmpathyAccountSettings *settings,
 const gchar *empathy_account_settings_get_string (
     EmpathyAccountSettings *settings,
     const gchar *param);
+const gchar * const * empathy_account_settings_get_strv (
+    EmpathyAccountSettings *settings,
+    const gchar *param);
 
 gint32 empathy_account_settings_get_int32 (EmpathyAccountSettings *settings,
     const gchar *param);
@@ -117,6 +120,8 @@ gboolean empathy_account_settings_get_boolean (EmpathyAccountSettings *settings,
 
 void empathy_account_settings_set_string (EmpathyAccountSettings *settings,
     const gchar *param, const gchar *value);
+void empathy_account_settings_set_strv (EmpathyAccountSettings *settings,
+    const gchar *param, gchar **value);
 
 void empathy_account_settings_set_int32 (EmpathyAccountSettings *settings,
     const gchar *param, gint32 value);



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