[gnome-software/mwleeds/pwa-plugin: 218/219] Allow tests to pass a GDBusConnection to plugins




commit d5bc3f181cabb218c92517a04de27547b75896d3
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Fri Feb 25 20:06:30 2022 -0800

    Allow tests to pass a GDBusConnection to plugins
    
    Let unit tests pass in a GDBusConnection to be used by plugins'
    setup_async functions. This is required for us to be able to use
    libglib-testing for the epiphany self test, because of the way
    GtDBusQueue works. Everywhere except the epiphany plugin, we don't
    actually use the GDBusConnection.

 lib/gs-cmd.c                                       |  1 +
 lib/gs-plugin-loader-sync.c                        |  2 +
 lib/gs-plugin-loader-sync.h                        |  1 +
 lib/gs-plugin-loader.c                             | 29 +++++++++++-
 lib/gs-plugin-loader.h                             |  3 ++
 lib/gs-plugin.h                                    |  1 +
 lib/gs-test.c                                      |  3 +-
 meson.build                                        |  2 +-
 plugins/core/gs-plugin-appstream.c                 |  1 +
 plugins/core/gs-plugin-icons.c                     |  1 +
 plugins/core/gs-plugin-os-release.c                |  1 +
 plugins/core/gs-plugin-rewrite-resource.c          |  1 +
 plugins/core/gs-self-test.c                        |  1 +
 plugins/dpkg/gs-self-test.c                        |  1 +
 plugins/dummy/gs-plugin-dummy.c                    |  1 +
 plugins/dummy/gs-self-test.c                       |  1 +
 plugins/eos-updater/gs-plugin-eos-updater.c        |  1 +
 plugins/epiphany/gs-plugin-epiphany.c              | 54 ++++++++++++++--------
 plugins/fedora-langpacks/gs-self-test.c            |  1 +
 .../gs-plugin-fedora-pkgdb-collections.c           |  1 +
 plugins/flatpak/gs-plugin-flatpak.c                |  1 +
 plugins/flatpak/gs-self-test.c                     |  1 +
 plugins/fwupd/gs-plugin-fwupd.c                    |  1 +
 plugins/fwupd/gs-self-test.c                       |  1 +
 plugins/malcontent/gs-plugin-malcontent.c          |  1 +
 plugins/modalias/gs-self-test.c                    |  1 +
 plugins/packagekit/gs-plugin-packagekit.c          |  1 +
 plugins/packagekit/gs-self-test.c                  |  1 +
 plugins/repos/gs-plugin-repos.c                    |  1 +
 plugins/repos/gs-self-test.c                       |  1 +
 plugins/rpm-ostree/gs-plugin-rpm-ostree.c          |  1 +
 plugins/snap/gs-plugin-snap.c                      |  1 +
 src/gs-application.c                               |  1 +
 33 files changed, 99 insertions(+), 21 deletions(-)
---
diff --git a/lib/gs-cmd.c b/lib/gs-cmd.c
index 22b94b1da..eee84f1ce 100644
--- a/lib/gs-cmd.c
+++ b/lib/gs-cmd.c
@@ -373,6 +373,7 @@ main (int argc, char **argv)
                                      (const gchar * const *) plugin_allowlist,
                                      (const gchar * const *) plugin_blocklist,
                                      NULL,
