aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-widget-irc.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-07 17:50:14 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-07 18:04:23 +0800
commit4da4893bd535d6e122f99300e2f5152d40723bbc (patch)
treeb3fbaef040501dba97675502208c4b10af1e3d01 /libempathy-gtk/empathy-account-widget-irc.c
parent9d8d7a2e4f9cd772fe69dae15c4c21728e974df3 (diff)
downloadgsoc2013-empathy-4da4893bd535d6e122f99300e2f5152d40723bbc.tar
gsoc2013-empathy-4da4893bd535d6e122f99300e2f5152d40723bbc.tar.gz
gsoc2013-empathy-4da4893bd535d6e122f99300e2f5152d40723bbc.tar.bz2
gsoc2013-empathy-4da4893bd535d6e122f99300e2f5152d40723bbc.tar.lz
gsoc2013-empathy-4da4893bd535d6e122f99300e2f5152d40723bbc.tar.xz
gsoc2013-empathy-4da4893bd535d6e122f99300e2f5152d40723bbc.tar.zst
gsoc2013-empathy-4da4893bd535d6e122f99300e2f5152d40723bbc.zip
account-settings: always use GVariant to store parameters
https://bugzilla.gnome.org/show_bug.cgi?id=677545
Diffstat (limited to 'libempathy-gtk/empathy-account-widget-irc.c')
-rw-r--r--libempathy-gtk/empathy-account-widget-irc.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/libempathy-gtk/empathy-account-widget-irc.c b/libempathy-gtk/empathy-account-widget-irc.c
index b4d5673a8..8e6719464 100644
--- a/libempathy-gtk/empathy-account-widget-irc.c
+++ b/libempathy-gtk/empathy-account-widget-irc.c
@@ -57,19 +57,19 @@ account_widget_irc_destroy_cb (GtkWidget *widget,
static void
account_widget_irc_setup (EmpathyAccountWidgetIrc *settings)
{
- const gchar *nick = NULL;
- const gchar *fullname = NULL;
+ gchar *nick = NULL;
+ gchar *fullname = NULL;
EmpathyAccountSettings *ac_settings;
g_object_get (settings->self, "settings", &ac_settings, NULL);
- nick = empathy_account_settings_get_string (ac_settings, "account");
- fullname = empathy_account_settings_get_string (ac_settings,
+ nick = empathy_account_settings_dup_string (ac_settings, "account");
+ fullname = empathy_account_settings_dup_string (ac_settings,
"fullname");
if (nick == NULL)
{
- nick = g_get_user_name ();
+ nick = g_strdup (g_get_user_name ());
empathy_account_settings_set (ac_settings,
"account", g_variant_new_string (nick));
@@ -77,14 +77,17 @@ account_widget_irc_setup (EmpathyAccountWidgetIrc *settings)
if (fullname == NULL)
{
- fullname = g_get_real_name ();
+ fullname = g_strdup (g_get_real_name ());
if (fullname == NULL)
- fullname = nick;
+ fullname = g_strdup (nick);
empathy_account_settings_set (ac_settings,
"fullname", g_variant_new_string (fullname));
}
+
+ g_free (nick);
+ g_free (fullname);
}
static void
@@ -146,7 +149,7 @@ empathy_account_widget_irc_build (EmpathyAccountWidget *self,
EmpathyAccountWidgetIrc *settings;
EmpathyAccountSettings *ac_settings;
GtkWidget *entry_password;
- const gchar *password;
+ gchar *password;
settings = g_slice_new0 (EmpathyAccountWidgetIrc);
settings->self = self;
@@ -190,7 +193,7 @@ empathy_account_widget_irc_build (EmpathyAccountWidget *self,
g_object_unref (ac_settings);
/* Automatically set password-prompt when needed */
- password = empathy_account_settings_get_string (ac_settings, "password");
+ password = empathy_account_settings_dup_string (ac_settings, "password");
if (set_password_prompt_if_needed (ac_settings, password))
{
@@ -198,6 +201,8 @@ empathy_account_widget_irc_build (EmpathyAccountWidget *self,
empathy_account_settings_apply_async (ac_settings, NULL, NULL);
}
+ g_free (password);
+
g_signal_connect (entry_password, "changed",
G_CALLBACK (entry_password_changed_cb), settings);