From c689cd6a91cb2a31ce0d03f47e59ca4e3f368e9c Mon Sep 17 00:00:00 2001 From: Marco Barisione Date: Fri, 26 Jul 2013 10:44:30 +0100 Subject: [PATCH] uoa-utils: move from Empathy to tp-aw https://bugzilla.gnome.org/show_bug.cgi?id=699492 --- libempathy/Makefile.am | 2 -- libempathy/empathy-uoa-auth-handler.c | 2 +- tp-account-widgets/Makefile.am | 16 +++++++++++++++- tp-account-widgets/tpaw-keyring.c | 6 +++--- .../tpaw-uoa-utils.c | 10 +++++----- .../tpaw-uoa-utils.h | 14 +++++++------- 6 files changed, 31 insertions(+), 19 deletions(-) rename libempathy/empathy-uoa-utils.c => tp-account-widgets/tpaw-uoa-utils.c (84%) rename libempathy/empathy-uoa-utils.h => tp-account-widgets/tpaw-uoa-utils.h (75%) diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am index faf647a4..d80c3952 100644 --- a/libempathy/Makefile.am +++ b/libempathy/Makefile.am @@ -93,8 +93,6 @@ goa_sources = \ uoa_sources = \ empathy-uoa-auth-handler.c \ empathy-uoa-auth-handler.h \ - empathy-uoa-utils.c \ - empathy-uoa-utils.h \ $(NULL) pkglib_LTLIBRARIES = libempathy.la diff --git a/libempathy/empathy-uoa-auth-handler.c b/libempathy/empathy-uoa-auth-handler.c index eff3dd6d..d5a6577c 100644 --- a/libempathy/empathy-uoa-auth-handler.c +++ b/libempathy/empathy-uoa-auth-handler.c @@ -31,9 +31,9 @@ #include #include +#include #include "empathy-utils.h" -#include "empathy-uoa-utils.h" #include "empathy-sasl-mechanisms.h" #define DEBUG_FLAG EMPATHY_DEBUG_SASL diff --git a/tp-account-widgets/Makefile.am b/tp-account-widgets/Makefile.am index dbfffeeb..80089458 100644 --- a/tp-account-widgets/Makefile.am +++ b/tp-account-widgets/Makefile.am @@ -63,6 +63,19 @@ libtp_account_widgets_la_SOURCES = \ $(libtp_account_widgets_headers) \ $(NULL) +# these are sources that depend on Ubuntu Online Accounts +uoa_sources = \ + tpaw-uoa-utils.c \ + tpaw-uoa-utils.h \ + $(NULL) + +if HAVE_UOA +libtp_account_widgets_la_SOURCES += $(uoa_sources) +EXTRA_DIST = +else +EXTRA_DIST = $(uoa_sources) +endif + # do not distribute generated files nodist_libtp_account_widgets_la_SOURCES = \ $(BUILT_SOURCES) @@ -70,6 +83,7 @@ nodist_libtp_account_widgets_la_SOURCES = \ check_c_sources = \ $(libtp_account_widgets_sources) \ $(libtp_account_widgets_headers) \ + $(uoa_sources) \ $(NULL) include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style @@ -103,7 +117,7 @@ tpaw-account-widgets-resources.c: tpaw-account-widgets.gresource.xml $(account_w tpaw-account-widgets-resources.h: tpaw-account-widgets.gresource.xml $(account_widgets_resource_files) $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $< -EXTRA_DIST = \ +EXTRA_DIST += \ tpaw-account-widgets.gresource.xml \ $(account_widgets_dtd_files) \ $(account_widgets_ui_files) \ diff --git a/tp-account-widgets/tpaw-keyring.c b/tp-account-widgets/tpaw-keyring.c index 827f2ca6..94bbd93e 100644 --- a/tp-account-widgets/tpaw-keyring.c +++ b/tp-account-widgets/tpaw-keyring.c @@ -29,7 +29,7 @@ #include #include #include -#include "empathy-uoa-utils.h" +#include "tpaw-uoa-utils.h" #endif #include "empathy-utils.h" @@ -114,11 +114,11 @@ uoa_password_common (TpAccount *tp_account, goto error; } - manager = empathy_uoa_manager_dup (); + manager = tpaw_uoa_manager_dup (); account = ag_manager_get_account (manager, account_id); /* Assuming there is only one IM service */ - l = ag_account_list_services_by_type (account, EMPATHY_UOA_SERVICE_TYPE); + l = ag_account_list_services_by_type (account, TPAW_UOA_SERVICE_TYPE); if (l == NULL) { g_simple_async_result_set_error (result, diff --git a/libempathy/empathy-uoa-utils.c b/tp-account-widgets/tpaw-uoa-utils.c similarity index 84% rename from libempathy/empathy-uoa-utils.c rename to tp-account-widgets/tpaw-uoa-utils.c index 6032d36b..6eb43fe1 100644 --- a/libempathy/empathy-uoa-utils.c +++ b/tp-account-widgets/tpaw-uoa-utils.c @@ -1,5 +1,5 @@ /* - * empathy-uoa-utils.c - Source for UOA utilities + * tpaw-uoa-utils.c - Source for UOA utilities * Copyright (C) 2012 Collabora Ltd. * @author Xavier Claessens * @@ -19,7 +19,7 @@ */ #include "config.h" -#include "empathy-uoa-utils.h" +#include "tpaw-uoa-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT #include "empathy-debug.h" @@ -27,7 +27,7 @@ static AgManager *singleton = NULL; void -empathy_uoa_manager_set_default (AgManager *manager) +tpaw_uoa_manager_set_default (AgManager *manager) { if (singleton != NULL) return; @@ -37,12 +37,12 @@ empathy_uoa_manager_set_default (AgManager *manager) } AgManager * -empathy_uoa_manager_dup (void) +tpaw_uoa_manager_dup (void) { if (singleton != NULL) return g_object_ref (singleton); - singleton = ag_manager_new_for_service_type (EMPATHY_UOA_SERVICE_TYPE); + singleton = ag_manager_new_for_service_type (TPAW_UOA_SERVICE_TYPE); g_object_add_weak_pointer ((GObject *) singleton, (gpointer) &singleton); return singleton; diff --git a/libempathy/empathy-uoa-utils.h b/tp-account-widgets/tpaw-uoa-utils.h similarity index 75% rename from libempathy/empathy-uoa-utils.h rename to tp-account-widgets/tpaw-uoa-utils.h index 2cd7a41a..3529e1ae 100644 --- a/libempathy/empathy-uoa-utils.h +++ b/tp-account-widgets/tpaw-uoa-utils.h @@ -1,5 +1,5 @@ /* - * empathy-utils.h - Header for UOA utilities + * tpaw-utils.h - Header for UOA utilities * Copyright (C) 2012 Collabora Ltd. * @author Xavier Claessens * @@ -18,18 +18,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __EMPATHY_UOA_UTILS_H__ -#define __EMPATHY_UOA_UTILS_H__ +#ifndef __TPAW_UOA_UTILS_H__ +#define __TPAW_UOA_UTILS_H__ #include -#define EMPATHY_UOA_SERVICE_TYPE "IM" +#define TPAW_UOA_SERVICE_TYPE "IM" G_BEGIN_DECLS -void empathy_uoa_manager_set_default (AgManager *manager); -AgManager *empathy_uoa_manager_dup (void); +void tpaw_uoa_manager_set_default (AgManager *manager); +AgManager *tpaw_uoa_manager_dup (void); G_END_DECLS -#endif /* #ifndef __EMPATHY_UOA_UTILS_H__*/ +#endif /* #ifndef __TPAW_UOA_UTILS_H__*/ -- 2.39.2