diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-16 19:14:16 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-17 00:43:30 +0800 |
commit | fe9e5a3cac6397054f984a10916378792ce583ca (patch) | |
tree | 3d5903415441159be1c0b75d72bc2446e19a2fc7 | |
parent | fea6df61fd35261aeebe2a94128d472e284a7280 (diff) | |
download | gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.gz gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.bz2 gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.lz gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.xz gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.tar.zst gsoc2013-empathy-fe9e5a3cac6397054f984a10916378792ce583ca.zip |
Move should_create_salut_account to local-xmpp-assistant-widget
https://bugzilla.gnome.org/show_bug.cgi?id=652669
-rw-r--r-- | libempathy-gtk/empathy-local-xmpp-assistant-widget.c | 25 | ||||
-rw-r--r-- | libempathy-gtk/empathy-local-xmpp-assistant-widget.h | 5 | ||||
-rw-r--r-- | src/empathy-account-assistant.c | 3 | ||||
-rw-r--r-- | src/empathy-auto-salut-account-helper.c | 26 | ||||
-rw-r--r-- | src/empathy-auto-salut-account-helper.h | 2 |
5 files changed, 32 insertions, 29 deletions
diff --git a/libempathy-gtk/empathy-local-xmpp-assistant-widget.c b/libempathy-gtk/empathy-local-xmpp-assistant-widget.c index 5cf8ce976..5d00fd229 100644 --- a/libempathy-gtk/empathy-local-xmpp-assistant-widget.c +++ b/libempathy-gtk/empathy-local-xmpp-assistant-widget.c @@ -280,3 +280,28 @@ empathy_local_xmpp_assistant_widget_create_account ( empathy_account_settings_apply_async (self->priv->settings, apply_account_cb, NULL); } + +gboolean +empathy_local_xmpp_assistant_widget_should_create_account ( + TpAccountManager *manager) +{ + gboolean salut_created = FALSE; + GList *accounts, *l; + + accounts = tp_account_manager_get_valid_accounts (manager); + + for (l = accounts; l != NULL; l = g_list_next (l)) + { + TpAccount *account = TP_ACCOUNT (l->data); + + if (!tp_strdiff (tp_account_get_protocol (account), "local-xmpp")) + { + salut_created = TRUE; + break; + } + } + + g_list_free (accounts); + + return !salut_created; +} diff --git a/libempathy-gtk/empathy-local-xmpp-assistant-widget.h b/libempathy-gtk/empathy-local-xmpp-assistant-widget.h index edb9b6a40..996671fdc 100644 --- a/libempathy-gtk/empathy-local-xmpp-assistant-widget.h +++ b/libempathy-gtk/empathy-local-xmpp-assistant-widget.h @@ -23,6 +23,8 @@ #include <gtk/gtk.h> +#include <telepathy-glib/telepathy-glib.h> + G_BEGIN_DECLS #define EMPATHY_TYPE_LOCAL_XMPP_ASSISTANT_WIDGET (empathy_local_xmpp_assistant_widget_get_type ()) @@ -53,6 +55,9 @@ GtkWidget * empathy_local_xmpp_assistant_widget_new (void); void empathy_local_xmpp_assistant_widget_create_account ( EmpathyLocalXmppAssistantWidget *self); +gboolean empathy_local_xmpp_assistant_widget_should_create_account ( + TpAccountManager *manager); + G_END_DECLS #endif /* __EMPATHY_LOCAL_XMPP_ASSISTANT_WIDGET_H__ */ diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c index e4ee048b5..00add5ed1 100644 --- a/src/empathy-account-assistant.c +++ b/src/empathy-account-assistant.c @@ -35,6 +35,7 @@ #include <libempathy-gtk/empathy-account-widget.h> #include <libempathy-gtk/empathy-protocol-chooser.h> +#include <libempathy-gtk/empathy-local-xmpp-assistant-widget.h> #include <libempathy-gtk/empathy-ui-utils.h> #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT @@ -1174,7 +1175,7 @@ account_mgr_prepare_cb (GObject *source_object, return; } - if (!should_create_salut_account (manager)) + if (!empathy_local_xmpp_assistant_widget_should_create_account (manager)) { DEBUG ("No need to create a Salut account"); priv->display_salut_page = FALSE; diff --git a/src/empathy-auto-salut-account-helper.c b/src/empathy-auto-salut-account-helper.c index 409b6936c..d22fe51d4 100644 --- a/src/empathy-auto-salut-account-helper.c +++ b/src/empathy-auto-salut-account-helper.c @@ -38,32 +38,6 @@ #include "empathy-auto-salut-account-helper.h" -/* Salut account creation. The TpAccountManager first argument - * must already be prepared when calling this function. */ -gboolean -should_create_salut_account (TpAccountManager *manager) -{ - gboolean salut_created = FALSE; - GList *accounts, *l; - - accounts = tp_account_manager_get_valid_accounts (manager); - - for (l = accounts; l != NULL; l = g_list_next (l)) - { - TpAccount *account = TP_ACCOUNT (l->data); - - if (!tp_strdiff (tp_account_get_protocol (account), "local-xmpp")) - { - salut_created = TRUE; - break; - } - } - - g_list_free (accounts); - - return !salut_created; -} - EmpathyAccountSettings * create_salut_account_settings (void) { diff --git a/src/empathy-auto-salut-account-helper.h b/src/empathy-auto-salut-account-helper.h index f0409d01d..ad186c840 100644 --- a/src/empathy-auto-salut-account-helper.h +++ b/src/empathy-auto-salut-account-helper.h @@ -29,8 +29,6 @@ #include <libempathy/empathy-connection-managers.h> #include <libempathy/empathy-account-settings.h> -gboolean should_create_salut_account (TpAccountManager *manager); - EmpathyAccountSettings * create_salut_account_settings (void); #endif |