[gnome-software/jrocha/fix-install-queue: 3/4] Fix order of saving apps that are queued install



commit d3746cbf7cad1d1ed75c2a4ca2ce60bce1ff210b
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Fri Feb 16 13:21:08 2018 +0100

    Fix order of saving apps that are queued install
    
    For some reason, the order was being reversed, but since this is a
    queue, then it should store and load the apps in the order they have
    been requested to be installed.
    
    https://phabricator.endlessm.com/T21194

 lib/gs-plugin-loader.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/lib/gs-plugin-loader.c b/lib/gs-plugin-loader.c
index 97d3361a..ca624bee 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -1771,14 +1771,13 @@ save_install_queue (GsPluginLoader *plugin_loader)
 {
        GsPluginLoaderPrivate *priv = gs_plugin_loader_get_instance_private (plugin_loader);
        gboolean ret;
-       gint i = 0;
        g_autoptr(GError) error = NULL;
        g_autoptr(GString) s = NULL;
        g_autofree gchar *file = NULL;
 
        s = g_string_new ("");
        g_mutex_lock (&priv->pending_apps_mutex);
-       for (i = (gint) gs_app_list_length (priv->pending_apps) - 1; i >= 0; i--) {
+       for (guint i = 0; i < gs_app_list_length (priv->pending_apps); ++i) {
                GsApp *app = gs_app_list_index (priv->pending_apps, i);
                g_string_append (s, gs_app_get_unique_id (app));
                g_string_append_c (s, '\n');


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