aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-11-18 02:55:54 +0800
committerChristian Persch <chpe@src.gnome.org>2005-11-18 02:55:54 +0800
commit53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5 (patch)
tree9438c586195831271e8b16f11702451b52c22481
parentf7b9a29b36f42eafb7e4467dc6d4dd0afa8e1f4a (diff)
downloadgsoc2013-epiphany-53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5.tar
gsoc2013-epiphany-53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5.tar.gz
gsoc2013-epiphany-53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5.tar.bz2
gsoc2013-epiphany-53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5.tar.lz
gsoc2013-epiphany-53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5.tar.xz
gsoc2013-epiphany-53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5.tar.zst
gsoc2013-epiphany-53c82c3d0c65ea734cc21e1e0ed5b4ccbde033a5.zip
Set the model's sort column only after filling it. Vastly improves delay
2005-11-17 Christian Persch <chpe@cvs.gnome.org> * src/pdm-dialog.c: Set the model's sort column only after filling it. Vastly improves delay when opening the PDM dialogue when you have many cookies.
-rw-r--r--ChangeLog7
-rwxr-xr-xsrc/pdm-dialog.c26
2 files changed, 26 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index d1c9e26a3..d611f4bd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-11-17 Christian Persch <chpe@cvs.gnome.org>
+
+ * src/pdm-dialog.c:
+
+ Set the model's sort column only after filling it. Vastly improves
+ delay when opening the PDM dialogue when you have many cookies.
+
2005-11-15 Christian Persch <chpe@cvs.gnome.org>
* data/glade/epiphany.glade:
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index fe1748136..00564bd29 100755
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -397,9 +397,7 @@ pdm_dialog_cookies_construct (PdmActionInfo *info)
gtk_tree_view_set_headers_visible (treeview, TRUE);
selection = gtk_tree_view_get_selection (treeview);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (liststore),
- COL_COOKIES_HOST,
- GTK_SORT_ASCENDING);
+
info->model = GTK_TREE_MODEL (liststore);
g_object_unref (liststore);
@@ -575,6 +573,11 @@ pdm_dialog_fill_cookies_list (PdmActionInfo *info)
G_CALLBACK (cookie_deleted_cb), info->dialog);
g_signal_connect (manager, "cookies-cleared",
G_CALLBACK (cookies_cleared_cb), info->dialog);
+
+ /* Now turn on sorting */
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (info->model),
+ COL_COOKIES_HOST,
+ GTK_SORT_ASCENDING);
}
static void
@@ -645,9 +648,7 @@ pdm_dialog_passwords_construct (PdmActionInfo *info)
gtk_tree_view_set_headers_visible (treeview, TRUE);
selection = gtk_tree_view_get_selection (treeview);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (liststore),
- COL_PASSWORDS_HOST,
- GTK_SORT_ASCENDING);
+
info->model = GTK_TREE_MODEL (liststore);
g_object_unref (liststore);
@@ -686,12 +687,19 @@ static void
passwords_changed_cb (EphyPasswordManager *manager,
PdmDialog *dialog)
{
+ GtkTreeModel *model = dialog->priv->passwords->model;
+
LOG ("passwords changed");
/* since the callback doesn't carry any information about what
* exactly has changed, we have to rebuild the list from scratch.
*/
- gtk_list_store_clear (GTK_LIST_STORE (dialog->priv->passwords->model));
+ gtk_list_store_clear (GTK_LIST_STORE (model));
+
+ /* And turn off sorting */
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (model),
+ GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID,
+ GTK_SORT_ASCENDING);
dialog->priv->passwords->fill (dialog->priv->passwords);
}
@@ -723,6 +731,10 @@ pdm_dialog_fill_passwords_list (PdmActionInfo *info)
}
info->filled = TRUE;
+
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (info->model),
+ COL_PASSWORDS_HOST,
+ GTK_SORT_ASCENDING);
}
static void