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



commit 9bf5a842773f0fb1ad58936167202ca5eb6d904d
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 1a43dfe9..c7b2a6d2 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);
                GsApp *app = gs_app_list_lookup (priv->global_cache, id);
 


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