GNOME Bugzilla – Bug 698190
Reset View to Defaults does not update visible columns immediately
Last modified: 2013-06-21 15:37:05 UTC
To see the problem: 1. Visit your home folder in list view, showing the default set of columns. 2. Use the Visible Columns dialog to add a couple of columns. 3. Choose Reset View to Defaults. The visible column set will not change. 4. Navigate to a different folder, then come back to your home folder. It will now display the default column set. If Reset View to Defaults changes the set of columns to be displayed, that should take effect immediately.
Confirming with git master.
Created attachment 247397 [details] [review] Bug 698190 - Update visible column on reset to defaults The added boolean in the function is to avoid duplicating logic, especially considering the patch for Bug 374661 would add even more logic.
Review of attachment 247397 [details] [review]: ::: src/nautilus-list-view.c @@ +2742,2 @@ nautilus_list_view_set_zoom_level (NAUTILUS_LIST_VIEW (view), get_default_zoom_level (), FALSE); set_columns_settings_from_metadata_and_preferences (NAUTILUS_LIST_VIEW (view)); I don't think you need to still call set_columns_settings_from_metadata_and_preferences() here. Basically you want to get exactly the same effect of calling column_chooser_use_default_callback(). It seems to me a cleaner refactor would be splitting two functions to get default values out of get_column_order() and get_visible_columns() (e.g. get_default_column_order() and get_default_visible_columns()) that would still be called by those as fallback when there's no metadata, and explicitly both here and in column_chooser_use_default_callback() - i.e. where you passed use_prefs=FALSE in your patch.
(In reply to comment #3) > Review of attachment 247397 [details] [review]: > > ::: src/nautilus-list-view.c > @@ +2742,2 @@ > nautilus_list_view_set_zoom_level (NAUTILUS_LIST_VIEW (view), > get_default_zoom_level (), FALSE); > set_columns_settings_from_metadata_and_preferences (NAUTILUS_LIST_VIEW > (view)); > > I don't think you need to still call > set_columns_settings_from_metadata_and_preferences() here. Basically you want > to get exactly the same effect of calling > column_chooser_use_default_callback(). > > It seems to me a cleaner refactor would be splitting two functions to get > default values out of get_column_order() and get_visible_columns() (e.g. > get_default_column_order() and get_default_visible_columns()) that would still > be called by those as fallback when there's no metadata, and explicitly both > here and in column_chooser_use_default_callback() - i.e. where you passed > use_prefs=FALSE in your patch.
Created attachment 247412 [details] [review] Bug 698190 - Update visible column on reset to defaults v2 Ignore the prior comment, stupid bugzilla.... (In reply to comment #3) > Review of attachment 247397 [details] [review]: > > ::: src/nautilus-list-view.c > @@ +2742,2 @@ > nautilus_list_view_set_zoom_level (NAUTILUS_LIST_VIEW (view), > get_default_zoom_level (), FALSE); > set_columns_settings_from_metadata_and_preferences (NAUTILUS_LIST_VIEW > (view)); > Fixed > I don't think you need to still call > set_columns_settings_from_metadata_and_preferences() here. Basically you want > to get exactly the same effect of calling > column_chooser_use_default_callback(). > > It seems to me a cleaner refactor would be splitting two functions to get > default values out of get_column_order() and get_visible_columns() (e.g. > get_default_column_order() and get_default_visible_columns()) that would still > be called by those as fallback when there's no metadata, and explicitly both > here and in column_chooser_use_default_callback() - i.e. where you passed > use_prefs=FALSE in your patch. Done
Review of attachment 247412 [details] [review]: Looks great, thanks.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.