[gnome-software/gnome-3-20] Return all refresh warnings when running interactively



commit dbd35965de07edb52ee6e24710c65d0bc26c1ea7
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 e128f0c..012d619 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -3504,6 +3504,11 @@ gs_plugin_loader_run_refresh (GsPluginLoader *plugin_loader,
                ret = plugin_func (plugin, cache_age, flags, cancellable, &error_local);
                g_rw_lock_writer_unlock (&plugin->rwlock);
                if (!ret) {
+                       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, plugin->name,
                                   error_local->message);
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index c1862e1..a95ed0b 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -123,6 +123,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.
@@ -137,6 +138,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 d74fe23..128b4be 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -741,6 +741,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]