[gnome-software/wip/temp/ubuntu-xenial-rebased: 19/326] Don't need plugins to report review auth - the plugin does this directly



commit a42a7134af0b97b29812f6d974cad6af43fba660
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Jan 22 15:43:17 2016 +1300

    Don't need plugins to report review auth - the plugin does this directly

 src/gs-plugin-loader.c |   17 ++---------------
 src/gs-plugin.h        |    1 -
 2 files changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index b7cb318..46093d4 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -52,7 +52,6 @@ typedef struct
        gboolean                 online; 
 
        gboolean                 supports_reviews;
-       gchar                   **review_auths;
 } GsPluginLoaderPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (GsPluginLoader, gs_plugin_loader, G_TYPE_OBJECT)
@@ -2909,8 +2908,7 @@ gs_plugin_loader_updates_changed_cb (GsPlugin *plugin, gpointer user_data)
  */
 static GsPlugin *
 gs_plugin_loader_open_plugin (GsPluginLoader *plugin_loader,
-                             const gchar *filename,
-                             GPtrArray *review_auths)
+                             const gchar *filename)
 {
        GsPluginLoaderPrivate *priv = gs_plugin_loader_get_instance_private (plugin_loader);
        gboolean ret;
@@ -2956,14 +2954,6 @@ gs_plugin_loader_open_plugin (GsPluginLoader *plugin_loader,
        if (plugin_supports_reviews && plugin_supports_reviews (plugin))
                priv->supports_reviews = TRUE;
 
-       /* Check if this plugin requires any authorization for reviews */
-       (void) g_module_symbol (module,
-                               "gs_plugin_get_review_auth",
-                               (gpointer *) &plugin_review_auth);
-       review_auth = plugin_review_auth != NULL ? plugin_review_auth (plugin) : NULL;
-       if (review_auth)
-               g_ptr_array_add (review_auths, g_strdup (review_auth));
-
        /* print what we know */
        plugin = g_slice_new0 (GsPlugin);
        plugin->enabled = TRUE;
@@ -3076,7 +3066,6 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
        guint j;
        g_autoptr(GDir) dir = NULL;
        g_autoptr(AsProfileTask) ptask = NULL;
-       GPtrArray *review_auths;
 
        g_return_val_if_fail (priv->location != NULL, FALSE);
 
@@ -3088,7 +3077,6 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
 
        /* try to open each plugin */
        g_debug ("searching for plugins in %s", priv->location);
-       review_auths = g_ptr_array_new ();
        do {
                g_autofree gchar *filename_plugin = NULL;
                filename_tmp = g_dir_read_name (dir);
@@ -3099,7 +3087,7 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
                filename_plugin = g_build_filename (priv->location,
                                                    filename_tmp,
                                                    NULL);
-               gs_plugin_loader_open_plugin (plugin_loader, filename_plugin, review_auths);
+               gs_plugin_loader_open_plugin (plugin_loader, filename_plugin);
        } while (TRUE);
 
        /* optional whitelist */
@@ -3315,7 +3303,6 @@ gs_plugin_loader_finalize (GObject *object)
        g_strfreev (priv->compatible_projects);
        g_free (priv->location);
        g_free (priv->locale);
-       g_strfreev (priv->review_auths);
 
        g_mutex_clear (&priv->pending_apps_mutex);
 
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 5053189..c512143 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -149,7 +149,6 @@ typedef enum {
 typedef const gchar    *(*GsPluginGetNameFunc)         (void);
 typedef const gchar    **(*GsPluginGetDepsFunc)        (GsPlugin       *plugin);
 typedef gboolean       *(*GsPluginGetSupportsReviewsFunc)      (GsPlugin       *plugin);
-typedef const gchar    *(*GsPluginGetReviewAuthFunc)   (GsPlugin       *plugin);
 typedef void            (*GsPluginFunc)                (GsPlugin       *plugin);
 typedef gboolean        (*GsPluginSetupFunc)           (GsPlugin       *plugin,
                                                         GCancellable   *cancellable,


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