[gnome-color-manager/gnome-3-12] Speed up deleting profiles by an order of magnitude
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager/gnome-3-12] Speed up deleting profiles by an order of magnitude
- Date: Thu, 3 Apr 2014 22:07:49 +0000 (UTC)
commit f794b57bb9a1c6344934c703bdc916995950904f
Author: Richard Hughes <richard hughsie com>
Date: Wed Apr 2 13:21:23 2014 +0200
Speed up deleting profiles by an order of magnitude
Clearing a store involves refreshing each renderer. We don't need this.
src/gcm-viewer.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index 0a161e5..dd8e5f7 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -55,6 +55,7 @@ typedef struct {
const gchar *lang;
GtkListStore *liststore_nc;
GtkListStore *liststore_metadata;
+ gboolean clearing_store;
} GcmViewerPrivate;
typedef enum {
@@ -329,7 +330,9 @@ gcm_viewer_update_get_profiles_cb (GObject *source_object,
}
/* clear existing list */
+ viewer->clearing_store = TRUE;
gtk_list_store_clear (viewer->list_store_profiles);
+ viewer->clearing_store = FALSE;
/* update each list */
for (i=0; i<profile_array->len; i++) {
@@ -1277,6 +1280,10 @@ gcm_viewer_profiles_treeview_clicked_cb (GtkTreeSelection *selection,
GtkTreeIter iter;
CdProfile *profile;
+ /* ignore */
+ if (viewer->clearing_store)
+ return;
+
/* This will only work in single or browse selection mode! */
if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
g_debug ("no row selected");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]