+                                     NULL,
                                      &error);
        if (!ret) {
                g_print ("Failed to setup plugins: %s\n", error->message);
diff --git a/lib/gs-plugin-loader-sync.c b/lib/gs-plugin-loader-sync.c
index 345fa4cc7..09e0644e8 100644
--- a/lib/gs-plugin-loader-sync.c
+++ b/lib/gs-plugin-loader-sync.c
@@ -255,6 +255,7 @@ gboolean
 gs_plugin_loader_setup (GsPluginLoader       *plugin_loader,
                         const gchar * const  *allowlist,
                         const gchar * const  *blocklist,
+                        GDBusConnection      *connection,
                         GCancellable         *cancellable,
                         GError              **error)
 {
@@ -272,6 +273,7 @@ gs_plugin_loader_setup (GsPluginLoader       *plugin_loader,
        gs_plugin_loader_setup_async (plugin_loader,
                                      allowlist,
                                      blocklist,
+                                     connection,
                                      cancellable,
                                      _helper_finish_sync,
                                      &helper);
diff --git a/lib/gs-plugin-loader-sync.h b/lib/gs-plugin-loader-sync.h
index 55ddb3e05..6d271a391 100644
--- a/lib/gs-plugin-loader-sync.h
+++ b/lib/gs-plugin-loader-sync.h
@@ -40,6 +40,7 @@ GsApp         *gs_plugin_loader_get_system_app        (GsPluginLoader *plugin_loader,
 gboolean        gs_plugin_loader_setup                 (GsPluginLoader *plugin_loader,
                                                         const gchar * const *allowlist,
                                                         const gchar * const *blocklist,
+                                                        GDBusConnection     *connection,
                                                         GCancellable    *cancellable,
                                                         GError         **error);
 
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 3bc93b8cb..8563402e7 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -77,6 +77,8 @@ struct _GsPluginLoader
        GsCategoryManager       *category_manager;
        GsOdrsProvider          *odrs_provider;  /* (owned) (nullable) */
 
+       GDBusConnection         *connection; /* (owned) (nullable) */
+
 #ifdef HAVE_SYSPROF
        SysprofCaptureWriter    *sysprof_writer;  /* (owned) (nullable) */
 #endif
@@ -2087,6 +2089,7 @@ gs_plugin_loader_shutdown (GsPluginLoader *plugin_loader,
        /* Clear some internal data structures. */
        gs_plugin_loader_remove_all_plugins (plugin_loader);
        gs_plugin_loader_remove_all_file_monitors (plugin_loader);
+       g_clear_object (&plugin_loader->connection);
        plugin_loader->setup_complete = FALSE;
        g_clear_object (&plugin_loader->setup_complete_cancellable);
        plugin_loader->setup_complete_cancellable = g_cancellable_new ();
@@ -2180,6 +2183,7 @@ notify_setup_complete (GsPluginLoader *plugin_loader)
  * @plugin_loader: a #GsPluginLoader
  * @allowlist: list of plugin names, or %NULL
  * @blocklist: list of plugin names, or %NULL
+ * @connection: a #GDBusConnection (used by unit tests)
  * @cancellable: A #GCancellable, or %NULL
  * @callback: callback to indicate completion of the asynchronous operation
  * @user_data: data to pass to @callback
@@ -2192,6 +2196,7 @@ void
 gs_plugin_loader_setup_async (GsPluginLoader      *plugin_loader,
                               const gchar * const *allowlist,
                               const gchar * const *blocklist,
+                              GDBusConnection     *connection,
                               GCancellable        *cancellable,
                               GAsyncReadyCallback  callback,
                               gpointer             user_data)
@@ -2224,6 +2229,9 @@ gs_plugin_loader_setup_async (GsPluginLoader      *plugin_loader,
                return;
        }
 
+       if (connection)
+               plugin_loader->connection = g_object_ref (connection);
+
        /* use the default, but this requires a 'make install' */
        if (plugin_loader->locations->len == 0) {
                g_autofree gchar *filename = NULL;
@@ -2444,7 +2452,7 @@ gs_plugin_loader_setup_async (GsPluginLoader      *plugin_loader,
 
                if (GS_PLUGIN_GET_CLASS (plugin)->setup_async != NULL) {
                        setup_data->n_pending++;
-                       GS_PLUGIN_GET_CLASS (plugin)->setup_async (plugin, cancellable,
+                       GS_PLUGIN_GET_CLASS (plugin)->setup_async (plugin, connection, cancellable,
                                                                   plugin_setup_cb, g_object_ref (task));
                }
        }
@@ -2687,6 +2695,7 @@ gs_plugin_loader_dispose (GObject *object)
        g_clear_object (&plugin_loader->category_manager);
        g_clear_object (&plugin_loader->odrs_provider);
        g_clear_object (&plugin_loader->setup_complete_cancellable);
+       g_clear_object (&plugin_loader->connection);
 
 #ifdef HAVE_SYSPROF
        g_clear_pointer (&plugin_loader->sysprof_writer, sysprof_capture_writer_unref);
@@ -4299,6 +4308,24 @@ gs_plugin_loader_get_category_manager (GsPluginLoader *plugin_loader)
        return plugin_loader->category_manager;
 }
 
+/**
+ * gs_plugin_loader_get_connection:
+ * @plugin_loader: a #GsPluginLoader
+ *
+ * Get the #GDBusConnection that was passed to setup_async(), if any. This is
+ * used by the unit tests.
+ *
+ * Returns: (transfer none): a #GDBusConnection, or %NULL
+ * Since: 43
+ */
+GDBusConnection *
+gs_plugin_loader_get_connection (GsPluginLoader *plugin_loader)
+{
+       g_return_val_if_fail (GS_IS_PLUGIN_LOADER (plugin_loader), NULL);
+
+       return plugin_loader->connection;
+}
+
 /**
  * gs_plugin_loader_hint_job_finished:
  * @plugin_loader: a #GsPluginLoader
diff --git a/lib/gs-plugin-loader.h b/lib/gs-plugin-loader.h
index e7edeeecf..4cc23c75c 100644
--- a/lib/gs-plugin-loader.h
+++ b/lib/gs-plugin-loader.h
@@ -45,9 +45,11 @@ void          gs_plugin_loader_job_get_categories_async (GsPluginLoader *plugin_loader,
 GPtrArray      *gs_plugin_loader_job_get_categories_finish (GsPluginLoader *plugin_loader,
                                                         GAsyncResult   *res,
                                                         GError         **error);
+
 void            gs_plugin_loader_setup_async           (GsPluginLoader *plugin_loader,
                                                         const gchar * const *allowlist,
                                                         const gchar * const *blocklist,
+                                                        GDBusConnection *connection,
                                                         GCancellable   *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer        user_data);
@@ -106,6 +108,7 @@ void            gs_plugin_loader_set_max_parallel_ops  (GsPluginLoader *plugin_l
                                                         guint           max_ops);
 
 GsCategoryManager *gs_plugin_loader_get_category_manager (GsPluginLoader *plugin_loader);
+GDBusConnection *gs_plugin_loader_get_connection        (GsPluginLoader *plugin_loader);
 void            gs_plugin_loader_claim_error           (GsPluginLoader *plugin_loader,
                                                         GsPlugin *plugin,
                                                         GsPluginAction action,
diff --git a/lib/gs-plugin.h b/lib/gs-plugin.h
index f247e449b..3c1630880 100644
--- a/lib/gs-plugin.h
+++ b/lib/gs-plugin.h
@@ -95,6 +95,7 @@ struct _GsPluginClass
                                                         const gchar    *accept_label);
 
        void                    (*setup_async)          (GsPlugin               *plugin,
+                                                        GDBusConnection        *connection,
                                                         GCancellable           *cancellable,
                                                         GAsyncReadyCallback     callback,
                                                         gpointer                user_data);
diff --git a/lib/gs-test.c b/lib/gs-test.c
index 2a2e1077b..a931a8fa7 100644
--- a/lib/gs-test.c
+++ b/lib/gs-test.c
@@ -117,6 +117,7 @@ gs_test_reinitialise_plugin_loader (GsPluginLoader      *plugin_loader,
 #ifdef HAVE_SYSPROF
        gint64 begin_time_nsec G_GNUC_UNUSED = SYSPROF_CAPTURE_CURRENT_TIME;
 #endif
+       GDBusConnection *connection = gs_plugin_loader_get_connection (plugin_loader);
 
        /* Shut down */
        gs_plugin_loader_shutdown (plugin_loader, NULL);
@@ -129,7 +130,7 @@ gs_test_reinitialise_plugin_loader (GsPluginLoader      *plugin_loader,
 
        /* Start all the plugins setting up again in parallel. Use the blocking
         * sync version of the function, just for the tests. */
-       gs_plugin_loader_setup (plugin_loader, allowlist, blocklist, NULL, &local_error);
+       gs_plugin_loader_setup (plugin_loader, allowlist, blocklist, connection, NULL, &local_error);
        g_assert_no_error (local_error);
 
 #ifdef HAVE_SYSPROF
diff --git a/meson.build b/meson.build
index 4e8b596f6..aeeb72a06 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,7 @@ conf.set_quoted('APPLICATION_ID', application_id)
 
 # this refers to the gnome-software plugin API version
 # this is not in any way related to a package or soname version
-gs_plugin_api_version = '17'
+gs_plugin_api_version = '18'
 conf.set_quoted('GS_PLUGIN_API_VERSION', gs_plugin_api_version)
 
 # private subdirectory of libdir for the private shared libgnomesoftware to live in
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index e3ae50965..ab10e00dd 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -868,6 +868,7 @@ static void setup_thread_cb (GTask        *task,
 
 static void
 gs_plugin_appstream_setup_async (GsPlugin            *plugin,
+                                 GDBusConnection     *connection,
                                  GCancellable        *cancellable,
                                  GAsyncReadyCallback  callback,
                                  gpointer             user_data)
diff --git a/plugins/core/gs-plugin-icons.c b/plugins/core/gs-plugin-icons.c
index 72a235ec6..0e1987977 100644
--- a/plugins/core/gs-plugin-icons.c
+++ b/plugins/core/gs-plugin-icons.c
@@ -62,6 +62,7 @@ gs_plugin_icons_dispose (GObject *object)
 
 static void
 gs_plugin_icons_setup_async (GsPlugin            *plugin,
+                             GDBusConnection     *connection,
                              GCancellable        *cancellable,
                              GAsyncReadyCallback  callback,
                              gpointer             user_data)
diff --git a/plugins/core/gs-plugin-os-release.c b/plugins/core/gs-plugin-os-release.c
index 685af27ce..dea372565 100644
--- a/plugins/core/gs-plugin-os-release.c
+++ b/plugins/core/gs-plugin-os-release.c
@@ -41,6 +41,7 @@ gs_plugin_os_release_init (GsPluginOsRelease *self)
 
 static void
 gs_plugin_os_release_setup_async (GsPlugin            *plugin,
+                                  GDBusConnection     *connection,
                                   GCancellable        *cancellable,
                                   GAsyncReadyCallback  callback,
                                   gpointer             user_data)
diff --git a/plugins/core/gs-plugin-rewrite-resource.c b/plugins/core/gs-plugin-rewrite-resource.c
index b52227bae..b7534df40 100644
--- a/plugins/core/gs-plugin-rewrite-resource.c
+++ b/plugins/core/gs-plugin-rewrite-resource.c
@@ -58,6 +58,7 @@ gs_plugin_rewrite_resource_dispose (GObject *object)
 
 static void
 gs_plugin_rewrite_resource_setup_async (GsPlugin            *plugin,
+                                        GDBusConnection     *connection,
                                         GCancellable        *cancellable,
                                         GAsyncReadyCallback  callback,
                                         gpointer             user_data)
diff --git a/plugins/core/gs-self-test.c b/plugins/core/gs-self-test.c
index a786e58bb..bd6c46232 100644
--- a/plugins/core/gs-self-test.c
+++ b/plugins/core/gs-self-test.c
@@ -248,6 +248,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert_true (ret);
diff --git a/plugins/dpkg/gs-self-test.c b/plugins/dpkg/gs-self-test.c
index 0318e70eb..84b7d8a17 100644
--- a/plugins/dpkg/gs-self-test.c
+++ b/plugins/dpkg/gs-self-test.c
@@ -74,6 +74,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert (ret);
diff --git a/plugins/dummy/gs-plugin-dummy.c b/plugins/dummy/gs-plugin-dummy.c
index aed934dda..dbb403c8b 100644
--- a/plugins/dummy/gs-plugin-dummy.c
+++ b/plugins/dummy/gs-plugin-dummy.c
@@ -74,6 +74,7 @@ gs_plugin_dummy_dispose (GObject *object)
 
 static void
 gs_plugin_dummy_setup_async (GsPlugin            *plugin,
+                             GDBusConnection     *connection,
                              GCancellable        *cancellable,
                              GAsyncReadyCallback  callback,
                              gpointer             user_data)
diff --git a/plugins/dummy/gs-self-test.c b/plugins/dummy/gs-self-test.c
index 9964f166c..d603623c2 100644
--- a/plugins/dummy/gs-self-test.c
+++ b/plugins/dummy/gs-self-test.c
@@ -832,6 +832,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert (ret);
diff --git a/plugins/eos-updater/gs-plugin-eos-updater.c b/plugins/eos-updater/gs-plugin-eos-updater.c
index 7251f33ff..a4b635134 100644
--- a/plugins/eos-updater/gs-plugin-eos-updater.c
+++ b/plugins/eos-updater/gs-plugin-eos-updater.c
@@ -501,6 +501,7 @@ static void proxy_new_cb (GObject      *source_object,
  * which is tied to the main thread’s #GMainContext. */
 static void
 gs_plugin_eos_updater_setup_async (GsPlugin            *plugin,
+                                   GDBusConnection     *connection,
                                    GCancellable        *cancellable,
                                    GAsyncReadyCallback  callback,
                                    gpointer             user_data)
diff --git a/plugins/epiphany/gs-plugin-epiphany.c b/plugins/epiphany/gs-plugin-epiphany.c
index 58f64bf25..935e77b5c 100644
--- a/plugins/epiphany/gs-plugin-epiphany.c
+++ b/plugins/epiphany/gs-plugin-epiphany.c
@@ -37,6 +37,7 @@ struct _GsPluginEpiphany
        GsEphyWebAppProvider *epiphany_proxy;  /* (owned) */
        GDBusProxy *launcher_portal_proxy;  /* (owned) */
        GFileMonitor *monitor; /* (owned) */
+       GDBusConnection *connection; /* (owned) */
        guint changed_id;
        GMutex installed_apps_mutex;
 };
@@ -105,6 +106,7 @@ static void setup_thread_cb (GTask        *task,
 
 static void
 gs_plugin_epiphany_setup_async (GsPlugin            *plugin,
+                                GDBusConnection     *connection,
                                 GCancellable        *cancellable,
                                 GAsyncReadyCallback  callback,
                                 gpointer             user_data)
@@ -120,6 +122,9 @@ gs_plugin_epiphany_setup_async (GsPlugin            *plugin,
 
        g_debug ("%s", G_STRFUNC);
 
+       if (connection)
+               self->connection = g_object_ref (connection);
+
        /* Watch for changes to the set of installed apps in the main thread.
         * This will also trigger when other apps' dynamic launchers are
         * installed or removed but that is expected to be infrequent.
@@ -163,16 +168,28 @@ setup_thread_cb (GTask        *task,
 
        assert_in_worker (self);
 
+       if (self->connection == NULL) {
+               self->connection = g_bus_get_sync (G_BUS_TYPE_SESSION,
+                                                  g_task_get_cancellable (task),
+                                                  &local_error);
+       }
+
+       if (self->connection == NULL) {
+               gs_epiphany_error_convert (&local_error);
+               g_task_return_error (task, g_steal_pointer (&local_error));
+               return;
+       }
+
        /* Check that the proxy exists (and is owned; it should auto-start) so
         * we can disable the plugin for systems which don’t have new enough
         * Epiphany.
         */
-       self->epiphany_proxy = gs_ephy_web_app_provider_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
-                                                                               G_DBUS_PROXY_FLAGS_NONE,
-                                                                               
"org.gnome.Epiphany.WebAppProvider",
-                                                                               
"/org/gnome/Epiphany/WebAppProvider",
-                                                                               g_task_get_cancellable (task),
-                                                                               &local_error);
+       self->epiphany_proxy = gs_ephy_web_app_provider_proxy_new_sync (self->connection,
+                                                                       G_DBUS_PROXY_FLAGS_NONE,
+                                                                       "org.gnome.Epiphany.WebAppProvider",
+                                                                       "/org/gnome/Epiphany/WebAppProvider",
+                                                                       g_task_get_cancellable (task),
+                                                                       &local_error);
        if (self->epiphany_proxy == NULL) {
                gs_epiphany_error_convert (&local_error);
                g_task_return_error (task, g_steal_pointer (&local_error));
@@ -188,12 +205,12 @@ setup_thread_cb (GTask        *task,
        }
 
        /* Check if the dynamic launcher portal is available and disable otherwise */
-       portal_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, NULL,
-                                                     "org.freedesktop.portal.Desktop",
-                                                     "/org/freedesktop/portal/desktop",
-                                                     "org.freedesktop.DBus.Properties",
-                                                     g_task_get_cancellable (task),
-                                                     &local_error);
+       portal_proxy = g_dbus_proxy_new_sync (self->connection, G_DBUS_PROXY_FLAGS_NONE, NULL,
+                                             "org.freedesktop.portal.Desktop",
+                                             "/org/freedesktop/portal/desktop",
+                                             "org.freedesktop.DBus.Properties",
+                                             g_task_get_cancellable (task),
+                                             &local_error);
        if (portal_proxy == NULL) {
                gs_epiphany_error_convert (&local_error);
                g_task_return_error (task, g_steal_pointer (&local_error));
@@ -215,12 +232,12 @@ setup_thread_cb (GTask        *task,
        }
 
        /* And make a proxy object for the dynamic launcher portal */
-       self->launcher_portal_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION, 
G_DBUS_PROXY_FLAGS_NONE, NULL,
-                                                                    "org.freedesktop.portal.Desktop",
-                                                                    "/org/freedesktop/portal/desktop",
-                                                                    "org.freedesktop.portal.DynamicLauncher",
-                                                                    g_task_get_cancellable (task),
-                                                                    &local_error);
+       self->launcher_portal_proxy = g_dbus_proxy_new_sync (self->connection, G_DBUS_PROXY_FLAGS_NONE, NULL,
+                                                            "org.freedesktop.portal.Desktop",
+                                                            "/org/freedesktop/portal/desktop",
+                                                            "org.freedesktop.portal.DynamicLauncher",
+                                                            g_task_get_cancellable (task),
+                                                            &local_error);
        if (self->launcher_portal_proxy == NULL) {
                gs_epiphany_error_convert (&local_error);
                g_task_return_error (task, g_steal_pointer (&local_error));
@@ -313,6 +330,7 @@ gs_plugin_epiphany_dispose (GObject *object)
        g_clear_object (&self->launcher_portal_proxy);
        g_clear_object (&self->monitor);
        g_clear_object (&self->worker);
+       g_clear_object (&self->connection);
 
        G_OBJECT_CLASS (gs_plugin_epiphany_parent_class)->dispose (object);
 }
diff --git a/plugins/fedora-langpacks/gs-self-test.c b/plugins/fedora-langpacks/gs-self-test.c
index 4e95fa867..f09359a68 100644
--- a/plugins/fedora-langpacks/gs-self-test.c
+++ b/plugins/fedora-langpacks/gs-self-test.c
@@ -76,6 +76,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert (ret);
diff --git a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c 
b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
index ad51d4fb4..afaf401b9 100644
--- a/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
+++ b/plugins/fedora-pkgdb-collections/gs-plugin-fedora-pkgdb-collections.c
@@ -126,6 +126,7 @@ _file_changed_cb (GFileMonitor *monitor,
 
 static void
 gs_plugin_fedora_pkgdb_collections_setup_async (GsPlugin            *plugin,
+                                                GDBusConnection     *connection,
                                                 GCancellable        *cancellable,
                                                 GAsyncReadyCallback  callback,
                                                 gpointer             user_data)
diff --git a/plugins/flatpak/gs-plugin-flatpak.c b/plugins/flatpak/gs-plugin-flatpak.c
index 15e60404d..8038beaaf 100644
--- a/plugins/flatpak/gs-plugin-flatpak.c
+++ b/plugins/flatpak/gs-plugin-flatpak.c
@@ -163,6 +163,7 @@ static void setup_thread_cb (GTask        *task,
 
 static void
 gs_plugin_flatpak_setup_async (GsPlugin            *plugin,
+                               GDBusConnection     *connection,
                                GCancellable        *cancellable,
                                GAsyncReadyCallback  callback,
                                gpointer             user_data)
diff --git a/plugins/flatpak/gs-self-test.c b/plugins/flatpak/gs-self-test.c
index 5b4a1faf8..eb4b65bbe 100644
--- a/plugins/flatpak/gs-self-test.c
+++ b/plugins/flatpak/gs-self-test.c
@@ -1934,6 +1934,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert_true (ret);
diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c
index 66b76dfce..938aa81fe 100644
--- a/plugins/fwupd/gs-plugin-fwupd.c
+++ b/plugins/fwupd/gs-plugin-fwupd.c
@@ -227,6 +227,7 @@ static void setup_features_cb (GObject      *source_object,
 
 static void
 gs_plugin_fwupd_setup_async (GsPlugin            *plugin,
+                             GDBusConnection     *connection,
                              GCancellable        *cancellable,
                              GAsyncReadyCallback  callback,
                              gpointer             user_data)
diff --git a/plugins/fwupd/gs-self-test.c b/plugins/fwupd/gs-self-test.c
index 34e6ecbcf..ec7707ee4 100644
--- a/plugins/fwupd/gs-self-test.c
+++ b/plugins/fwupd/gs-self-test.c
@@ -93,6 +93,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert_true (ret);
diff --git a/plugins/malcontent/gs-plugin-malcontent.c b/plugins/malcontent/gs-plugin-malcontent.c
index 56e945553..9fc915103 100644
--- a/plugins/malcontent/gs-plugin-malcontent.c
+++ b/plugins/malcontent/gs-plugin-malcontent.c
@@ -289,6 +289,7 @@ static void get_app_filter_cb (GObject      *source_object,
 
 static void
 gs_plugin_malcontent_setup_async (GsPlugin            *plugin,
+                                  GDBusConnection     *connection,
                                   GCancellable        *cancellable,
                                   GAsyncReadyCallback  callback,
                                   gpointer             user_data)
diff --git a/plugins/modalias/gs-self-test.c b/plugins/modalias/gs-self-test.c
index e7730f77b..3b9284ee4 100644
--- a/plugins/modalias/gs-self-test.c
+++ b/plugins/modalias/gs-self-test.c
@@ -90,6 +90,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert (ret);
diff --git a/plugins/packagekit/gs-plugin-packagekit.c b/plugins/packagekit/gs-plugin-packagekit.c
index 6ad23e988..ca1e2554e 100644
--- a/plugins/packagekit/gs-plugin-packagekit.c
+++ b/plugins/packagekit/gs-plugin-packagekit.c
@@ -2310,6 +2310,7 @@ static void get_offline_update_permission_cb (GObject      *source_object,
 
 static void
 gs_plugin_packagekit_setup_async (GsPlugin            *plugin,
+                                  GDBusConnection     *connection,
                                   GCancellable        *cancellable,
                                   GAsyncReadyCallback  callback,
                                   gpointer             user_data)
diff --git a/plugins/packagekit/gs-self-test.c b/plugins/packagekit/gs-self-test.c
index f6a48096f..1ad14c466 100644
--- a/plugins/packagekit/gs-self-test.c
+++ b/plugins/packagekit/gs-self-test.c
@@ -260,6 +260,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert (ret);
diff --git a/plugins/repos/gs-plugin-repos.c b/plugins/repos/gs-plugin-repos.c
index 8e57e8ba5..54bada9c1 100644
--- a/plugins/repos/gs-plugin-repos.c
+++ b/plugins/repos/gs-plugin-repos.c
@@ -217,6 +217,7 @@ gs_plugin_repos_changed_cb (GFileMonitor      *monitor,
 
 static void
 gs_plugin_repos_setup_async (GsPlugin            *plugin,
+                             GDBusConnection     *connection,
                              GCancellable        *cancellable,
                              GAsyncReadyCallback  callback,
                              gpointer             user_data)
diff --git a/plugins/repos/gs-self-test.c b/plugins/repos/gs-self-test.c
index f72241547..720127954 100644
--- a/plugins/repos/gs-self-test.c
+++ b/plugins/repos/gs-self-test.c
@@ -58,6 +58,7 @@ main (int argc, char **argv)
                                      allowlist,
                                      NULL,
                                      NULL,
+                                     NULL,
                                      &error);
        g_assert_no_error (error);
        g_assert (ret);
diff --git a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
index a166f9fbb..262c4407d 100644
--- a/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
+++ b/plugins/rpm-ostree/gs-plugin-rpm-ostree.c
@@ -343,6 +343,7 @@ static void setup_thread_cb (GTask        *task,
 
 static void
 gs_plugin_rpm_ostree_setup_async (GsPlugin            *plugin,
+                                  GDBusConnection     *connection,
                                   GCancellable        *cancellable,
                                   GAsyncReadyCallback  callback,
                                   gpointer             user_data)
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 149fba578..b0b5ad52c 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -240,6 +240,7 @@ static void get_system_information_cb (GObject      *source_object,
 
 static void
 gs_plugin_snap_setup_async (GsPlugin            *plugin,
+                            GDBusConnection     *connection,
                             GCancellable        *cancellable,
                             GAsyncReadyCallback  callback,
                             gpointer             user_data)
diff --git a/src/gs-application.c b/src/gs-application.c
index db1d4e2d1..12c1d3513 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -981,6 +981,7 @@ gs_application_startup (GApplication *application)
                                      (const gchar * const *) plugin_allowlist,
                                      (const gchar * const *) plugin_blocklist,
                                      NULL,
+                                     NULL,
                                      startup_cb,
                                      app);
 }


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