[gnome-online-accounts] provider: Put the providers in an order that we recommend
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] provider: Put the providers in an order that we recommend
- Date: Wed, 27 Jun 2012 10:27:56 +0000 (UTC)
commit 0802285967647672ea7e2c611279de3960617438
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Jun 27 12:23:04 2012 +0200
provider: Put the providers in an order that we recommend
The other way to do it would be to attach priorities while
implementing the extension point, but this is simpler and more
readable.
Fixes: https://bugzilla.gnome.org/678907
src/goabackend/goaprovider.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/goabackend/goaprovider.c b/src/goabackend/goaprovider.c
index 3538e80..fc92d7f 100644
--- a/src/goabackend/goaprovider.c
+++ b/src/goabackend/goaprovider.c
@@ -597,25 +597,28 @@ ensure_ep_and_builtins (void)
extension_point = g_io_extension_point_register (GOA_PROVIDER_EXTENSION_POINT_NAME);
g_io_extension_point_set_required_type (extension_point, GOA_TYPE_PROVIDER);
-#ifdef GOA_EXCHANGE_ENABLED
- type = GOA_TYPE_EXCHANGE_PROVIDER;
-#endif
+ /* The order is in which the providers' types are created is
+ * important because it affects the order in which they are
+ * returned by goa_provider_get_all.
+ */
#ifdef GOA_GOOGLE_ENABLED
type = GOA_TYPE_GOOGLE_PROVIDER;
#endif
-#ifdef GOA_YAHOO_ENABLED
- type = GOA_TYPE_YAHOO_PROVIDER;
-#endif
-#ifdef GOA_TWITTER_ENABLED
- type = GOA_TYPE_TWITTER_PROVIDER;
-#endif
#ifdef GOA_FACEBOOK_ENABLED
type = GOA_TYPE_FACEBOOK_PROVIDER;
#endif
-
#ifdef GOA_WINDOWS_LIVE_ENABLED
type = GOA_TYPE_WINDOWS_LIVE_PROVIDER;
#endif
+#ifdef GOA_EXCHANGE_ENABLED
+ type = GOA_TYPE_EXCHANGE_PROVIDER;
+#endif
+#ifdef GOA_YAHOO_ENABLED
+ type = GOA_TYPE_YAHOO_PROVIDER;
+#endif
+#ifdef GOA_TWITTER_ENABLED
+ type = GOA_TYPE_TWITTER_PROVIDER;
+#endif
type = type; /* silence -Wunused-but-set-variable */
@@ -687,7 +690,6 @@ goa_provider_get_all (void)
GIOExtension *extension = l->data;
ret = g_list_prepend (ret, g_object_new (g_io_extension_get_type (extension), NULL));
}
- ret = g_list_reverse (ret);
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]