[Xfce4-commits] <xfce4-taskmanager:master> Avoid saving columns positions when closing application

Mike Massonnet noreply at xfce.org
Wed Jun 2 02:18:01 CEST 2010


Updating branch refs/heads/master
         to 9238d67f9a2f3fd9e7c01e842b87cfcbe04ad280 (commit)
       from 06921c3ac131cd3a683ff2d64e2d1f3fd9985635 (commit)

commit 9238d67f9a2f3fd9e7c01e842b87cfcbe04ad280
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Wed Jun 2 02:16:01 2010 +0200

    Avoid saving columns positions when closing application
    
    When the application was closed, the columns-changed signal was
    triggered everytime a tree view column was destroyed/removed from the
    tree view (think dispose), and this was bad since the columns positions
    may have been saved as a succession of zeros. Avoid this.

 src/process-tree-view.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/process-tree-view.c b/src/process-tree-view.c
index dc6c9e4..313d13c 100644
--- a/src/process-tree-view.c
+++ b/src/process-tree-view.c
@@ -248,14 +248,20 @@ columns_changed (XtmProcessTreeView *treeview)
 	gint i;
 
 	columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (treeview));
+	if (g_list_length (columns) < N_COLUMNS)
+	{
+		g_list_free (columns);
+		return;
+	}
+
 	for (l = columns, i = 0; l != NULL; l = l->next, i++)
 	{
 		column = GTK_TREE_VIEW_COLUMN (l->data);
 		column_id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (column), "column-id"));
 		treeview->columns_positions[column_id] = i;
 	}
-	g_list_free (columns);
 
+	g_list_free (columns);
 	save_columns_positions (treeview);
 }
 



More information about the Xfce4-commits mailing list