From 3545ab38a6f81a4fecd69c2a3b7b98b72d72aff3 Mon Sep 17 00:00:00 2001 From: Reuben Green Date: Mon, 27 Apr 2020 12:29:53 +0100 Subject: [PATCH 1/2] use default view setting rather than always using last view --- thunar/thunar-window.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 20592b82..70c05b87 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -801,6 +801,11 @@ G_GNUC_END_IGNORE_DEPRECATIONS if (G_LIKELY (window->view != NULL)) thunar_window_binding_create (window, window->view, "statusbar-text", window->statusbar, "text", G_BINDING_SYNC_CREATE); + /* ensure that all the view types are registered */ + g_type_ensure (THUNAR_TYPE_ICON_VIEW); + g_type_ensure (THUNAR_TYPE_DETAILS_VIEW); + g_type_ensure (THUNAR_TYPE_COMPACT_VIEW); + if (exo_str_is_equal (last_view, g_type_name (THUNAR_TYPE_ICON_VIEW))) window->view_type = THUNAR_TYPE_ICON_VIEW; else if (exo_str_is_equal (last_view, g_type_name (THUNAR_TYPE_DETAILS_VIEW))) @@ -3533,7 +3538,7 @@ thunar_window_set_current_directory (ThunarWindow *window, if (g_type_is_a (type, G_TYPE_NONE)) type = THUNAR_TYPE_ICON_VIEW; } - thunar_window_action_view_changed (window, window->view_type); + thunar_window_action_view_changed (window, type); } /* update window icon and title */ -- 2.26.2 From 252179bbed7df77260a0c6acf72a6603a9cc35ae Mon Sep 17 00:00:00 2001 From: Reuben Green Date: Mon, 27 Apr 2020 12:38:13 +0100 Subject: [PATCH 2/2] remove redundant (?) code in thunar_window_init --- thunar/thunar-window.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 70c05b87..da0fb3b6 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -559,7 +559,6 @@ thunar_window_init (ThunarWindow *window) gboolean last_menubar_visible; gchar *last_location_bar; gchar *last_side_pane; - gchar *last_view; GType type; gint last_separator_position; gint last_window_width; @@ -595,7 +594,6 @@ thunar_window_init (ThunarWindow *window) "last-location-bar", &last_location_bar, "last-side-pane", &last_side_pane, "last-statusbar-visible", &last_statusbar_visible, - "last-view", &last_view, "misc-small-toolbar-icons", &small_icons, NULL); @@ -806,16 +804,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS g_type_ensure (THUNAR_TYPE_DETAILS_VIEW); g_type_ensure (THUNAR_TYPE_COMPACT_VIEW); - if (exo_str_is_equal (last_view, g_type_name (THUNAR_TYPE_ICON_VIEW))) - window->view_type = THUNAR_TYPE_ICON_VIEW; - else if (exo_str_is_equal (last_view, g_type_name (THUNAR_TYPE_DETAILS_VIEW))) - window->view_type = THUNAR_TYPE_DETAILS_VIEW; - else if (exo_str_is_equal (last_view, g_type_name (THUNAR_TYPE_COMPACT_VIEW))) - window->view_type = THUNAR_TYPE_COMPACT_VIEW; - else - window->view_type = THUNAR_TYPE_ICON_VIEW; //default - g_free (last_view); - /* load the bookmarks file and monitor */ window->bookmark_file = thunar_g_file_new_for_bookmarks (); window->bookmark_monitor = g_file_monitor_file (window->bookmark_file, G_FILE_MONITOR_NONE, NULL, NULL); -- 2.26.2