[gnome-software] installed: Don't re-sort all of the listbox when one app changes



commit c801646887ce5de7a42ed21e88ebe7565e5bede4
Author: Kalev Lember <klember redhat com>
Date:   Sat Aug 8 17:01:43 2015 +0200

    installed: Don't re-sort all of the listbox when one app changes
    
    Instead, just mark the row with the updated app as changed.

 src/gs-shell-installed.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index e024830..b1b7136 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -132,11 +132,11 @@ gs_shell_installed_app_remove_cb (GsAppRow *app_row,
 static gboolean
 gs_shell_installed_invalidate_sort_idle (gpointer user_data)
 {
-       GsShellInstalled *shell = GS_SHELL_INSTALLED (user_data);
+       GsAppRow *app_row = user_data;
 
-       gtk_list_box_invalidate_sort (GTK_LIST_BOX (shell->priv->list_box_install));
+       gtk_list_box_row_changed (GTK_LIST_BOX_ROW (app_row));
 
-       g_object_unref (shell);
+       g_object_unref (app_row);
        return G_SOURCE_REMOVE;
 }
 
@@ -146,9 +146,9 @@ gs_shell_installed_invalidate_sort_idle (gpointer user_data)
 static void
 gs_shell_installed_notify_state_changed_cb (GsApp *app,
                                            GParamSpec *pspec,
-                                           GsShellInstalled *shell)
+                                           GsAppRow *app_row)
 {
-       g_idle_add (gs_shell_installed_invalidate_sort_idle, g_object_ref (shell));
+       g_idle_add (gs_shell_installed_invalidate_sort_idle, g_object_ref (app_row));
 }
 
 static void selection_changed (GsShellInstalled *shell);
@@ -165,7 +165,7 @@ gs_shell_installed_add_app (GsShellInstalled *shell, GsApp *app)
                          G_CALLBACK (gs_shell_installed_app_remove_cb), shell);
        g_signal_connect_object (app, "notify::state",
                                 G_CALLBACK (gs_shell_installed_notify_state_changed_cb),
-                                shell, 0);
+                                app_row, 0);
        g_signal_connect_swapped (app_row, "notify::selected",
                                  G_CALLBACK (selection_changed), shell);
        gs_app_row_set_app (GS_APP_ROW (app_row), app);


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