aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-17 21:35:07 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-29 18:54:37 +0800
commitfc4059e17da2a94a3864f396b5de12d93865090d (patch)
treeb7e51c0ece0074708d6762786c88730c8cf20e6f /src
parent3a6aca03ec70cb11d23cfd68e72a51a4a49220a2 (diff)
downloadgsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.gz
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.bz2
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.lz
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.xz
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.tar.zst
gsoc2013-empathy-fc4059e17da2a94a3864f396b5de12d93865090d.zip
Add empathy_service_name_to_display_name()
Also makes empathy_protocol_name_to_display_name() fallbacks to the protocol name so caller doesn't have to.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-account-assistant.c14
-rw-r--r--src/empathy-accounts-dialog.c16
2 files changed, 11 insertions, 19 deletions
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index 2a350e982..046e2377e 100644
--- a/src/empathy-account-assistant.c
+++ b/src/empathy-account-assistant.c
@@ -389,8 +389,8 @@ account_assistant_protocol_changed_cb (GtkComboBox *chooser,
GtkWidget *account_widget;
EmpathyAccountWidget *widget_object = NULL;
gboolean is_gtalk = FALSE, is_facebook = FALSE;
- const gchar *name;
gchar *service;
+ const gchar *display_name;
priv = GET_PRIV (self);
@@ -405,21 +405,19 @@ account_assistant_protocol_changed_cb (GtkComboBox *chooser,
if (!tp_strdiff (service, "google-talk"))
{
is_gtalk = TRUE;
- name = "gtalk";
}
else if (!tp_strdiff (service, "facebook"))
{
is_facebook = TRUE;
- name ="facebook";
}
+
+ if (service != NULL)
+ display_name = empathy_service_name_to_display_name (service);
else
- {
- name = proto->name;
- }
+ display_name = empathy_protocol_name_to_display_name (proto->name);
/* To translator: %s is the protocol name */
- str = g_strdup_printf (_("New %s account"),
- empathy_protocol_name_to_display_name (name));
+ str = g_strdup_printf (_("New %s account"), display_name);
settings = empathy_account_settings_new (cm->name, proto->name, str);
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index a8339a58b..fd6821368 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -585,7 +585,7 @@ accounts_dialog_setup_ui_to_add_account (EmpathyAccountsDialog *dialog)
EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
EmpathyAccountSettings *settings;
gchar *str;
- const gchar *name, *display_name;
+ const gchar *display_name;
TpConnectionManager *cm;
TpConnectionManagerProtocol *proto;
gboolean is_gtalk = FALSE, is_facebook = FALSE;
@@ -599,22 +599,16 @@ accounts_dialog_setup_ui_to_add_account (EmpathyAccountsDialog *dialog)
if (!tp_strdiff (service, "google-talk"))
{
is_gtalk = TRUE;
- name = "gtalk";
}
else if (!tp_strdiff (service, "facebook"))
{
is_facebook = TRUE;
- name ="facebook";
- }
- else
- {
- name = proto->name;
}
- /* TODO: pass the service name to empathy_protocol_name_to_display_name */
- display_name = empathy_protocol_name_to_display_name (name);
- if (display_name == NULL)
- display_name = proto->name;
+ if (service != NULL)
+ display_name = empathy_service_name_to_display_name (service);
+ else
+ display_name = empathy_protocol_name_to_display_name (proto->name);
/* Create account */
/* To translator: %s is the name of the protocol, such as "Google Talk" or