[gnome-software] Return all refresh warnings when running interactively
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Return all refresh warnings when running interactively
- Date: Tue, 31 May 2016 10:04:55 +0000 (UTC)
commit c30ad41905fe3fadd2a0d43e7be64532bc5ff17b
Author: Richard Hughes <richard hughsie com>
Date: Tue May 31 11:02:40 2016 +0100
Return all refresh warnings when running interactively
This allows us to see problems that would otherwise be hidden on the console.
src/gs-plugin-loader.c | 5 +++++
src/gs-plugin.h | 2 ++
src/gs-shell-updates.c | 1 +
3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 9ebbb98..a9053fe 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -3748,6 +3748,11 @@ gs_plugin_loader_run_refresh (GsPluginLoader *plugin_loader,
function_name);
continue;
}
+ if (flags & GS_PLUGIN_REFRESH_FLAGS_INTERACTIVE) {
+ g_propagate_error (error, error_local);
+ error_local = NULL;
+ return FALSE;
+ }
g_warning ("failed to call %s on %s: %s",
function_name,
gs_plugin_get_name (plugin),
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 1160423..230c4a1 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -179,6 +179,7 @@ typedef enum {
* @GS_PLUGIN_REFRESH_FLAGS_NONE: Generate new metadata if possible
* @GS_PLUGIN_REFRESH_FLAGS_METADATA: Download new metadata
* @GS_PLUGIN_REFRESH_FLAGS_PAYLOAD: Download any pending payload
+ * @GS_PLUGIN_REFRESH_FLAGS_INTERACTIVE: Running by user request
*
* The flags used for refresh. Regeneration and downloading is only
* done if the cache is older than the %cache_age.
@@ -193,6 +194,7 @@ typedef enum {
GS_PLUGIN_REFRESH_FLAGS_NONE = 0,
GS_PLUGIN_REFRESH_FLAGS_METADATA = 1 << 0,
GS_PLUGIN_REFRESH_FLAGS_PAYLOAD = 1 << 1,
+ GS_PLUGIN_REFRESH_FLAGS_INTERACTIVE = 1 << 2,
/*< private >*/
GS_PLUGIN_REFRESH_FLAGS_LAST
} GsPluginRefreshFlags;
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index c0abb23..62fa26a 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -755,6 +755,7 @@ gs_shell_updates_get_new_updates (GsShellUpdates *self)
gs_plugin_loader_refresh_async (self->plugin_loader,
10 * 60,
+ GS_PLUGIN_REFRESH_FLAGS_INTERACTIVE |
GS_PLUGIN_REFRESH_FLAGS_METADATA |
GS_PLUGIN_REFRESH_FLAGS_PAYLOAD,
self->cancellable_refresh,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]