[gnome-software/wip/hughsie/GsPluginFailureFlags] Add GsPluginFailureFlags
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/hughsie/GsPluginFailureFlags] Add GsPluginFailureFlags
- Date: Tue, 22 Nov 2016 19:56:43 +0000 (UTC)
commit 7af0649062fac3570fdb046da8441f52d535dee4
Author: Richard Hughes <richard hughsie com>
Date: Tue Nov 22 16:31:54 2016 +0000
Add GsPluginFailureFlags
src/gs-application.c | 3 +
src/gs-auth-dialog.c | 1 +
src/gs-cmd.c | 18 ++-
src/gs-page.c | 10 +
src/gs-plugin-loader-sync.c | 87 ++++++---
src/gs-plugin-loader-sync.h | 43 +++--
src/gs-plugin-loader.c | 432 ++++++++++++++++++++++++++--------------
src/gs-plugin-loader.h | 50 ++++--
src/gs-plugin-types.h | 20 ++
src/gs-self-test.c | 41 ++++-
src/gs-shell-category.c | 1 +
src/gs-shell-details.c | 9 +
src/gs-shell-extras.c | 3 +
src/gs-shell-installed.c | 1 +
src/gs-shell-loading.c | 1 +
src/gs-shell-moderate.c | 3 +
src/gs-shell-overview.c | 5 +
src/gs-shell-search-provider.c | 1 +
src/gs-shell-search.c | 1 +
src/gs-shell-updates.c | 8 +
src/gs-sources-dialog.c | 4 +
src/gs-update-dialog.c | 1 +
src/gs-update-monitor.c | 4 +
23 files changed, 534 insertions(+), 213 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 5892856..04361b8 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -177,6 +177,7 @@ gs_application_initialize_plugins (GsApplication *app)
if (!gs_plugin_loader_setup (app->plugin_loader,
plugin_whitelist,
plugin_blacklist,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
&error)) {
g_warning ("Failed to setup plugins: %s", error->message);
exit (1);
@@ -398,6 +399,7 @@ reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data)
gs_plugin_loader_app_action_async (app->plugin_loader,
NULL, /* everything! */
GS_PLUGIN_ACTION_UPDATE_CANCEL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
app->cancellable,
cancel_trigger_failed_cb,
app);
@@ -473,6 +475,7 @@ reboot_and_install (GSimpleAction *action,
gs_application_initialize_plugins (app);
gs_plugin_loader_update_async (app->plugin_loader,
NULL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
app->cancellable,
(GAsyncReadyCallback) offline_update_cb,
app);
diff --git a/src/gs-auth-dialog.c b/src/gs-auth-dialog.c
index 21743da..47541cf 100644
--- a/src/gs-auth-dialog.c
+++ b/src/gs-auth-dialog.c
@@ -172,6 +172,7 @@ gs_auth_dialog_continue_cb (GtkWidget *widget, GsAuthDialog *dialog)
gs_plugin_loader_auth_action_async (dialog->plugin_loader,
dialog->auth,
action,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
dialog->cancellable,
gs_auth_dialog_authenticate_cb,
dialog);
diff --git a/src/gs-cmd.c b/src/gs-cmd.c
index f4bf40a..0368bb7 100644
--- a/src/gs-cmd.c
+++ b/src/gs-cmd.c
@@ -276,6 +276,7 @@ main (int argc, char **argv)
ret = gs_plugin_loader_setup (plugin_loader,
plugin_whitelist,
plugin_blacklist,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
&error);
if (!ret) {
g_print ("Failed to setup plugins: %s\n", error->message);
@@ -290,6 +291,7 @@ main (int argc, char **argv)
g_object_unref (list);
list = gs_plugin_loader_get_installed (plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL) {
@@ -304,6 +306,7 @@ main (int argc, char **argv)
list = gs_plugin_loader_search (plugin_loader,
argv[2],
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL) {
@@ -317,6 +320,7 @@ main (int argc, char **argv)
ret = gs_plugin_loader_app_action (plugin_loader,
app,
GS_PLUGIN_ACTION_UPGRADE_DOWNLOAD,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (ret)
@@ -327,6 +331,7 @@ main (int argc, char **argv)
ret = gs_plugin_loader_app_refine (plugin_loader,
app,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (!ret)
@@ -339,6 +344,7 @@ main (int argc, char **argv)
ret = gs_plugin_loader_app_action (plugin_loader,
app,
GS_PLUGIN_ACTION_LAUNCH,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (!ret)
@@ -349,6 +355,7 @@ main (int argc, char **argv)
app = gs_plugin_loader_file_to_app (plugin_loader,
file,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (app == NULL) {
@@ -363,6 +370,7 @@ main (int argc, char **argv)
g_object_unref (list);
list = gs_plugin_loader_get_updates (plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL) {
@@ -376,6 +384,7 @@ main (int argc, char **argv)
g_object_unref (list);
list = gs_plugin_loader_get_distro_upgrades (plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL) {
@@ -386,6 +395,7 @@ main (int argc, char **argv)
} else if (argc == 2 && g_strcmp0 (argv[1], "sources") == 0) {
list = gs_plugin_loader_get_sources (plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL)
@@ -396,6 +406,7 @@ main (int argc, char **argv)
g_object_unref (list);
list = gs_plugin_loader_get_popular (plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL) {
@@ -409,6 +420,7 @@ main (int argc, char **argv)
g_object_unref (list);
list = gs_plugin_loader_get_featured (plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL) {
@@ -422,6 +434,7 @@ main (int argc, char **argv)
g_ptr_array_unref (categories);
categories = gs_plugin_loader_get_categories (plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (categories == NULL) {
@@ -447,6 +460,7 @@ main (int argc, char **argv)
list = gs_plugin_loader_get_category_apps (plugin_loader,
category,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
if (list == NULL) {
@@ -458,7 +472,9 @@ main (int argc, char **argv)
GsPluginRefreshFlags refresh_flags;
refresh_flags = gs_cmd_refresh_flag_from_string (argv[2]);
ret = gs_plugin_loader_refresh (plugin_loader, cache_age,
- refresh_flags, NULL, &error);
+ refresh_flags,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
+ NULL, &error);
} else {
ret = FALSE;
g_set_error_literal (&error,
diff --git a/src/gs-page.c b/src/gs-page.c
index d0c7b27..5df8af7 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -91,6 +91,7 @@ gs_page_install_authenticate_cb (GtkDialog *dialog,
gs_plugin_loader_app_action_async (priv->plugin_loader,
helper->app,
GS_PLUGIN_ACTION_INSTALL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->cancellable,
gs_page_app_installed_cb,
helper);
@@ -118,6 +119,7 @@ gs_page_remove_authenticate_cb (GtkDialog *dialog,
gs_plugin_loader_app_action_async (priv->plugin_loader,
helper->app,
GS_PLUGIN_ACTION_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->cancellable,
gs_page_app_removed_cb,
helper);
@@ -287,6 +289,7 @@ gs_page_install_app (GsPage *page, GsApp *app, GCancellable *cancellable)
gs_plugin_loader_app_action_async (priv->plugin_loader,
app,
helper->action,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->cancellable,
gs_page_app_installed_cb,
helper);
@@ -311,6 +314,7 @@ gs_page_update_app_response_cb (GtkDialog *dialog,
gs_plugin_loader_app_action_async (priv->plugin_loader,
helper->app,
GS_PLUGIN_ACTION_UPDATE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->cancellable,
gs_page_app_installed_cb,
helper);
@@ -406,6 +410,7 @@ gs_page_update_app (GsPage *page, GsApp *app, GCancellable *cancellable)
gs_plugin_loader_app_action_async (priv->plugin_loader,
helper->app,
helper->action,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->cancellable,
gs_page_app_installed_cb,
helper);
@@ -430,6 +435,7 @@ gs_page_remove_app_response_cb (GtkDialog *dialog,
gs_plugin_loader_app_action_async (priv->plugin_loader,
helper->app,
helper->action,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->cancellable,
gs_page_app_removed_cb,
helper);
@@ -455,6 +461,7 @@ gs_page_remove_app (GsPage *page, GsApp *app, GCancellable *cancellable)
gs_plugin_loader_app_action_async (priv->plugin_loader,
app,
GS_PLUGIN_ACTION_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->cancellable,
gs_page_app_removed_cb,
helper);
@@ -525,6 +532,7 @@ gs_page_launch_app (GsPage *page, GsApp *app, GCancellable *cancellable)
gs_plugin_loader_app_action_async (priv->plugin_loader,
app,
GS_PLUGIN_ACTION_LAUNCH,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
cancellable,
gs_page_app_launched_cb,
NULL);
@@ -550,6 +558,7 @@ gs_page_shortcut_add (GsPage *page, GsApp *app, GCancellable *cancellable)
gs_plugin_loader_app_action_async (priv->plugin_loader,
app,
GS_PLUGIN_ACTION_ADD_SHORTCUT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
cancellable,
gs_page_app_shortcut_added_cb,
NULL);
@@ -575,6 +584,7 @@ gs_page_shortcut_remove (GsPage *page, GsApp *app, GCancellable *cancellable)
gs_plugin_loader_app_action_async (priv->plugin_loader,
app,
GS_PLUGIN_ACTION_REMOVE_SHORTCUT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
cancellable,
gs_page_app_shortcut_removed_cb,
NULL);
diff --git a/src/gs-plugin-loader-sync.c b/src/gs-plugin-loader-sync.c
index 5da526e..9c1cc24 100644
--- a/src/gs-plugin-loader-sync.c
+++ b/src/gs-plugin-loader-sync.c
@@ -26,7 +26,7 @@
GsApp *
gs_plugin_loader_get_app_by_id (GsPluginLoader *plugin_loader,
const gchar *id,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
GCancellable *cancellable,
GError **error)
{
@@ -34,7 +34,8 @@ gs_plugin_loader_get_app_by_id (GsPluginLoader *plugin_loader,
gboolean ret;
app = gs_app_new (id);
- ret = gs_plugin_loader_app_refine (plugin_loader, app, flags,
+ ret = gs_plugin_loader_app_refine (plugin_loader, app, refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
cancellable, error);
if (!ret)
g_clear_object (&app);
@@ -65,7 +66,8 @@ gs_plugin_loader_get_installed_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_get_installed (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -80,7 +82,8 @@ gs_plugin_loader_get_installed (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_installed_async (plugin_loader,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback)
gs_plugin_loader_get_installed_finish_sync,
&helper);
@@ -108,7 +111,8 @@ gs_plugin_loader_search_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_search (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -124,7 +128,8 @@ gs_plugin_loader_search (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_search_async (plugin_loader,
value,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_search_finish_sync,
&helper);
@@ -151,7 +156,8 @@ gs_plugin_loader_get_updates_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_get_updates (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -166,7 +172,8 @@ gs_plugin_loader_get_updates (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_updates_async (plugin_loader,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_get_updates_finish_sync,
&helper);
@@ -193,9 +200,10 @@ gs_plugin_loader_get_distro_upgrades_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_get_distro_upgrades (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
- GCancellable *cancellable,
- GError **error)
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
+ GCancellable *cancellable,
+ GError **error)
{
GsPluginLoaderHelper helper;
@@ -208,7 +216,8 @@ gs_plugin_loader_get_distro_upgrades (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_distro_upgrades_async (plugin_loader,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback)
gs_plugin_loader_get_distro_upgrades_finish_sync,
&helper);
@@ -235,7 +244,8 @@ gs_plugin_loader_get_sources_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_get_sources (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -250,7 +260,8 @@ gs_plugin_loader_get_sources (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_sources_async (plugin_loader,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_get_sources_finish_sync,
&helper);
@@ -277,7 +288,8 @@ gs_plugin_loader_get_popular_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_get_popular (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -292,7 +304,8 @@ gs_plugin_loader_get_popular (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_popular_async (plugin_loader,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_get_popular_finish_sync,
&helper);
@@ -319,7 +332,8 @@ gs_plugin_loader_get_featured_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_get_featured (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -334,7 +348,8 @@ gs_plugin_loader_get_featured (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_featured_async (plugin_loader,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_get_featured_finish_sync,
&helper);
@@ -361,7 +376,8 @@ gs_plugin_loader_get_categories_finish_sync (GsPluginLoader *plugin_loader,
GPtrArray *
gs_plugin_loader_get_categories (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -376,7 +392,8 @@ gs_plugin_loader_get_categories (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_categories_async (plugin_loader,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback)
gs_plugin_loader_get_categories_finish_sync,
&helper);
@@ -404,7 +421,8 @@ gs_plugin_loader_get_category_apps_finish_sync (GsPluginLoader *plugin_loader,
GsAppList *
gs_plugin_loader_get_category_apps (GsPluginLoader *plugin_loader,
GsCategory *category,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -420,7 +438,8 @@ gs_plugin_loader_get_category_apps (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_get_category_apps_async (plugin_loader,
category,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback)
gs_plugin_loader_get_category_apps_finish_sync,
&helper);
@@ -448,7 +467,8 @@ gs_plugin_loader_app_refine_finish_sync (GsPluginLoader *plugin_loader,
gboolean
gs_plugin_loader_app_refine (GsPluginLoader *plugin_loader,
GsApp *app,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -464,7 +484,8 @@ gs_plugin_loader_app_refine (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_app_refine_async (plugin_loader,
app,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_app_refine_finish_sync,
&helper);
@@ -493,6 +514,7 @@ gboolean
gs_plugin_loader_app_action (GsPluginLoader *plugin_loader,
GsApp *app,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -509,6 +531,7 @@ gs_plugin_loader_app_action (GsPluginLoader *plugin_loader,
gs_plugin_loader_app_action_async (plugin_loader,
app,
action,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_app_action_finish_sync,
&helper);
@@ -538,6 +561,7 @@ gs_plugin_loader_review_action (GsPluginLoader *plugin_loader,
GsApp *app,
AsReview *review,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -555,6 +579,7 @@ gs_plugin_loader_review_action (GsPluginLoader *plugin_loader,
app,
review,
action,
+ failure_flags,
cancellable,
(GAsyncReadyCallback)
gs_plugin_loader_review_action_finish_sync,
&helper);
@@ -583,6 +608,7 @@ gboolean
gs_plugin_loader_auth_action (GsPluginLoader *plugin_loader,
GsAuth *auth,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -599,6 +625,7 @@ gs_plugin_loader_auth_action (GsPluginLoader *plugin_loader,
gs_plugin_loader_auth_action_async (plugin_loader,
auth,
action,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_auth_action_finish_sync,
&helper);
@@ -626,7 +653,8 @@ gs_plugin_loader_refresh_finish_sync (GsPluginLoader *plugin_loader,
gboolean
gs_plugin_loader_refresh (GsPluginLoader *plugin_loader,
guint cache_age,
- GsPluginRefreshFlags flags,
+ GsPluginRefreshFlags refresh_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -642,7 +670,8 @@ gs_plugin_loader_refresh (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_refresh_async (plugin_loader,
cache_age,
- flags,
+ refresh_flags,
+ failure_flags,
cancellable,
(GAsyncReadyCallback) gs_plugin_loader_refresh_finish_sync,
&helper);
@@ -672,7 +701,8 @@ gs_plugin_loader_file_to_app_finish_sync (GObject *source_object,
GsApp *
gs_plugin_loader_file_to_app (GsPluginLoader *plugin_loader,
GFile *file,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -689,7 +719,8 @@ gs_plugin_loader_file_to_app (GsPluginLoader *plugin_loader,
/* run async method */
gs_plugin_loader_file_to_app_async (plugin_loader,
file,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
gs_plugin_loader_file_to_app_finish_sync,
&helper);
diff --git a/src/gs-plugin-loader-sync.h b/src/gs-plugin-loader-sync.h
index 8fd2abf..1fb6003 100644
--- a/src/gs-plugin-loader-sync.h
+++ b/src/gs-plugin-loader-sync.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
- * Copyright (C) 2007-2015 Richard Hughes <richard hughsie com>
+ * Copyright (C) 2007-2016 Richard Hughes <richard hughsie com>
*
* Licensed under the GNU General Public License Version 2
*
@@ -29,77 +29,92 @@
G_BEGIN_DECLS
GsAppList *gs_plugin_loader_get_installed (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsAppList *gs_plugin_loader_search (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsAppList *gs_plugin_loader_get_updates (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsAppList *gs_plugin_loader_get_distro_upgrades (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsAppList *gs_plugin_loader_get_sources (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsAppList *gs_plugin_loader_get_popular (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsAppList *gs_plugin_loader_get_featured (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GPtrArray *gs_plugin_loader_get_categories (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsAppList *gs_plugin_loader_get_category_apps (GsPluginLoader *plugin_loader,
GsCategory *category,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_loader_app_refine (GsPluginLoader *plugin_loader,
GsApp *app,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_loader_app_action (GsPluginLoader *plugin_loader,
GsApp *app,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_loader_review_action (GsPluginLoader *plugin_loader,
GsApp *app,
AsReview *review,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_loader_auth_action (GsPluginLoader *plugin_loader,
GsAuth *auth,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_loader_refresh (GsPluginLoader *plugin_loader,
guint cache_age,
- GsPluginRefreshFlags flags,
+ GsPluginRefreshFlags refresh_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
GsApp *gs_plugin_loader_get_app_by_id (GsPluginLoader *plugin_loader,
const gchar *id,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
GCancellable *cancellable,
GError **error);
GsApp *gs_plugin_loader_file_to_app (GsPluginLoader *plugin_loader,
GFile *file,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error);
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 5877ae5..6b53149 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -122,23 +122,23 @@ typedef gboolean (*GsPluginAuthFunc) (GsPlugin *plugin,
GError **error);
typedef gboolean (*GsPluginRefineFunc) (GsPlugin *plugin,
GsAppList *list,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginRefineAppFunc) (GsPlugin *plugin,
GsApp *app,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginRefineWildcardFunc) (GsPlugin *plugin,
GsApp *app,
GsAppList *list,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginRefreshFunc ) (GsPlugin *plugin,
guint cache_age,
- GsPluginRefreshFlags flags,
+ GsPluginRefreshFlags refresh_flags,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginFileToAppFunc) (GsPlugin *plugin,
@@ -158,7 +158,9 @@ typedef struct {
const gchar *function_name;
GsAppList *list;
GPtrArray *catlist;
- GsPluginRefineFlags flags;
+ GsPluginRefineFlags refine_flags;
+ GsPluginRefreshFlags refresh_flags;
+ GsPluginFailureFlags failure_flags;
gchar *value;
GFile *file;
guint cache_age;
@@ -387,7 +389,8 @@ gs_plugin_loader_run_refine_wildcard (GsPluginLoader *plugin_loader,
GsPlugin *plugin,
GsApp *app,
GsAppList *list,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable)
{
GsPluginRefineWildcardFunc plugin_func = NULL;
@@ -403,7 +406,7 @@ gs_plugin_loader_run_refine_wildcard (GsPluginLoader *plugin_loader,
return;
gs_plugin_loader_action_start (plugin_loader, plugin, FALSE);
- ret = plugin_func (plugin, app, list, flags,
+ ret = plugin_func (plugin, app, list, refine_flags,
cancellable, &error_local);
gs_plugin_loader_action_stop (plugin_loader, plugin);
if (!ret) {
@@ -414,15 +417,17 @@ gs_plugin_loader_run_refine_wildcard (GsPluginLoader *plugin_loader,
function_name);
return;
}
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ GS_PLUGIN_ACTION_REFINE,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
g_warning ("failed to call %s on %s: %s",
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- GS_PLUGIN_ACTION_REFINE,
- plugin,
- NULL, /* app */
- error_local);
}
}
@@ -431,7 +436,8 @@ gs_plugin_loader_run_refine_app (GsPluginLoader *plugin_loader,
GsPlugin *plugin,
GsApp *app,
GsAppList *list,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable)
{
GsPluginRefineAppFunc plugin_func = NULL;
@@ -446,8 +452,8 @@ gs_plugin_loader_run_refine_app (GsPluginLoader *plugin_loader,
return;
gs_plugin_loader_action_start (plugin_loader, plugin, FALSE);
- ret = plugin_func (plugin, app, flags,
- cancellable, &error_local);
+ ret = plugin_func (plugin, app, refine_flags,
+ cancellable, &error_local);
gs_plugin_loader_action_stop (plugin_loader, plugin);
if (!ret) {
/* badly behaved plugin */
@@ -457,15 +463,17 @@ gs_plugin_loader_run_refine_app (GsPluginLoader *plugin_loader,
function_name);
return;
}
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ GS_PLUGIN_ACTION_REFINE,
+ plugin,
+ app,
+ error_local);
+ }
g_warning ("failed to call %s on %s: %s",
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- GS_PLUGIN_ACTION_REFINE,
- plugin,
- app,
- error_local);
}
}
@@ -474,7 +482,8 @@ static gboolean
gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
const gchar *function_name_parent,
GsAppList *list,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -489,10 +498,10 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
gboolean ret = TRUE;
/* this implies the other */
- if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_UI)
- flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN;
- if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME)
- flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN;
+ if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_UI)
+ refine_flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN;
+ if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME)
+ refine_flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN;
/* try to adopt each application with a plugin */
gs_plugin_loader_run_adopt (plugin_loader, list);
@@ -532,7 +541,7 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
gboolean ret_local;
gs_plugin_loader_action_start (plugin_loader, plugin, FALSE);
- ret_local = plugin_func (plugin, list, flags,
+ ret_local = plugin_func (plugin, list, refine_flags,
cancellable, &error_local);
gs_plugin_loader_action_stop (plugin_loader, plugin);
if (!ret_local) {
@@ -547,11 +556,13 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- GS_PLUGIN_ACTION_REFINE,
- plugin,
- NULL, /* app */
- error_local);
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ GS_PLUGIN_ACTION_REFINE,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
continue;
}
}
@@ -562,7 +573,8 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
plugin,
app,
list,
- flags,
+ refine_flags,
+ failure_flags,
cancellable);
continue;
}
@@ -570,14 +582,15 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
plugin,
app,
list,
- flags,
+ refine_flags,
+ failure_flags,
cancellable);
}
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
}
/* ensure these are sorted by score */
- if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS) > 0) {
+ if ((refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS) > 0) {
GPtrArray *reviews;
for (i = 0; i < gs_app_list_length (list); i++) {
app = gs_app_list_index (list, i);
@@ -588,12 +601,12 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
}
/* refine addons one layer deep */
- if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS) > 0) {
+ if ((refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS) > 0) {
g_autoptr(GsAppList) addons_list = NULL;
- flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS;
- flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS;
- flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS;
+ refine_flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS;
+ refine_flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS;
+ refine_flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS;
addons_list = gs_app_list_new ();
for (i = 0; i < gs_app_list_length (list); i++) {
app = gs_app_list_index (list, i);
@@ -610,7 +623,8 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
ret = gs_plugin_loader_run_refine_internal (plugin_loader,
function_name_parent,
addons_list,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
error);
if (!ret)
@@ -619,7 +633,7 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
}
/* also do runtime */
- if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED) > 0) {
+ if ((refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED) > 0) {
g_autoptr(GsAppList) list2 = gs_app_list_new ();
for (i = 0; i < gs_app_list_length (list); i++) {
GsApp *runtime;
@@ -632,7 +646,8 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
ret = gs_plugin_loader_run_refine_internal (plugin_loader,
function_name_parent,
list2,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
error);
if (!ret)
@@ -641,10 +656,10 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
}
/* also do related packages one layer deep */
- if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED) > 0) {
+ if ((refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED) > 0) {
g_autoptr(GsAppList) related_list = NULL;
- flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED;
+ refine_flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED;
related_list = gs_app_list_new ();
for (i = 0; i < gs_app_list_length (list); i++) {
app = gs_app_list_index (list, i);
@@ -661,7 +676,8 @@ gs_plugin_loader_run_refine_internal (GsPluginLoader *plugin_loader,
ret = gs_plugin_loader_run_refine_internal (plugin_loader,
function_name_parent,
related_list,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
error);
if (!ret)
@@ -677,7 +693,8 @@ static gboolean
gs_plugin_loader_run_refine (GsPluginLoader *plugin_loader,
const gchar *function_name_parent,
GsAppList *list,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -701,7 +718,8 @@ gs_plugin_loader_run_refine (GsPluginLoader *plugin_loader,
ret = gs_plugin_loader_run_refine_internal (plugin_loader,
function_name_parent,
list,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
error);
if (!ret)
@@ -720,7 +738,8 @@ gs_plugin_loader_run_refine (GsPluginLoader *plugin_loader,
ret = gs_plugin_loader_run_refine_internal (plugin_loader,
function_name_parent,
list,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
error);
if (!ret)
@@ -740,7 +759,8 @@ static GsAppList *
gs_plugin_loader_run_results (GsPluginLoader *plugin_loader,
GsPluginAction action,
const gchar *function_name,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -799,15 +819,17 @@ gs_plugin_loader_run_results (GsPluginLoader *plugin_loader,
function_name);
continue;
}
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ action,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
g_warning ("failed to call %s on %s: %s",
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- action,
- plugin,
- NULL, /* app */
- error_local);
continue;
}
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
@@ -817,7 +839,8 @@ gs_plugin_loader_run_results (GsPluginLoader *plugin_loader,
ret = gs_plugin_loader_run_refine (plugin_loader,
function_name,
list,
- flags,
+ refine_flags,
+ failure_flags,
cancellable,
error);
if (!ret)
@@ -949,7 +972,7 @@ gs_plugin_loader_app_is_valid (GsApp *app, gpointer user_data)
}
/* don't show unconverted packages in the application view */
- if (((state->flags & GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES) == 0) &&
+ if (((state->refine_flags & GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES) == 0) &&
(gs_app_get_kind (app) == AS_APP_KIND_GENERIC)) {
// g_debug ("app invalid as only a %s: %s",
// as_app_kind_to_string (gs_app_get_kind (app)),
@@ -1088,6 +1111,7 @@ gs_plugin_loader_run_action (GsPluginLoader *plugin_loader,
GsApp *app,
GsPluginAction action,
const gchar *function_name,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -1133,21 +1157,23 @@ gs_plugin_loader_run_action (GsPluginLoader *plugin_loader,
}
/* abort early to allow main thread to process */
- if (gs_plugin_loader_is_auth_error (error_local)) {
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL ||
+ gs_plugin_loader_is_auth_error (error_local)) {
g_propagate_error (error, error_local);
error_local = NULL;
return FALSE;
}
-
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ action,
+ plugin,
+ app,
+ error_local);
+ }
g_warning ("failed to call %s on %s: %s",
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- action,
- plugin,
- app,
- error_local);
continue;
}
anything_ran = TRUE;
@@ -1244,11 +1270,12 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
gboolean ret;
/* do things that would block */
- if ((state->flags & GS_PLUGIN_REFINE_FLAGS_USE_HISTORY) > 0) {
+ if ((state->refine_flags & GS_PLUGIN_REFINE_FLAGS_USE_HISTORY) > 0) {
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_updates_historical",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1260,7 +1287,8 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_updates",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1274,7 +1302,8 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_updates_pending",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1291,6 +1320,7 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
"gs_plugin_add_updates_*",
state->list,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -1337,7 +1367,8 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
**/
void
gs_plugin_loader_get_updates_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1350,7 +1381,8 @@ gs_plugin_loader_get_updates_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_GET_UPDATES;
/* run in a thread */
@@ -1393,7 +1425,8 @@ gs_plugin_loader_get_distro_upgrades_thread_cb (GTask *task,
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_distro_upgrades",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1417,7 +1450,8 @@ gs_plugin_loader_get_distro_upgrades_thread_cb (GTask *task,
**/
void
gs_plugin_loader_get_distro_upgrades_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1430,7 +1464,8 @@ gs_plugin_loader_get_distro_upgrades_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_GET_DISTRO_UPDATES;
/* run in a thread */
@@ -1473,7 +1508,8 @@ gs_plugin_loader_get_unvoted_reviews_thread_cb (GTask *task,
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_unvoted_reviews",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1497,7 +1533,8 @@ gs_plugin_loader_get_unvoted_reviews_thread_cb (GTask *task,
**/
void
gs_plugin_loader_get_unvoted_reviews_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1510,7 +1547,8 @@ gs_plugin_loader_get_unvoted_reviews_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_GET_UNVOTED_REVIEWS;
/* run in a thread */
@@ -1553,7 +1591,8 @@ gs_plugin_loader_get_sources_thread_cb (GTask *task,
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_sources",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1580,7 +1619,8 @@ gs_plugin_loader_get_sources_thread_cb (GTask *task,
**/
void
gs_plugin_loader_get_sources_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1593,7 +1633,8 @@ gs_plugin_loader_get_sources_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_GET_SOURCES;
/* run in a thread */
@@ -1637,7 +1678,8 @@ gs_plugin_loader_get_installed_thread_cb (GTask *task,
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_installed",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1676,7 +1718,8 @@ gs_plugin_loader_get_installed_thread_cb (GTask *task,
**/
void
gs_plugin_loader_get_installed_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1689,7 +1732,8 @@ gs_plugin_loader_get_installed_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_GET_INSTALLED;
/* run in a thread */
@@ -1751,7 +1795,8 @@ gs_plugin_loader_get_popular_thread_cb (GTask *task,
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_popular",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1775,7 +1820,8 @@ gs_plugin_loader_get_popular_thread_cb (GTask *task,
void
gs_plugin_loader_get_popular_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1788,7 +1834,8 @@ gs_plugin_loader_get_popular_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_GET_POPULAR;
/* run in a thread */
@@ -1841,7 +1888,8 @@ gs_plugin_loader_get_featured_thread_cb (GTask *task,
state->list = gs_plugin_loader_run_results (plugin_loader,
state->action,
"gs_plugin_add_featured",
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (error != NULL) {
@@ -1888,7 +1936,8 @@ gs_plugin_loader_get_featured_thread_cb (GTask *task,
**/
void
gs_plugin_loader_get_featured_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -1901,7 +1950,8 @@ gs_plugin_loader_get_featured_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_GET_FEATURED;
/* run in a thread */
@@ -2058,7 +2108,8 @@ gs_plugin_loader_search_thread_cb (GTask *task,
ret = gs_plugin_loader_run_refine (plugin_loader,
function_name,
state->list,
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -2115,7 +2166,8 @@ gs_plugin_loader_search_thread_cb (GTask *task,
void
gs_plugin_loader_search_async (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -2128,7 +2180,8 @@ gs_plugin_loader_search_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->list = gs_app_list_new ();
state->value = g_strdup (value);
state->action = GS_PLUGIN_ACTION_SEARCH;
@@ -2224,7 +2277,8 @@ gs_plugin_loader_search_files_thread_cb (GTask *task,
ret = gs_plugin_loader_run_refine (plugin_loader,
function_name,
state->list,
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -2282,7 +2336,8 @@ gs_plugin_loader_search_files_thread_cb (GTask *task,
void
gs_plugin_loader_search_files_async (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -2295,7 +2350,8 @@ gs_plugin_loader_search_files_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->list = gs_app_list_new ();
state->value = g_strdup (value);
state->action = GS_PLUGIN_ACTION_SEARCH_FILES;
@@ -2391,7 +2447,8 @@ gs_plugin_loader_search_what_provides_thread_cb (GTask *task,
ret = gs_plugin_loader_run_refine (plugin_loader,
function_name,
state->list,
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -2449,7 +2506,8 @@ gs_plugin_loader_search_what_provides_thread_cb (GTask *task,
void
gs_plugin_loader_search_what_provides_async (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -2462,7 +2520,8 @@ gs_plugin_loader_search_what_provides_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->list = gs_app_list_new ();
state->value = g_strdup (value);
state->action = GS_PLUGIN_ACTION_SEARCH_PROVIDES;
@@ -2590,11 +2649,13 @@ gs_plugin_loader_get_categories_thread_cb (GTask *task,
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- state->action,
- plugin,
- NULL, /* app */
- error_local);
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ state->action,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
continue;
}
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
@@ -2634,7 +2695,8 @@ gs_plugin_loader_get_categories_thread_cb (GTask *task,
**/
void
gs_plugin_loader_get_categories_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -2647,7 +2709,8 @@ gs_plugin_loader_get_categories_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->catlist = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
state->action = GS_PLUGIN_ACTION_GET_CATEGORIES;
@@ -2725,15 +2788,24 @@ gs_plugin_loader_get_category_apps_thread_cb (GTask *task,
function_name);
continue;
}
+
+ /* abort early to allow main thread to process */
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL) {
+ g_task_return_error (task, error_local);
+ error_local = NULL;
+ return;
+ }
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ state->action,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
g_warning ("failed to call %s on %s: %s",
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- state->action,
- plugin,
- NULL, /* app */
- error_local);
continue;
}
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
@@ -2743,7 +2815,8 @@ gs_plugin_loader_get_category_apps_thread_cb (GTask *task,
ret = gs_plugin_loader_run_refine (plugin_loader,
function_name,
state->list,
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -2792,7 +2865,8 @@ gs_plugin_loader_get_category_apps_thread_cb (GTask *task,
void
gs_plugin_loader_get_category_apps_async (GsPluginLoader *plugin_loader,
GsCategory *category,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -2805,7 +2879,8 @@ gs_plugin_loader_get_category_apps_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->list = gs_app_list_new ();
state->category = g_object_ref (category);
state->action = GS_PLUGIN_ACTION_GET_CATEGORY_APPS;
@@ -2854,7 +2929,8 @@ gs_plugin_loader_app_refine_thread_cb (GTask *task,
ret = gs_plugin_loader_run_refine (plugin_loader,
NULL,
list,
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -2877,7 +2953,8 @@ out:
void
gs_plugin_loader_app_refine_async (GsPluginLoader *plugin_loader,
GsApp *app,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -2892,12 +2969,13 @@ gs_plugin_loader_app_refine_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
state->app = g_object_ref (app);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->action = GS_PLUGIN_ACTION_REFINE;
/* enforce this */
- if (state->flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS)
- state->flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON;
+ if (state->refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS)
+ state->refine_flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON;
/* run in a thread */
task = g_task_new (plugin_loader, cancellable, callback, user_data);
@@ -2960,6 +3038,7 @@ gs_plugin_loader_app_action_thread_cb (GTask *task,
state->app,
state->action,
state->function_name,
+ state->failure_flags,
cancellable,
&error);
if (ret) {
@@ -2978,6 +3057,7 @@ gs_plugin_loader_app_action_thread_cb (GTask *task,
state->function_name,
list,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN,
+ state->failure_flags,
cancellable,
&error);
if (ret) {
@@ -3063,20 +3143,22 @@ gs_plugin_loader_review_action_thread_cb (GTask *task,
}
/* abort early to allow main thread to process */
- if (gs_plugin_loader_is_auth_error (error_local)) {
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL) {
g_task_return_error (task, error_local);
error_local = NULL;
return;
}
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ state->action,
+ plugin,
+ state->app,
+ error_local);
+ }
g_warning ("failed to call %s on %s: %s",
state->function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- state->action,
- plugin,
- state->app,
- error_local);
continue;
}
anything_ran = TRUE;
@@ -3151,6 +3233,7 @@ load_install_queue (GsPluginLoader *plugin_loader, GError **error)
NULL,
list,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
NULL, //FIXME?
error);
if (!ret)
@@ -3266,6 +3349,7 @@ void
gs_plugin_loader_app_action_async (GsPluginLoader *plugin_loader,
GsApp *app,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -3283,6 +3367,7 @@ gs_plugin_loader_app_action_async (GsPluginLoader *plugin_loader,
g_autoptr(GsAppList) list = gs_app_list_new ();
gs_app_list_add (list, app);
gs_plugin_loader_update_async (plugin_loader, list,
+ failure_flags,
cancellable, callback,
user_data);
return;
@@ -3353,6 +3438,7 @@ gs_plugin_loader_review_action_async (GsPluginLoader *plugin_loader,
GsApp *app,
AsReview *review,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -3369,6 +3455,7 @@ gs_plugin_loader_review_action_async (GsPluginLoader *plugin_loader,
state->app = g_object_ref (app);
state->review = g_object_ref (review);
state->action = action;
+ state->failure_flags = failure_flags;
switch (action) {
case GS_PLUGIN_ACTION_REVIEW_SUBMIT:
@@ -3465,10 +3552,24 @@ gs_plugin_loader_auth_action_thread_cb (GTask *task,
continue;
}
- /* stop running other plugins on failure */
- g_task_return_error (task, error_local);
- error_local = NULL;
- return;
+ /* abort early to allow main thread to process */
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL) {
+ g_task_return_error (task, error_local);
+ error_local = NULL;
+ return;
+ }
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ state->action,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
+ g_warning ("failed to call %s on %s: %s",
+ state->function_name,
+ gs_plugin_get_name (plugin),
+ error_local->message);
+ continue;
}
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
}
@@ -3480,6 +3581,7 @@ void
gs_plugin_loader_auth_action_async (GsPluginLoader *plugin_loader,
GsAuth *auth,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -3495,6 +3597,7 @@ gs_plugin_loader_auth_action_async (GsPluginLoader *plugin_loader,
state = g_slice_new0 (GsPluginLoaderAsyncState);
state->auth = g_object_ref (auth);
state->action = action;
+ state->failure_flags = failure_flags;
switch (action) {
case GS_PLUGIN_ACTION_AUTH_LOGIN:
@@ -3959,6 +4062,7 @@ gboolean
gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
gchar **whitelist,
gchar **blacklist,
+ GsPluginFailureFlags failure_flags,
GError **error)
{
GsPluginLoaderPrivate *priv = gs_plugin_loader_get_instance_private (plugin_loader);
@@ -4199,16 +4303,18 @@ gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
g_critical ("%s did not set error for %s",
gs_plugin_get_name (plugin),
function_name);
- } else {
- g_debug ("disabling %s as setup failed: %s",
- gs_plugin_get_name (plugin),
- error_local->message);
+ continue;
+ }
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
gs_plugin_loader_create_event_from_error (plugin_loader,
GS_PLUGIN_ACTION_SETUP,
plugin,
NULL, /* app */
error_local);
}
+ g_debug ("disabling %s as setup failed: %s",
+ gs_plugin_get_name (plugin),
+ error_local->message);
gs_plugin_set_enabled (plugin, FALSE);
}
}
@@ -4515,6 +4621,7 @@ gs_plugin_loader_set_network_status (GsPluginLoader *plugin_loader,
gs_plugin_loader_app_action_async (plugin_loader,
app,
GS_PLUGIN_ACTION_INSTALL,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
NULL,
gs_plugin_loader_app_installed_cb,
g_object_ref (app));
@@ -4526,7 +4633,8 @@ gs_plugin_loader_set_network_status (GsPluginLoader *plugin_loader,
static gboolean
gs_plugin_loader_run_refresh (GsPluginLoader *plugin_loader,
guint cache_age,
- GsPluginRefreshFlags flags,
+ GsPluginRefreshFlags refresh_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GError **error)
{
@@ -4562,7 +4670,7 @@ gs_plugin_loader_run_refresh (GsPluginLoader *plugin_loader,
function_name);
g_assert (ptask != NULL);
gs_plugin_loader_action_start (plugin_loader, plugin, TRUE);
- ret = plugin_func (plugin, cache_age, flags, cancellable, &error_local);
+ ret = plugin_func (plugin, cache_age, refresh_flags, cancellable, &error_local);
gs_plugin_loader_action_stop (plugin_loader, plugin);
if (!ret) {
/* badly behaved plugin */
@@ -4572,11 +4680,12 @@ gs_plugin_loader_run_refresh (GsPluginLoader *plugin_loader,
function_name);
continue;
}
- if (flags & GS_PLUGIN_REFRESH_FLAGS_INTERACTIVE) {
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL) {
g_propagate_error (error, error_local);
error_local = NULL;
return FALSE;
- } else {
+ }
+ if (failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
gs_plugin_loader_create_event_from_error (plugin_loader,
GS_PLUGIN_ACTION_REFRESH,
plugin,
@@ -4617,7 +4726,8 @@ gs_plugin_loader_refresh_thread_cb (GTask *task,
ret = gs_plugin_loader_run_refresh (plugin_loader,
state->cache_age,
- state->flags,
+ state->refresh_flags,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -4639,7 +4749,8 @@ gs_plugin_loader_refresh_thread_cb (GTask *task,
void
gs_plugin_loader_refresh_async (GsPluginLoader *plugin_loader,
guint cache_age,
- GsPluginRefreshFlags flags,
+ GsPluginRefreshFlags refresh_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -4652,7 +4763,8 @@ gs_plugin_loader_refresh_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refresh_flags = refresh_flags;
+ state->failure_flags = failure_flags;
state->cache_age = cache_age;
state->action = GS_PLUGIN_ACTION_REFRESH;
@@ -4747,11 +4859,13 @@ gs_plugin_loader_file_to_app_thread_cb (GTask *task,
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- state->action,
- plugin,
- NULL, /* app */
- error_local);
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ state->action,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
continue;
}
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
@@ -4768,7 +4882,8 @@ gs_plugin_loader_file_to_app_thread_cb (GTask *task,
ret = gs_plugin_loader_run_refine (plugin_loader,
function_name,
state->list,
- state->flags,
+ state->refine_flags,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -4801,6 +4916,7 @@ gs_plugin_loader_file_to_app_thread_cb (GTask *task,
function_name,
state->list,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ state->failure_flags,
cancellable,
&error);
if (!ret) {
@@ -4838,7 +4954,8 @@ gs_plugin_loader_file_to_app_thread_cb (GTask *task,
void
gs_plugin_loader_file_to_app_async (GsPluginLoader *plugin_loader,
GFile *file,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -4851,7 +4968,8 @@ gs_plugin_loader_file_to_app_async (GsPluginLoader *plugin_loader,
/* save state */
state = g_slice_new0 (GsPluginLoaderAsyncState);
- state->flags = flags;
+ state->refine_flags = refine_flags;
+ state->failure_flags = failure_flags;
state->list = gs_app_list_new ();
state->file = g_object_ref (file);
state->action = GS_PLUGIN_ACTION_FILE_TO_APP;
@@ -4932,11 +5050,13 @@ gs_plugin_loader_update_thread_cb (GTask *task,
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- state->action,
- plugin,
- NULL, /* app */
- error_local);
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ state->action,
+ plugin,
+ NULL, /* app */
+ error_local);
+ }
continue;
}
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_FINISHED);
@@ -4988,11 +5108,13 @@ gs_plugin_loader_update_thread_cb (GTask *task,
function_name,
gs_plugin_get_name (plugin),
error_local->message);
- gs_plugin_loader_create_event_from_error (plugin_loader,
- state->action,
- plugin,
- app,
- error_local);
+ if (state->failure_flags & GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS) {
+ gs_plugin_loader_create_event_from_error (plugin_loader,
+ state->action,
+ plugin,
+ app,
+ error_local);
+ }
continue;
}
}
@@ -5011,6 +5133,7 @@ gs_plugin_loader_update_thread_cb (GTask *task,
void
gs_plugin_loader_update_async (GsPluginLoader *plugin_loader,
GsAppList *apps,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -5025,6 +5148,7 @@ gs_plugin_loader_update_async (GsPluginLoader *plugin_loader,
state = g_slice_new0 (GsPluginLoaderAsyncState);
state->list = gs_app_list_copy (apps);
state->action = GS_PLUGIN_ACTION_UPDATE;
+ state->failure_flags = failure_flags;
/* run in a thread */
task = g_task_new (plugin_loader, cancellable, callback, user_data);
diff --git a/src/gs-plugin-loader.h b/src/gs-plugin-loader.h
index 9049d8e..2c2c4e1 100644
--- a/src/gs-plugin-loader.h
+++ b/src/gs-plugin-loader.h
@@ -53,7 +53,8 @@ typedef void (*GsPluginLoaderFinishedFunc) (GsPluginLoader *plugin_loader,
GsPluginLoader *gs_plugin_loader_new (void);
void gs_plugin_loader_get_installed_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -61,7 +62,8 @@ GsAppList *gs_plugin_loader_get_installed_finish (GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error);
void gs_plugin_loader_get_updates_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -69,7 +71,8 @@ GsAppList *gs_plugin_loader_get_updates_finish (GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error);
void gs_plugin_loader_get_distro_upgrades_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -77,7 +80,8 @@ GsAppList *gs_plugin_loader_get_distro_upgrades_finish (GsPluginLoader *plugin_l
GAsyncResult *res,
GError **error);
void gs_plugin_loader_get_unvoted_reviews_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -85,7 +89,8 @@ GsAppList *gs_plugin_loader_get_unvoted_reviews_finish (GsPluginLoader *plugin_l
GAsyncResult *res,
GError **error);
void gs_plugin_loader_get_sources_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -93,7 +98,8 @@ GsAppList *gs_plugin_loader_get_sources_finish (GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error);
void gs_plugin_loader_get_popular_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -101,7 +107,8 @@ GsAppList *gs_plugin_loader_get_popular_finish (GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error);
void gs_plugin_loader_get_featured_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -109,7 +116,8 @@ GsAppList *gs_plugin_loader_get_featured_finish (GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error);
void gs_plugin_loader_get_categories_async (GsPluginLoader *plugin_loader,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -118,7 +126,8 @@ GPtrArray *gs_plugin_loader_get_categories_finish (GsPluginLoader *plugin_loader
GError **error);
void gs_plugin_loader_get_category_apps_async (GsPluginLoader *plugin_loader,
GsCategory *category,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -127,7 +136,8 @@ GsAppList *gs_plugin_loader_get_category_apps_finish (GsPluginLoader *plugin_loa
GError **error);
void gs_plugin_loader_search_async (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -136,7 +146,8 @@ GsAppList *gs_plugin_loader_search_finish (GsPluginLoader *plugin_loader,
GError **error);
void gs_plugin_loader_search_files_async (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -145,7 +156,8 @@ GsAppList *gs_plugin_loader_search_files_finish (GsPluginLoader *plugin_loader,
GError **error);
void gs_plugin_loader_search_what_provides_async (GsPluginLoader *plugin_loader,
const gchar *value,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -154,7 +166,8 @@ GsAppList *gs_plugin_loader_search_what_provides_finish (GsPluginLoader *plugin_
GError **error);
void gs_plugin_loader_file_to_app_async (GsPluginLoader *plugin_loader,
GFile *file,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -163,6 +176,7 @@ GsApp *gs_plugin_loader_file_to_app_finish (GsPluginLoader
*plugin_loader,
GError **error);
void gs_plugin_loader_update_async (GsPluginLoader *plugin_loader,
GsAppList *apps,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -172,6 +186,7 @@ gboolean gs_plugin_loader_update_finish (GsPluginLoader *plugin_loader,
gboolean gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
gchar **whitelist,
gchar **blacklist,
+ GsPluginFailureFlags failure_flags,
GError **error);
void gs_plugin_loader_dump_state (GsPluginLoader *plugin_loader);
gboolean gs_plugin_loader_get_enabled (GsPluginLoader *plugin_loader,
@@ -185,7 +200,8 @@ void gs_plugin_loader_set_scale (GsPluginLoader
*plugin_loader,
guint scale);
void gs_plugin_loader_app_refine_async (GsPluginLoader *plugin_loader,
GsApp *app,
- GsPluginRefineFlags flags,
+ GsPluginRefineFlags refine_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -195,6 +211,7 @@ gboolean gs_plugin_loader_app_refine_finish (GsPluginLoader *plugin_loader,
void gs_plugin_loader_app_action_async (GsPluginLoader *plugin_loader,
GsApp *app,
GsPluginAction a,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -208,6 +225,7 @@ void gs_plugin_loader_review_action_async (GsPluginLoader
*plugin_loader,
GsApp *app,
AsReview *review,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -217,6 +235,7 @@ gboolean gs_plugin_loader_auth_action_finish (GsPluginLoader *plugin_loader,
void gs_plugin_loader_auth_action_async (GsPluginLoader *plugin_loader,
GsAuth *auth,
GsPluginAction action,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -225,7 +244,8 @@ gboolean gs_plugin_loader_refresh_finish (GsPluginLoader *plugin_loader,
GError **error);
void gs_plugin_loader_refresh_async (GsPluginLoader *plugin_loader,
guint cache_age,
- GsPluginRefreshFlags flags,
+ GsPluginRefreshFlags refresh_flags,
+ GsPluginFailureFlags failure_flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
diff --git a/src/gs-plugin-types.h b/src/gs-plugin-types.h
index b4f6d42..6b096cf 100644
--- a/src/gs-plugin-types.h
+++ b/src/gs-plugin-types.h
@@ -300,6 +300,26 @@ typedef enum {
GS_PLUGIN_ACTION_LAST
} GsPluginAction;
+/**
+ * GsPluginFailureFlags:
+ * @GS_PLUGIN_FAILURE_FLAGS_NONE: No flags set
+ * @GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS: Report errors out-of-band
+ * @GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL: Abort after the first plugin error
+ *
+ * The failure flags for the plugin action.
+ *
+ * When %GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS is specified plugin errors are not
+ * treated as fatal errors and are reported to the in-app notification system
+ * where they may or may not be shown depending on policy.
+ **/
+typedef enum {
+ GS_PLUGIN_FAILURE_FLAGS_NONE = 0,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS = 1 << 0,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL = 1 << 1,
+ /*< private >*/
+ GS_PLUGIN_FAILURE_FLAGS_LAST
+} GsPluginFailureFlags;
+
G_END_DECLS
#endif /* __GS_PLUGIN_TYPES_H */
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index 3f2a494..c61b4d1 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -390,6 +390,7 @@ gs_plugin_loader_install_func (GsPluginLoader *plugin_loader)
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
ret = gs_plugin_loader_app_action (plugin_loader, app,
GS_PLUGIN_ACTION_INSTALL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -400,6 +401,7 @@ gs_plugin_loader_install_func (GsPluginLoader *plugin_loader)
* but dummy::refine() sets it */
ret = gs_plugin_loader_app_action (plugin_loader, app,
GS_PLUGIN_ACTION_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -430,6 +432,7 @@ gs_plugin_loader_error_func (GsPluginLoader *plugin_loader)
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
ret = gs_plugin_loader_app_action (plugin_loader, app,
GS_PLUGIN_ACTION_UPDATE,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
NULL,
&error);
g_assert_no_error (error);
@@ -475,6 +478,7 @@ gs_plugin_loader_refine_func (GsPluginLoader *plugin_loader)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_URL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -498,6 +502,7 @@ gs_plugin_loader_key_colors_func (GsPluginLoader *plugin_loader)
app = gs_app_new ("zeus.desktop");
ret = gs_plugin_loader_app_refine (plugin_loader, app,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_KEY_COLORS,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -529,6 +534,7 @@ gs_plugin_loader_updates_func (GsPluginLoader *plugin_loader)
/* get the updates list */
list = gs_plugin_loader_get_updates (plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -564,6 +570,7 @@ gs_plugin_loader_distro_upgrades_func (GsPluginLoader *plugin_loader)
/* get the updates list */
list = gs_plugin_loader_get_distro_upgrades (plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -583,6 +590,7 @@ gs_plugin_loader_distro_upgrades_func (GsPluginLoader *plugin_loader)
ret = gs_plugin_loader_app_action (plugin_loader,
app,
GS_PLUGIN_ACTION_UPGRADE_DOWNLOAD,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -593,6 +601,7 @@ gs_plugin_loader_distro_upgrades_func (GsPluginLoader *plugin_loader)
ret = gs_plugin_loader_app_action (plugin_loader,
app,
GS_PLUGIN_ACTION_UPGRADE_TRIGGER,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -619,6 +628,7 @@ gs_plugin_loader_installed_func (GsPluginLoader *plugin_loader)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_MENU_PATH |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -677,6 +687,7 @@ gs_plugin_loader_search_func (GsPluginLoader *plugin_loader)
list = gs_plugin_loader_search (plugin_loader,
"spell",
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -701,6 +712,7 @@ gs_plugin_loader_modalias_func (GsPluginLoader *plugin_loader)
list = gs_plugin_loader_search (plugin_loader,
"colorhug2",
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -731,6 +743,7 @@ gs_plugin_loader_webapps_func (GsPluginLoader *plugin_loader)
gs_app_set_kind (app, AS_APP_KIND_WEB_APP);
ret = gs_plugin_loader_app_refine (plugin_loader, app,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -758,6 +771,7 @@ gs_plugin_loader_dpkg_func (GsPluginLoader *plugin_loader)
app = gs_plugin_loader_file_to_app (plugin_loader,
file,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -793,6 +807,7 @@ gs_plugin_loader_packagekit_local_func (GsPluginLoader *plugin_loader)
app = gs_plugin_loader_file_to_app (plugin_loader,
file,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -827,6 +842,7 @@ gs_plugin_loader_fwupd_func (GsPluginLoader *plugin_loader)
app = gs_plugin_loader_file_to_app (plugin_loader,
file,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -863,6 +879,7 @@ gs_plugin_loader_repos_func (GsPluginLoader *plugin_loader)
gs_app_set_origin (app, "utopia");
ret = gs_plugin_loader_app_refine (plugin_loader, app,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -896,6 +913,7 @@ gs_plugin_loader_flatpak_repo_func (GsPluginLoader *plugin_loader)
app = gs_plugin_loader_file_to_app (plugin_loader,
file,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -916,6 +934,7 @@ gs_plugin_loader_flatpak_repo_func (GsPluginLoader *plugin_loader)
/* now install the remote */
ret = gs_plugin_loader_app_action (plugin_loader, app,
GS_PLUGIN_ACTION_INSTALL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -943,6 +962,7 @@ gs_plugin_loader_flatpak_repo_func (GsPluginLoader *plugin_loader)
app2 = gs_plugin_loader_file_to_app (plugin_loader,
file,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -952,6 +972,7 @@ gs_plugin_loader_flatpak_repo_func (GsPluginLoader *plugin_loader)
/* remove it */
ret = gs_plugin_loader_app_action (plugin_loader, app,
GS_PLUGIN_ACTION_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1020,6 +1041,7 @@ gs_plugin_loader_flatpak_func (GsPluginLoader *plugin_loader)
gs_app_set_metadata (app_source, "flatpak::url", testdir_repourl);
ret = gs_plugin_loader_app_action (plugin_loader, app_source,
GS_PLUGIN_ACTION_INSTALL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1037,6 +1059,7 @@ gs_plugin_loader_flatpak_func (GsPluginLoader *plugin_loader)
/* check the source now exists */
sources = gs_plugin_loader_get_sources (plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1050,6 +1073,7 @@ gs_plugin_loader_flatpak_func (GsPluginLoader *plugin_loader)
ret = gs_plugin_loader_refresh (plugin_loader,
G_MAXUINT,
GS_PLUGIN_REFRESH_FLAGS_METADATA,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1061,6 +1085,7 @@ gs_plugin_loader_flatpak_func (GsPluginLoader *plugin_loader)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1082,6 +1107,7 @@ gs_plugin_loader_flatpak_func (GsPluginLoader *plugin_loader)
/* install, also installing runtime */
ret = gs_plugin_loader_app_action (plugin_loader, app,
GS_PLUGIN_ACTION_INSTALL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1129,6 +1155,7 @@ gs_plugin_loader_flatpak_func (GsPluginLoader *plugin_loader)
/* remove the application */
ret = gs_plugin_loader_app_action (plugin_loader, app,
GS_PLUGIN_ACTION_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1150,6 +1177,7 @@ gs_plugin_loader_plugin_cache_func (GsPluginLoader *plugin_loader)
/* ensure we get the same results back from calling the methods twice */
list1 = gs_plugin_loader_get_distro_upgrades (plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1159,6 +1187,7 @@ gs_plugin_loader_plugin_cache_func (GsPluginLoader *plugin_loader)
list2 = gs_plugin_loader_get_distro_upgrades (plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1189,6 +1218,7 @@ gs_plugin_loader_authentication_func (GsPluginLoader *plugin_loader)
/* do an action that returns a URL */
ret = gs_plugin_loader_auth_action (plugin_loader, auth,
GS_PLUGIN_ACTION_AUTH_REGISTER,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL, &error);
g_assert_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_AUTH_INVALID);
g_assert (!ret);
@@ -1200,6 +1230,7 @@ gs_plugin_loader_authentication_func (GsPluginLoader *plugin_loader)
review = as_review_new ();
ret = gs_plugin_loader_review_action (plugin_loader, app, review,
GS_PLUGIN_ACTION_REVIEW_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL, &error);
g_assert_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_AUTH_REQUIRED);
g_assert (!ret);
@@ -1208,6 +1239,7 @@ gs_plugin_loader_authentication_func (GsPluginLoader *plugin_loader)
/* pretend to auth with no credentials */
ret = gs_plugin_loader_auth_action (plugin_loader, auth,
GS_PLUGIN_ACTION_AUTH_LOGIN,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL, &error);
g_assert_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_AUTH_INVALID);
g_assert (!ret);
@@ -1219,6 +1251,7 @@ gs_plugin_loader_authentication_func (GsPluginLoader *plugin_loader)
gs_auth_set_password (auth, "dummy");
ret = gs_plugin_loader_auth_action (plugin_loader, auth,
GS_PLUGIN_ACTION_AUTH_LOGIN,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL, &error);
g_assert_no_error (error);
g_assert (ret);
@@ -1228,6 +1261,7 @@ gs_plugin_loader_authentication_func (GsPluginLoader *plugin_loader)
review2 = as_review_new ();
ret = gs_plugin_loader_review_action (plugin_loader, app, review2,
GS_PLUGIN_ACTION_REVIEW_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL, &error);
g_assert_no_error (error);
g_assert (ret);
@@ -1280,6 +1314,7 @@ gs_plugin_loader_wildcard_func (GsPluginLoader *plugin_loader)
list = gs_plugin_loader_get_popular (plugin_loader,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
NULL,
&error);
g_assert_no_error (error);
@@ -1442,7 +1477,11 @@ main (int argc, char **argv)
g_signal_connect (plugin_loader, "status-changed",
G_CALLBACK (gs_plugin_loader_status_changed_cb), NULL);
gs_plugin_loader_set_location (plugin_loader, "./plugins/.libs");
- ret = gs_plugin_loader_setup (plugin_loader, (gchar**) whitelist, NULL, &error);
+ ret = gs_plugin_loader_setup (plugin_loader,
+ (gchar**) whitelist,
+ NULL,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
+ &error);
g_assert_no_error (error);
g_assert (ret);
g_assert (!gs_plugin_loader_get_enabled (plugin_loader, "notgoingtoexist"));
diff --git a/src/gs-shell-category.c b/src/gs-shell-category.c
index 1867c52..5c401ed 100644
--- a/src/gs-shell-category.c
+++ b/src/gs-shell-category.c
@@ -150,6 +150,7 @@ gs_shell_category_reload (GsPage *page)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_VERSION |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_category_get_apps_cb,
self);
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index 29193d4..afe1e59 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -1102,6 +1102,8 @@ gs_shell_details_authenticate_cb (GtkDialog *dialog,
helper->app,
helper->review,
helper->action,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS |
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
helper->self->cancellable,
gs_shell_details_app_set_review_cb,
helper);
@@ -1158,6 +1160,8 @@ gs_shell_details_review_button_clicked_cb (GsReviewRow *row,
helper->app,
helper->review,
helper->action,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS |
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
self->cancellable,
gs_shell_details_app_set_review_cb,
helper);
@@ -1306,6 +1310,7 @@ gs_shell_details_app_refine2 (GsShellDetails *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_details_app_refine2_cb,
self);
@@ -1497,6 +1502,7 @@ gs_shell_details_set_filename (GsShellDetails *self, const gchar *filename)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_details_file_to_app_cb,
self);
@@ -1519,6 +1525,7 @@ gs_shell_details_load (GsShellDetails *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PROVENANCE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_details_app_refine_cb,
self);
@@ -1729,6 +1736,8 @@ gs_shell_details_review_response_cb (GtkDialog *dialog,
helper->app,
helper->review,
helper->action,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS |
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
self->cancellable,
gs_shell_details_app_set_review_cb,
helper);
diff --git a/src/gs-shell-extras.c b/src/gs-shell-extras.c
index d38d5cc..12e2dee 100644
--- a/src/gs-shell-extras.c
+++ b/src/gs-shell-extras.c
@@ -694,6 +694,7 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->search_cancellable,
search_files_cb,
search_data);
@@ -706,6 +707,7 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->search_cancellable,
file_to_app_cb,
search_data);
@@ -722,6 +724,7 @@ gs_shell_extras_load (GsShellExtras *self, GPtrArray *array_search_data)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING |
GS_PLUGIN_REFINE_FLAGS_ALLOW_PACKAGES,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->search_cancellable,
get_search_what_provides_cb,
search_data);
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 4bc49f9..0de6173 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -248,6 +248,7 @@ gs_shell_installed_load (GsShellInstalled *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_installed_get_installed_cb,
self);
diff --git a/src/gs-shell-loading.c b/src/gs-shell-loading.c
index d9e4fb8..bd7e6e1 100644
--- a/src/gs-shell-loading.c
+++ b/src/gs-shell-loading.c
@@ -105,6 +105,7 @@ gs_shell_loading_load (GsShellLoading *self)
* spin up the plugins enough as to prime caches */
gs_plugin_loader_refresh_async (priv->plugin_loader, G_MAXUINT,
GS_PLUGIN_REFRESH_FLAGS_METADATA,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
gs_shell_loading_refresh_cb,
self);
diff --git a/src/gs-shell-moderate.c b/src/gs-shell-moderate.c
index 8b957e6..2e00806 100644
--- a/src/gs-shell-moderate.c
+++ b/src/gs-shell-moderate.c
@@ -75,6 +75,8 @@ gs_shell_moderate_review_clicked_cb (GsReviewRow *row,
app,
gs_review_row_get_review (row),
action,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL |
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_moderate_app_set_review_cb,
self);
@@ -188,6 +190,7 @@ gs_shell_moderate_load (GsShellModerate *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_DESCRIPTION |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEWS,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_moderate_get_unvoted_reviews_cb,
self);
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index eacfa74..2066162 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -491,6 +491,7 @@ gs_shell_overview_load (GsShellOverview *self)
priv->loading_featured = TRUE;
gs_plugin_loader_get_featured_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
gs_shell_overview_get_featured_cb,
self);
@@ -502,6 +503,7 @@ gs_shell_overview_load (GsShellOverview *self)
gs_plugin_loader_get_popular_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
gs_shell_overview_get_popular_cb,
self);
@@ -537,6 +539,7 @@ gs_shell_overview_load (GsShellOverview *self)
featured_category,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_REVIEW_RATINGS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
gs_shell_overview_get_category_apps_cb,
load_data);
@@ -549,6 +552,7 @@ gs_shell_overview_load (GsShellOverview *self)
priv->loading_categories = TRUE;
gs_plugin_loader_get_categories_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
gs_shell_overview_get_categories_cb,
self);
@@ -672,6 +676,7 @@ g_shell_overview_rescan_proprietary_sources (GsShellOverview *self)
GsShellOverviewPrivate *priv = gs_shell_overview_get_instance_private (self);
gs_plugin_loader_get_sources_async (priv->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
priv->cancellable,
(GAsyncReadyCallback) g_shell_overview_get_sources_cb,
self);
diff --git a/src/gs-shell-search-provider.c b/src/gs-shell-search-provider.c
index 85edb14..727429d 100644
--- a/src/gs-shell-search-provider.c
+++ b/src/gs-shell-search-provider.c
@@ -136,6 +136,7 @@ execute_search (GsShellSearchProvider *self,
gs_plugin_loader_search_async (self->plugin_loader,
string,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
self->cancellable,
search_done_cb,
pending_search);
diff --git a/src/gs-shell-search.c b/src/gs-shell-search.c
index cc6f5da..4126429 100644
--- a/src/gs-shell-search.c
+++ b/src/gs-shell-search.c
@@ -198,6 +198,7 @@ gs_shell_search_load (GsShellSearch *self)
GS_PLUGIN_REFINE_FLAGS_REQUIRE_PERMISSIONS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_ORIGIN_HOSTNAME |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->search_cancellable,
gs_shell_search_get_search_cb,
self);
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 51cc1ae..212e438 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -607,6 +607,7 @@ gs_shell_updates_load (GsShellUpdates *self)
self->action_cnt++;
gs_plugin_loader_get_updates_async (self->plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
(GAsyncReadyCallback) gs_shell_updates_get_updates_cb,
self);
@@ -616,6 +617,7 @@ gs_shell_updates_load (GsShellUpdates *self)
refine_flags |= GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPGRADE_REMOVED;
gs_plugin_loader_get_distro_upgrades_async (self->plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
gs_shell_updates_get_upgrades_cb,
self);
@@ -765,6 +767,7 @@ gs_shell_updates_get_new_updates (GsShellUpdates *self)
gs_plugin_loader_refresh_async (self->plugin_loader,
10 * 60,
refresh_flags,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable_refresh,
(GAsyncReadyCallback) gs_shell_updates_refresh_cb,
self);
@@ -937,6 +940,7 @@ gs_shell_updates_reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer
gs_plugin_loader_app_action_async (self->plugin_loader,
gs_app_list_index (apps, 0),
GS_PLUGIN_ACTION_UPDATE_CANCEL,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
cancel_trigger_failed_cb,
self);
@@ -1002,6 +1006,7 @@ gs_shell_updates_button_update_all_cb (GtkButton *button,
apps = gs_update_list_get_apps (GS_UPDATE_LIST (self->list_box_updates));
gs_plugin_loader_update_async (self->plugin_loader,
apps,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
(GAsyncReadyCallback) gs_shell_updates_perform_update_cb,
self);
@@ -1064,6 +1069,7 @@ gs_shell_updates_upgrade_download_cb (GsUpgradeBanner *upgrade_banner,
gs_plugin_loader_app_action_async (self->plugin_loader,
app,
GS_PLUGIN_ACTION_UPGRADE_DOWNLOAD,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable_upgrade_download,
upgrade_download_finished_cb,
helper);
@@ -1099,6 +1105,7 @@ upgrade_reboot_failed_cb (GObject *source,
gs_plugin_loader_app_action_async (self->plugin_loader,
app,
GS_PLUGIN_ACTION_UPDATE_CANCEL,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
cancel_trigger_failed_cb,
self);
@@ -1146,6 +1153,7 @@ trigger_upgrade (GsShellUpdates *self)
gs_plugin_loader_app_action_async (self->plugin_loader,
upgrade,
GS_PLUGIN_ACTION_UPGRADE_TRIGGER,
+ GS_PLUGIN_FAILURE_FLAGS_USE_EVENTS,
self->cancellable,
upgrade_trigger_finished_cb,
self);
diff --git a/src/gs-sources-dialog.c b/src/gs-sources-dialog.c
index b201309..7a117c7 100644
--- a/src/gs-sources-dialog.c
+++ b/src/gs-sources-dialog.c
@@ -203,6 +203,7 @@ gs_sources_dialog_rescan_proprietary_sources (GsSourcesDialog *dialog)
gs_plugin_loader_app_action_async (dialog->plugin_loader,
app,
GS_PLUGIN_ACTION_INSTALL,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
dialog->cancellable,
source_modified_cb,
dialog);
@@ -212,6 +213,7 @@ gs_sources_dialog_rescan_proprietary_sources (GsSourcesDialog *dialog)
gs_plugin_loader_app_action_async (dialog->plugin_loader,
app,
GS_PLUGIN_ACTION_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_FAST_FATAL,
dialog->cancellable,
source_modified_cb,
dialog);
@@ -365,6 +367,7 @@ reload_sources (GsSourcesDialog *dialog)
gs_plugin_loader_get_sources_async (dialog->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
dialog->cancellable,
(GAsyncReadyCallback) get_sources_cb,
dialog);
@@ -512,6 +515,7 @@ remove_button_cb (GtkWidget *widget, GsSourcesDialog *dialog)
gs_plugin_loader_app_action_async (dialog->plugin_loader,
app,
GS_PLUGIN_ACTION_REMOVE,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
dialog->cancellable,
app_removed_cb,
dialog);
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 69e189c..2c2d1a3 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -246,6 +246,7 @@ gs_update_dialog_show_installed_updates (GsUpdateDialog *dialog)
gs_plugin_loader_get_updates_async (dialog->plugin_loader,
refine_flags,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
dialog->cancellable,
(GAsyncReadyCallback) get_installed_updates_cb,
dialog);
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index 99f5c7f..61e496e 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -288,6 +288,7 @@ get_updates (GsUpdateMonitor *monitor)
gs_plugin_loader_get_updates_async (monitor->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_DETAILS |
GS_PLUGIN_REFINE_FLAGS_REQUIRE_UPDATE_SEVERITY,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
monitor->cancellable,
get_updates_finished_cb,
monitor);
@@ -302,6 +303,7 @@ get_upgrades (GsUpdateMonitor *monitor)
g_debug ("Getting upgrades");
gs_plugin_loader_get_distro_upgrades_async (monitor->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_DEFAULT,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
monitor->cancellable,
get_upgrades_finished_cb,
monitor);
@@ -415,6 +417,7 @@ check_updates (GsUpdateMonitor *monitor)
gs_plugin_loader_refresh_async (monitor->plugin_loader,
60 * 60 * 24,
refresh_flags,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
monitor->cancellable,
refresh_cache_finished_cb,
monitor);
@@ -605,6 +608,7 @@ cleanup_notifications_cb (gpointer user_data)
g_debug ("getting historical updates for fresh session");
gs_plugin_loader_get_updates_async (monitor->plugin_loader,
GS_PLUGIN_REFINE_FLAGS_USE_HISTORY,
+ GS_PLUGIN_FAILURE_FLAGS_NONE,
monitor->cancellable,
get_updates_historical_cb,
monitor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]