summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2017-07-22 07:15:00 -0700
committerLeandro Pereira <leandro@hardinfo.org>2017-07-22 07:15:00 -0700
commit4ece9935e89b9e4fbc36940e6bc2f8d3fbb43f45 (patch)
tree526737759f0759b6f240e8afe07fc88e89243ce1 /shell
parenta4de5f48ecf4f09ae5f2e25ed520cc457a211dae (diff)
Reset GtkTreeSortable when changing view types
This should fix #16.
Diffstat (limited to 'shell')
-rw-r--r--shell/shell.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/shell.c b/shell/shell.c
index 20bdcdbe..153b00b3 100644
--- a/shell/shell.c
+++ b/shell/shell.c
@@ -898,9 +898,14 @@ static void set_view_type(ShellViewType viewtype, gboolean reload)
shell->normalize_percentage = TRUE;
shell->view_type = viewtype;
- /* reset to the default model */
+ /* use an unsorted tree model */
+ GtkTreeSortable *sortable = GTK_TREE_SORTABLE(shell->info->model);
+
+ gtk_tree_sortable_set_sort_column_id(sortable,
+ GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID,
+ GTK_SORT_ASCENDING);
gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view),
- shell->info->model);
+ GTK_TREE_MODEL(sortable));
/* reset to the default view columns */
if (!reload) {