[gnome-software: 8/9] gs-plugin-loader: Don't erroneously set apps to AVAILABLE




commit c76c942854841644142b347d75e5faafd9bd6cef
Author: Phaedrus Leeds <matthew leeds endlessm com>
Date:   Thu Aug 13 12:58:21 2020 -0700

    gs-plugin-loader: Don't erroneously set apps to AVAILABLE
    
    Now that we are adding apps to the install queue for every install
    action (see the commit "Always add apps that are to be installed to the
    install queue"), it doesn't make sense to set them to
    GS_APP_STATE_AVAILABLE when removing them from the queue, since it may
    be that the installation completed successfully.
    
    (Rebased from downstream Endless OS by Philip Withnall)

 lib/gs-plugin-loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index d25f52d40..9edd61f90 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -1519,7 +1519,6 @@ remove_app_from_install_queue (GsPluginLoader *plugin_loader, GsApp *app)
        g_mutex_unlock (&plugin_loader->pending_apps_mutex);
 
        if (ret) {
-               gs_app_set_state (app, GS_APP_STATE_AVAILABLE);
                id = g_idle_add (emit_pending_apps_idle, g_object_ref (plugin_loader));
                g_source_set_name_by_id (id, "[gnome-software] emit_pending_apps_idle");
                save_install_queue (plugin_loader);
@@ -3146,6 +3145,7 @@ gs_plugin_loader_app_installed_cb (GObject *source,
                                                   &error);
        remove_app_from_install_queue (plugin_loader, app);
        if (!ret) {
+               gs_app_set_state_recover (app);
                g_warning ("failed to install %s: %s",
                           gs_app_get_unique_id (app), error->message);
        }


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