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



commit a5e9fab2a12b33af0592b0d5e782b42ac9af5d60
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.

 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 af728364..c2a0085c 100644
--- a/lib/gs-plugin-loader.c
+++ b/lib/gs-plugin-loader.c
@@ -1771,7 +1771,6 @@ save_install_queue (GsPluginLoader *plugin_loader)
        GsPluginLoaderPrivate *priv = gs_plugin_loader_get_instance_private (plugin_loader);
        GPtrArray *pending_apps;
        gboolean ret;
-       gint i;
        g_autoptr(GError) error = NULL;
        g_autoptr(GString) s = NULL;
        g_autofree gchar *file = NULL;
@@ -1779,7 +1778,7 @@ save_install_queue (GsPluginLoader *plugin_loader)
        s = g_string_new ("");
        pending_apps = priv->pending_apps;
        g_mutex_lock (&priv->pending_apps_mutex);
-       for (i = (gint) pending_apps->len - 1; i >= 0; i--) {
+       for (guint i = 0; i < pending_apps->len; ++i) {
                const gchar *id = g_ptr_array_index (pending_apps, i);
                g_string_append (s, id);
                g_string_append_c (s, '\n');


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