From 720d7be4b5e3ce48c9f74b145b6a5d7414fa4b7e Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 22 Aug 2013 22:43:41 +0200 Subject: [PATCH] Backport a patch for gnome-online-accounts 3.9.90 API changes --- ...-page-Port-to-new-async-provider-API.patch | 124 ++++++++++++++++++ gnome-initial-setup.spec | 4 + 2 files changed, 128 insertions(+) create mode 100644 0001-gis-goa-page-Port-to-new-async-provider-API.patch diff --git a/0001-gis-goa-page-Port-to-new-async-provider-API.patch b/0001-gis-goa-page-Port-to-new-async-provider-API.patch new file mode 100644 index 0000000..e40458e --- /dev/null +++ b/0001-gis-goa-page-Port-to-new-async-provider-API.patch @@ -0,0 +1,124 @@ +From 74ce9a6005523558c6014e12efe3b03e91aaa187 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Thu, 22 Aug 2013 15:48:53 -0400 +Subject: [PATCH] gis-goa-page: Port to new async provider API + +The API changed with https://git.gnome.org/browse/gnome-online-accounts/commit/?id=1a8bfdf90fd24e9bbaeeae15ff9f16e847a6b48e + +Update this page to be async. Ideally we'd have a loading API, but +eh. + +https://bugzilla.gnome.org/show_bug.cgi?id=706608 +--- + gnome-initial-setup/pages/goa/gis-goa-page.c | 60 ++++++++++++++++++---------- + 1 file changed, 40 insertions(+), 20 deletions(-) + +diff --git a/gnome-initial-setup/pages/goa/gis-goa-page.c b/gnome-initial-setup/pages/goa/gis-goa-page.c +index fa83734..df93195 100644 +--- a/gnome-initial-setup/pages/goa/gis-goa-page.c ++++ b/gnome-initial-setup/pages/goa/gis-goa-page.c +@@ -47,6 +47,7 @@ G_DEFINE_TYPE (GisGoaPage, gis_goa_page, GIS_TYPE_PAGE); + + struct _GisGoaPagePrivate { + GoaClient *goa_client; ++ GtkWidget *dialog; + gboolean accounts_exist; + }; + +@@ -54,6 +55,39 @@ struct _GisGoaPagePrivate { + #define WID(name) OBJ(GtkWidget*,name) + + static void ++on_have_providers (GObject *source, ++ GAsyncResult *res, ++ gpointer user_data) ++{ ++ GList *providers; ++ GList *l; ++ GError *error = NULL; ++ GisGoaPage *page = GIS_GOA_PAGE (user_data); ++ GisGoaPagePrivate *priv = page->priv; ++ ++ if (!goa_provider_get_all_finish (&providers, res, &error)) ++ goto out; ++ ++ for (l = providers; l != NULL; l = l->next) ++ { ++ GoaProvider *provider; ++ ++ provider = GOA_PROVIDER (l->data); ++ goa_panel_add_account_dialog_add_provider (GOA_PANEL_ADD_ACCOUNT_DIALOG (priv->dialog), provider); ++ } ++ ++ g_list_foreach (providers, (GFunc) g_object_unref, NULL); ++ g_list_free (providers); ++ ++ out: ++ if (error) ++ { ++ g_printerr ("Failed to list providers: %s\n", error->message); ++ g_error_free (error); ++ } ++} ++ ++static void + show_online_account_dialog (GtkButton *button, + gpointer user_data) + { +@@ -62,36 +96,24 @@ show_online_account_dialog (GtkButton *button, + GtkWindow *parent; + GtkWidget *dialog; + gint response; +- GList *providers; +- GList *l; + GoaObject *object; + GError *error; + +- providers = NULL; +- + parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (page))); + +- dialog = goa_panel_add_account_dialog_new (priv->goa_client); +- gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); +- +- providers = goa_provider_get_all (); +- for (l = providers; l != NULL; l = l->next) +- { +- GoaProvider *provider; ++ priv->dialog = goa_panel_add_account_dialog_new (priv->goa_client); ++ gtk_window_set_transient_for (GTK_WINDOW (priv->dialog), parent); + +- provider = GOA_PROVIDER (l->data); +- goa_panel_add_account_dialog_add_provider (GOA_PANEL_ADD_ACCOUNT_DIALOG (dialog), provider); +- } ++ goa_provider_get_all (on_have_providers, page); + +- gtk_widget_show_all (dialog); +- response = gtk_dialog_run (GTK_DIALOG (dialog)); ++ gtk_widget_show_all (priv->dialog); ++ response = gtk_dialog_run (GTK_DIALOG (priv->dialog)); + if (response != GTK_RESPONSE_OK) + { + gtk_widget_destroy (dialog); + goto out; + } + +- error = NULL; + object = goa_panel_add_account_dialog_get_account (GOA_PANEL_ADD_ACCOUNT_DIALOG (dialog), &error); + + if (object == NULL) +@@ -113,10 +135,8 @@ show_online_account_dialog (GtkButton *button, + } + g_error_free (error); + } +- + out: +- g_list_foreach (providers, (GFunc) g_object_unref, NULL); +- g_list_free (providers); ++ return; + } + + static void +-- +1.8.3.1 + diff --git a/gnome-initial-setup.spec b/gnome-initial-setup.spec index 13648c4..df9cfb6 100644 --- a/gnome-initial-setup.spec +++ b/gnome-initial-setup.spec @@ -11,6 +11,9 @@ Source0: http://download.gnome.org/sources/%{name}/0.12/%{name}-%{version # https://bugzilla.gnome.org/show_bug.cgi?id=687957 Patch0: yelp-fixes.patch +# Backported from upstream for gnome-online-accounts 3.9.90 compatibility +Patch1: 0001-gis-goa-page-Port-to-new-async-provider-API.patch + %global nm_version 0.9 %global glib_required_version 2.29.4 %global gtk_required_version 3.1.2 @@ -66,6 +69,7 @@ you through configuring it. It is integrated with gdm. %prep %setup -q %patch0 -p1 -b .yelp-fixes +%patch1 -p1 -b .goa autoreconf -i -f