diff options
author | Arnaud Maillet <arnaud.maillet@collabora.co.uk> | 2009-07-28 21:07:53 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-08-22 21:23:02 +0800 |
commit | 1ca4a9ee58260df26a03bc6565867b7958333f4c (patch) | |
tree | b4e32dd9e63cdc607530d05cd5ee7d5c170ae106 | |
parent | b047c404615a4137ced83c40d214f1092fbc733b (diff) | |
download | gsoc2013-empathy-1ca4a9ee58260df26a03bc6565867b7958333f4c.tar gsoc2013-empathy-1ca4a9ee58260df26a03bc6565867b7958333f4c.tar.gz gsoc2013-empathy-1ca4a9ee58260df26a03bc6565867b7958333f4c.tar.bz2 gsoc2013-empathy-1ca4a9ee58260df26a03bc6565867b7958333f4c.tar.lz gsoc2013-empathy-1ca4a9ee58260df26a03bc6565867b7958333f4c.tar.xz gsoc2013-empathy-1ca4a9ee58260df26a03bc6565867b7958333f4c.tar.zst gsoc2013-empathy-1ca4a9ee58260df26a03bc6565867b7958333f4c.zip |
Remove the hardcode
-rw-r--r-- | src/empathy-accounts-dialog.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 391c42b6d..3532e97f4 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -134,34 +134,24 @@ accounts_dialog_update_name_label (EmpathyAccountsDialog *dialog, static GtkWidget * get_account_setup_widget (EmpathyAccountSettings *settings) { - const gchar *cm = empathy_account_settings_get_cm (settings); const gchar *proto = empathy_account_settings_get_protocol (settings); + EmpathyConnectionManagers *cm = + empathy_connection_managers_dup_singleton (); + GList *cms = empathy_connection_managers_get_cms (cm); + GList *l; - struct { - const gchar *cm; - const gchar *proto; - } dialogs[] = { - { "gabble", "jabber" }, - { "butterfly", "msn" }, - { "salut", "local-xmpp" }, - { "idle", "irc" }, - { "haze", "icq" }, - { "haze", "aim" }, - { "haze", "yahoo" }, - { "haze", "groupwise" }, - { "sofiasip", "sip" }, - { NULL, NULL } - }; - int i; - - for (i = 0; dialogs[i].cm != NULL; i++) + for (l = cms; l; l = l->next) { - if (!tp_strdiff (cm, dialogs[i].cm) - && !tp_strdiff (proto, dialogs[i].proto)) - return empathy_account_widget_new_for_protocol (dialogs[i].proto, - settings); + TpConnectionManager *tp_cm = l->data; + if (tp_connection_manager_has_protocol (tp_cm, proto)) + { + g_object_unref (cm); + return empathy_account_widget_new_for_protocol + (proto, settings); + } } + g_object_unref (cm); return empathy_account_widget_new_for_protocol ("generic", settings); } |