From bc9122e071dc47175e8aa285100c4638b49f404d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 28 Sep 2013 18:32:56 +0200 Subject: [PATCH] gnome-online-accounts: add 2 patches from upstream. --- ...factory-is-initialized-before-using-.patch | 161 ++++++++++++++++++ ...-the-error-if-the-dialog-is-dismisse.patch | 30 ++++ srcpkgs/gnome-online-accounts/template | 2 +- 3 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/gnome-online-accounts/patches/0001-Ensure-that-the-factory-is-initialized-before-using-.patch create mode 100644 srcpkgs/gnome-online-accounts/patches/0002-oauth2-Propagate-the-error-if-the-dialog-is-dismisse.patch diff --git a/srcpkgs/gnome-online-accounts/patches/0001-Ensure-that-the-factory-is-initialized-before-using-.patch b/srcpkgs/gnome-online-accounts/patches/0001-Ensure-that-the-factory-is-initialized-before-using-.patch new file mode 100644 index 00000000000..5216ce99ed8 --- /dev/null +++ b/srcpkgs/gnome-online-accounts/patches/0001-Ensure-that-the-factory-is-initialized-before-using-.patch @@ -0,0 +1,161 @@ +From af7ee1e614c89585e688f2e10f34c3254242836d Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 26 Sep 2013 14:42:14 +0200 +Subject: [PATCH 1/2] Ensure that the factory is initialized before using the + account manager + +GoaTelepathyProvider is not the only one who uses the account manager. +GoaTpAccountLinker uses it too. We should initialize the client +factory before using the linker so that we really have all required +account and connection features. + +Fixes: https://bugzilla.gnome.org/708462 +--- + src/daemon/goatpaccountlinker.c | 3 +++ + src/goabackend/goatelepathyprovider.c | 30 ++---------------------------- + src/goabackend/goautils.c | 34 ++++++++++++++++++++++++++++++++++ + src/goabackend/goautils.h | 2 ++ + 4 files changed, 41 insertions(+), 28 deletions(-) + +diff --git a/src/daemon/goatpaccountlinker.c b/src/daemon/goatpaccountlinker.c +index ea1eda9..b7142ea 100644 +--- src/daemon/goatpaccountlinker.c ++++ src/daemon/goatpaccountlinker.c +@@ -34,6 +34,7 @@ + #include "goatpaccountlinker.h" + #include "goa/goa.h" + #include "goabackend/goalogging.h" ++#include "goabackend/goautils.h" + + #define GOA_TP_ACCOUNT_LINKER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOA_TYPE_TP_ACCOUNT_LINKER, \ +@@ -579,6 +580,8 @@ goa_tp_account_linker_class_init (GoaTpAccountLinkerClass *klass) + { + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ++ goa_utils_initialize_client_factory (); ++ + g_type_class_add_private (gobject_class, + sizeof (GoaTpAccountLinkerPrivate)); + +diff --git a/src/goabackend/goatelepathyprovider.c b/src/goabackend/goatelepathyprovider.c +index 434c4ff..7c800bd 100644 +--- src/goabackend/goatelepathyprovider.c ++++ src/goabackend/goatelepathyprovider.c +@@ -30,6 +30,7 @@ + #include "goaprovider.h" + #include "goaprovider-priv.h" + #include "goatelepathyprovider.h" ++#include "goautils.h" + + typedef struct _GoaTelepathyProviderPrivate GoaTelepathyProviderPrivate; + +@@ -1028,39 +1029,12 @@ goa_telepathy_provider_finalize (GObject *object) + } + + static void +-initialize_client_factory (void) +-{ +- TpSimpleClientFactory *factory; +- TpAccountManager *account_manager; +- GQuark account_features[] = { +- TP_ACCOUNT_FEATURE_STORAGE, +- TP_ACCOUNT_FEATURE_CONNECTION, +- 0}; +- GQuark connection_features[] = { +- TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS, +- TP_CONNECTION_FEATURE_CONTACT_INFO, +- 0}; +- +- /* We make sure that new instances of Telepathy objects will have all +- * the features we need. */ +- factory = tp_simple_client_factory_new (NULL); +- tp_simple_client_factory_add_account_features (factory, account_features); +- tp_simple_client_factory_add_connection_features (factory, connection_features); +- +- account_manager = tp_account_manager_new_with_factory (factory); +- tp_account_manager_set_default (account_manager); +- +- g_object_unref (account_manager); +- g_object_unref (factory); +-} +- +-static void + goa_telepathy_provider_class_init (GoaTelepathyProviderClass *klass) + { + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GoaProviderClass *provider_class = GOA_PROVIDER_CLASS (klass); + +- initialize_client_factory (); ++ goa_utils_initialize_client_factory (); + + object_class->constructed = goa_telepathy_provider_constructed; + object_class->finalize = goa_telepathy_provider_finalize; +diff --git a/src/goabackend/goautils.c b/src/goabackend/goautils.c +index 375df14..ff49cf7 100644 +--- src/goabackend/goautils.c ++++ src/goabackend/goautils.c +@@ -25,6 +25,7 @@ + + #include + #include ++#include + + #include "goaprovider.h" + #include "goalogging.h" +@@ -39,6 +40,39 @@ static const SecretSchema secret_password_schema = + } + }; + ++void ++goa_utils_initialize_client_factory (void) ++{ ++ static gsize once_init_value = 0; ++ ++ if (g_once_init_enter (&once_init_value)) ++ { ++ TpSimpleClientFactory *factory; ++ TpAccountManager *account_manager; ++ GQuark account_features[] = {TP_ACCOUNT_FEATURE_STORAGE, ++ TP_ACCOUNT_FEATURE_CONNECTION, ++ 0}; ++ GQuark connection_features[] = {TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS, ++ TP_CONNECTION_FEATURE_CONTACT_INFO, ++ 0}; ++ ++ /* We make sure that new instances of Telepathy objects will have all ++ * the features we need. ++ */ ++ factory = tp_simple_client_factory_new (NULL); ++ tp_simple_client_factory_add_account_features (factory, account_features); ++ tp_simple_client_factory_add_connection_features (factory, connection_features); ++ ++ account_manager = tp_account_manager_new_with_factory (factory); ++ tp_account_manager_set_default (account_manager); ++ ++ g_object_unref (account_manager); ++ g_object_unref (factory); ++ ++ g_once_init_leave (&once_init_value, 1); ++ } ++} ++ + gboolean + goa_utils_check_duplicate (GoaClient *client, + const gchar *identity, +diff --git a/src/goabackend/goautils.h b/src/goabackend/goautils.h +index 454e702..eb9af3b 100644 +--- src/goabackend/goautils.h ++++ src/goabackend/goautils.h +@@ -36,6 +36,8 @@ G_BEGIN_DECLS + + typedef gpointer (*GoaPeekInterfaceFunc) (GoaObject *); + ++void goa_utils_initialize_client_factory (void); ++ + gboolean goa_utils_check_duplicate (GoaClient *client, + const gchar *identity, + const gchar *presentation_identity, +-- +1.8.3.1 + diff --git a/srcpkgs/gnome-online-accounts/patches/0002-oauth2-Propagate-the-error-if-the-dialog-is-dismisse.patch b/srcpkgs/gnome-online-accounts/patches/0002-oauth2-Propagate-the-error-if-the-dialog-is-dismisse.patch new file mode 100644 index 00000000000..5bcfa4939a3 --- /dev/null +++ b/srcpkgs/gnome-online-accounts/patches/0002-oauth2-Propagate-the-error-if-the-dialog-is-dismisse.patch @@ -0,0 +1,30 @@ +From e3622e19ab8b4308be54c2d15bc3fbf304427d5f Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 27 Sep 2013 15:06:47 +0200 +Subject: [PATCH 2/2] oauth2: Propagate the error if the dialog is dismissed + during refresh + +Fallout from a6ce50a8ab89242d7d25611c3828033e854a263d + +Fixes: https://bugzilla.gnome.org/708832 +--- + src/goabackend/goaoauth2provider.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c +index 138bde3..b545535 100644 +--- src/goabackend/goaoauth2provider.c ++++ src/goabackend/goaoauth2provider.c +@@ -1405,6 +1405,9 @@ goa_oauth2_provider_refresh_account (GoaProvider *_provider, + ret = TRUE; + + out: ++ if (priv->error != NULL) ++ g_propagate_error (error, priv->error); ++ + gtk_widget_destroy (dialog); + return ret; + } +-- +1.8.3.1 + diff --git a/srcpkgs/gnome-online-accounts/template b/srcpkgs/gnome-online-accounts/template index 4bf2ef2ea8a..e8b882921b8 100644 --- a/srcpkgs/gnome-online-accounts/template +++ b/srcpkgs/gnome-online-accounts/template @@ -1,7 +1,7 @@ # Template file for 'gnome-online-accounts' pkgname=gnome-online-accounts version=3.10.0 -revision=5 +revision=6 build_style=gnu-configure configure_args="--enable-google --enable-kerberos --enable-flickr --enable-facebook --disable-static --enable-exchange --enable-imap-smtp