From 08a5f99c1d53e27f6517c129c79fe4e7b887a843 Mon Sep 17 00:00:00 2001 From: monsta Date: Tue, 1 Mar 2016 15:12:49 +0300 Subject: process table: replace useless callback with single function all columns except for the first one were already made reorderable, so there's no need for this callback with a loop. just make the first column reorderable too and we're done. from https://git.gnome.org/browse/gnome-system-monitor/commit/?id=3bd1b01b5e983379e69c02613280a218e8873914 --- src/proctable.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/proctable.cpp b/src/proctable.cpp index cf8fdf3..9eb93ba 100644 --- a/src/proctable.cpp +++ b/src/proctable.cpp @@ -71,24 +71,6 @@ ProcInfo* ProcInfo::find(pid_t pid) } - -static void -set_proctree_reorderable(ProcData *procdata) -{ - GList *columns, *col; - GtkTreeView *proctree; - - proctree = GTK_TREE_VIEW(procdata->tree); - - columns = gtk_tree_view_get_columns (proctree); - - for(col = columns; col; col = col->next) - gtk_tree_view_column_set_reorderable(static_cast(col->data), TRUE); - - g_list_free(columns); -} - - static void cb_columns_changed(GtkTreeView *treeview, gpointer user_data) { @@ -355,6 +337,7 @@ proctable_new (ProcData * const procdata) gtk_tree_view_column_set_resizable (column, TRUE); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_min_width (column, 20); + gtk_tree_view_column_set_reorderable (column, TRUE); g_signal_connect(G_OBJECT(column), "notify::fixed-width", G_CALLBACK(cb_proctable_column_resized), procdata->settings); gtk_tree_view_append_column (GTK_TREE_VIEW (proctree), column); gtk_tree_view_set_expander_column (GTK_TREE_VIEW (proctree), column); @@ -482,8 +465,6 @@ proctable_new (ProcData * const procdata) procdata->tree = proctree; - set_proctree_reorderable(procdata); - procman_get_tree_state (procdata->settings, proctree, "proctree"); /* Override column settings by hiding this column if it's meaningless: */ -- cgit v1.2.1