[Xfce4-commits] [xfce/thunar] 01/02: Respect the "View new folders using" preference (bug #11606)

noreply at xfce.org noreply at xfce.org
Sat Feb 28 15:01:49 CET 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit c10e1ce9039245659edb2d6c0daab7b73078071b
Author: Harald Judt <h.judt at gmx.at>
Date:   Sat Feb 28 14:51:44 2015 +0100

    Respect the "View new folders using" preference (bug #11606)
    
    To reproduce:
    1.) Open Thunar.
    2.) Select the "View" menu from the menu bar.
    3.) Select "View as Detailed List".
    4.) Select the "Edit" menu from the menu bar.
    5.) Select "Preferences".
    6.) Go to the "Display" tab.
    7.) Select "Icon View" under "View new folders using:"
    
    You can open any folder or close and reopen Thunar it will always list
    items in "View as Detailed List" mode and ignore the setting set
    in preferences.
---
 thunar/thunar-window.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index 0221881..146ed91 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -3697,10 +3697,17 @@ thunar_window_set_current_directory (ThunarWindow *window,
       /* create a new view if the window is new */
       if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)) == 0)
         {
-          /* determine the last selected view if we don't have a valid default */
-          g_object_get (G_OBJECT (window->preferences), "last-view", &type_name, NULL);
+          /* determine the default view */
+          g_object_get (G_OBJECT (window->preferences), "default-view", &type_name, NULL);
           type = g_type_from_name (type_name);
 
+          /* determine the last selected view if the last selected view preference is not selected */
+          if (g_type_is_a (type, G_TYPE_NONE))
+            {
+              g_object_get (G_OBJECT (window->preferences), "last-view", &type_name, NULL);
+              type = g_type_from_name (type_name);
+            }
+
           /* activate the selected view */
           action = gtk_action_group_get_action (window->action_group, "view-as-icons");
           g_signal_handlers_block_by_func (action, thunar_window_action_view_changed, window);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list