[gitg] Remove and reattach model while loading repository



commit e930f232e529e1721f97a9a7d0c6c668061ba4cd
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Mon Mar 28 11:22:14 2011 +0200

    Remove and reattach model while loading repository
    
    This vastly improves loading time on large repositories

 gitg/gitg-window.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gitg/gitg-window.c b/gitg/gitg-window.c
index 585084a..f5196f9 100644
--- a/gitg/gitg-window.c
+++ b/gitg/gitg-window.c
@@ -1225,6 +1225,9 @@ on_repository_loaded (GitgRepository *repository,
 	g_free (msg);
 	gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window->priv->tree_view)), NULL);
 
+	gtk_tree_view_set_model (window->priv->tree_view,
+	                         GTK_TREE_MODEL (window->priv->repository));
+
 	GitgHash hash = {0,};
 
 	if (memcmp (window->priv->select_on_load, hash, GITG_HASH_BINARY_SIZE) != 0)
@@ -1715,6 +1718,8 @@ on_repository_load (GitgRepository *repository,
 	                                   on_branches_combo_changed,
 	                                   window);
 
+	gtk_tree_view_set_model (window->priv->tree_view, NULL);
+
 	update_window_title (window);
 }
 
@@ -1797,9 +1802,6 @@ load_repository (GitgWindow   *window,
 	if ((git_dir || work_tree) &&
 	    create_repository (window, git_dir, work_tree, selection))
 	{
-		gtk_tree_view_set_model (window->priv->tree_view,
-		                         GTK_TREE_MODEL (window->priv->repository));
-
 		GitgShell *loader = gitg_repository_get_loader (window->priv->repository);
 
 		gitg_window_set_select_on_load (window, selection);



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