changeset 1677:6b0e71b96ab6

call gtk_tree_view_columns_autosize only when reall needed gtk_tree_view_columns_autosize is rather expensive, call it only afrer directory change or after user-requested refresh
author nadvornik
date Fri, 24 Jul 2009 12:45:42 +0000
parents f03b0d494579
children c029adbabb70
files src/view_file_list.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/view_file_list.c	Fri Jul 24 12:21:23 2009 +0000
+++ b/src/view_file_list.c	Fri Jul 24 12:45:42 2009 +0000
@@ -476,6 +476,7 @@
 
 	vflist_color_set(vf, VFLIST(vf)->click_fd, FALSE);
 	vf_refresh(vf);
+	gtk_tree_view_columns_autosize(GTK_TREE_VIEW(vf->listview));
 }
 
 void vflist_popup_destroy_cb(GtkWidget *widget, gpointer data)
@@ -1714,8 +1715,6 @@
 	column = gtk_tree_view_get_column(GTK_TREE_VIEW(listview), FILE_VIEW_COLUMN_DATE);
 	if (!column) return;
 	gtk_tree_view_column_set_visible(column, !multiline);
-
-	gtk_tree_view_columns_autosize(GTK_TREE_VIEW(listview));
 }
 
 static gboolean vflist_is_multiline(ViewFile *vf)
@@ -1950,6 +1949,7 @@
 
 gboolean vflist_set_fd(ViewFile *vf, FileData *dir_fd)
 {
+	gboolean ret;
 	if (!dir_fd) return FALSE;
 	if (vf->dir_fd == dir_fd) return TRUE;
 
@@ -1962,7 +1962,9 @@
 	filelist_free(vf->list);
 	vf->list = NULL;
 
-	return vf_refresh(vf);
+	ret = vf_refresh(vf);
+	gtk_tree_view_columns_autosize(GTK_TREE_VIEW(vf->listview));
+	return ret;
 }
 
 void vflist_destroy_cb(GtkWidget *widget, gpointer data)