From b9b712f048ea2b37a7df9b0811d6d9769308e214 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Fri, 28 Jun 2019 08:03:20 -0700 Subject: Always reset view type to normal Let $ShellParam$ groups change it again -- this fixes an issue where some modules were displaying with the wrong ViewType. --- shell/shell.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'shell/shell.c') diff --git a/shell/shell.c b/shell/shell.c index 61ab5719..83514485 100644 --- a/shell/shell.c +++ b/shell/shell.c @@ -1439,7 +1439,6 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload) GKeyFile *key_file = g_key_file_new(); GtkTreeStore *store; gchar *key_data, **groups; - gboolean has_shell_param = FALSE; gint i; gsize ngroups; #if GTK_CHECK_VERSION(2, 14, 0) @@ -1478,13 +1477,15 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload) if (groups[i][0] == '$') ngroups--; + set_view_type(SHELL_VIEW_NORMAL, reload); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), FALSE); + for (i = 0; groups[i]; i++) { gchar *group = groups[i]; gchar **keys = g_key_file_get_keys(key_file, group, NULL, NULL); if (*group == '$') { group_handle_special(key_file, entry, group, keys, reload); - has_shell_param = TRUE; } else { group_handle_normal(key_file, entry, group, keys, ngroups); } @@ -1492,13 +1493,6 @@ module_selected_show_info(ShellModuleEntry * entry, gboolean reload) g_strfreev(keys); } - /* */ - if (!has_shell_param) { - /* reset the view type to normal */ - set_view_type(SHELL_VIEW_NORMAL, reload); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(shell->info->view), FALSE); - } - /* */ g_object_unref(shell->info->model); gtk_tree_view_set_model(GTK_TREE_VIEW(shell->info->view), shell->info->model); -- cgit v1.2.3