https://bugzilla.xfce.org/show_bug.cgi?id=16654

--- Comment #13 from Reuben Green <reubengree...@gmail.com> ---
Created attachment 9807
  --> https://bugzilla.xfce.org/attachment.cgi?id=9807&action=edit
use defalut view type

Another bug, but this time I have a patch for it (patch is against
ReplaceGtkAction45).

The bug is that the default view set via the preferences dialog is not
respected, and instead the last view is always used. To reproduce, set the
default view to eg details view, then close thunar while viewing a directory in
eg icon view. When you next start thunar, you'll be in icon view not details
view.

The bug is caused by the call to thunar_window_action_view_changed in
thunar_window_set_current_directory having window->view_type as an argument
instead of the function's type variable.

The first commit in the patch fixes this, and also adds some necessary calls in
thunar_window_init to ensure that the necessary types are all registered. If
you just correct "window->view_type" to "type" in
thunar_window_set_current_directory without adding the g_type_ensure calls, you
can get segfaults (eg if you do the reproducer steps above).

The second commit removes all the last-view related code in thunar_window_init,
as I think the previous commit makes it redundant, and after some quick testing
it seems that removing it has no bad effects (but I did not test it very much).

(I found this while working on bug #3521, which is proving to be much more
complicated than I thought, but it is teaching me lots about the thunar code
and using gtk/glib, so it's good!)

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Xfce-bugs mailing list
Xfce-bugs@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce-bugs

Reply via email to