[gnome-software/jrocha/fix-install-queue: 3/8] Try to install the apps that are queued after adding them



commit 52de5c75fc7003641bae39cdc4c8c4763f9b3ddd
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Fri Feb 16 13:16:27 2018 +0100

    Try to install the apps that are queued after adding them
    
    After adding the apps that are queued (for installation) to the
    installed page, nothing was calling their actual installation. So this
    patch does exactly that, provided there's available and unmetered
    network.

 src/gs-installed-page.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/gs-installed-page.c b/src/gs-installed-page.c
index 59deda20..10f54984 100644
--- a/src/gs-installed-page.c
+++ b/src/gs-installed-page.c
@@ -586,6 +586,13 @@ gs_installed_page_pending_apps_refined_cb (GObject *source,
                if (gs_app_get_state (app) == AS_APP_STATE_AVAILABLE)
                        gs_app_set_state (app, AS_APP_STATE_QUEUED_FOR_INSTALL);
 
+               if (gs_app_get_state (app) == AS_APP_STATE_QUEUED_FOR_INSTALL &&
+                   gs_plugin_loader_get_network_available (plugin_loader) &&
+                   !gs_plugin_loader_get_network_metered (plugin_loader))
+                       gs_page_install_app (GS_PAGE (self), app,
+                                            GS_SHELL_INTERACTION_FULL,
+                                            gs_app_get_cancellable (app));
+
                ++pending_apps_count;
                if (!gs_installed_page_has_app (self, app))
                        gs_installed_page_add_app (self, list, app);


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