After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698190 - Reset View to Defaults does not update visible columns immediately
Reset View to Defaults does not update visible columns immediately
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Views: List View
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-17 12:56 UTC by Adam Dingle
Modified: 2013-06-21 15:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bug 698190 - Update visible column on reset to defaults (5.85 KB, patch)
2013-06-21 02:09 UTC, Garrett Regier
reviewed Details | Review
Bug 698190 - Update visible column on reset to defaults v2 (5.00 KB, patch)
2013-06-21 08:24 UTC, Garrett Regier
committed Details | Review

Description Adam Dingle 2013-04-17 12:56:50 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.
Comment 1 Cosimo Cecchi 2013-04-25 20:46:32 UTC
Confirming with git master.
Comment 2 Garrett Regier 2013-06-21 02:09:33 UTC
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.
Comment 3 Cosimo Cecchi 2013-06-21 07:00:24 UTC
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.
Comment 4 Garrett Regier 2013-06-21 08:23:32 UTC
(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.
Comment 5 Garrett Regier 2013-06-21 08:24:26 UTC
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
Comment 6 Cosimo Cecchi 2013-06-21 15:32:05 UTC
Review of attachment 247412 [details] [review]:

Looks great, thanks.
Comment 7 Garrett Regier 2013-06-21 15:37:01 UTC
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.