[gnome-online-accounts/wip/rishi/telepathy: 3/5] Revert "provider: make goa_provider_get_for_provider_type() handle factories too"



commit ce8b458cb7ab03b2890b0d0ee9cf6eac5a5a9713
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Apr 17 12:21:00 2018 +0200

    Revert "provider: make goa_provider_get_for_provider_type() handle factories too"
    
    This reverts commit a990c61cf61d3a6fd8b9d84acb18b815214d6b6e.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795322

 src/goabackend/goaprovider.c |   43 ++++++-----------------------------------
 1 files changed, 7 insertions(+), 36 deletions(-)
---
diff --git a/src/goabackend/goaprovider.c b/src/goabackend/goaprovider.c
index 003b142..a533b33 100644
--- a/src/goabackend/goaprovider.c
+++ b/src/goabackend/goaprovider.c
@@ -1045,16 +1045,9 @@ goa_provider_ensure_builtins_loaded (void)
  * goa_provider_get_for_provider_type:
  * @provider_type: A provider type.
  *
- * Returns a #GoaProvider for @provider_type (if available).
- *
- * If @provider_type doesn't contain any "/", a
- * %GOA_PROVIDER_EXTENSION_POINT_NAME extension for @provider_type is looked up
- * and the newly created #GoaProvider, if any, is returned.
- *
- * If @provider_type contains a "/", a
- * %GOA_PROVIDER_FACTORY_EXTENSION_POINT_NAME extension for the first part of
- * @provider_type is looked up. If found, the #GoaProviderFactory is used
- * to create a dynamic #GoaProvider matching the second part of @provider_type.
+ * Looks up the %GOA_PROVIDER_EXTENSION_POINT_NAME extension
+ * point and returns a newly created #GoaProvider for
+ * @provider_type, if any.
  *
  * Returns: (transfer full): A #GoaProvider (that must be freed
  * with g_object_unref()) or %NULL if not found.
@@ -1064,7 +1057,6 @@ goa_provider_get_for_provider_type (const gchar *provider_type)
 {
   GIOExtension *extension;
   GIOExtensionPoint *extension_point;
-  gchar **split_provider_type;
   GoaProvider *ret;
 
   g_return_val_if_fail (provider_type != NULL, NULL);
@@ -1073,31 +1065,10 @@ goa_provider_get_for_provider_type (const gchar *provider_type)
 
   ret = NULL;
 
-  split_provider_type = g_strsplit (provider_type, "/", 2);
-
-  if (g_strv_length (split_provider_type) == 1)
-    {
-      /* Normal provider */
-      extension_point = g_io_extension_point_lookup (GOA_PROVIDER_EXTENSION_POINT_NAME);
-      extension = g_io_extension_point_get_extension_by_name (extension_point, provider_type);
-      if (extension != NULL)
-        ret = GOA_PROVIDER (g_object_new (g_io_extension_get_type (extension), NULL));
-    }
-  else
-    {
-      /* Dynamic provider created through a factory */
-      extension_point = g_io_extension_point_lookup (GOA_PROVIDER_FACTORY_EXTENSION_POINT_NAME);
-      extension = g_io_extension_point_get_extension_by_name (extension_point, split_provider_type[0]);
-      if (extension != NULL)
-        {
-          GoaProviderFactory *factory = g_object_new (g_io_extension_get_type (extension), NULL);
-          ret = goa_provider_factory_get_provider (factory, split_provider_type[1]);
-          g_object_unref (factory);
-        }
-    }
-
-  g_strfreev (split_provider_type);
-
+  extension_point = g_io_extension_point_lookup (GOA_PROVIDER_EXTENSION_POINT_NAME);
+  extension = g_io_extension_point_get_extension_by_name (extension_point, provider_type);
+  if (extension != NULL)
+    ret = GOA_PROVIDER (g_object_new (g_io_extension_get_type (extension), NULL));
   return ret;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]