Always save view settings when switching from one view mode to another
ClosedPublic

Authored by meven on Tue, May 28, 11:36 AM.

Details

Summary
  • Add zoom setings for each view kind
  • Save and restore zoom when view is changed
  • Add default icon size of 64 px for icons view and 32px for compact view

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
meven created this revision.Tue, May 28, 11:36 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptTue, May 28, 11:36 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
meven requested review of this revision.Tue, May 28, 11:36 AM
meven updated this revision to Diff 58779.Tue, May 28, 11:43 AM

Make the expanded detail view and the regular one share the same zoom setting

meven updated this revision to Diff 58780.Tue, May 28, 11:50 AM

Removing parent commit

Nice! What do you think about moving the if (configGroup && itemView) { into the new function and calling it something more conditional, like writeIconZoomSettingsIfNeeded? Also it seems like there could be some code shared in a new function so that KDirOperator::Private::iconSizeForViewType() and KDirOperator::Private::writeIconZoomSettings() don't have to have so much duplicated code. They're both in the same scope so they have access to the same set of variables which should hopefully make it possible.

meven updated this revision to Diff 58811.Wed, May 29, 7:12 AM

Rename writeIconZoomSettings to writeIconZoomSettingsIfNeeded, some code improvements

meven updated this revision to Diff 58816.Wed, May 29, 7:40 AM

Add a zoomSettingsForViewForView to group viewKind to zoom setting name and default value

meven added a comment.Wed, May 29, 7:40 AM

Nice! What do you think about moving the if (configGroup && itemView) { into the new function and calling it something more conditional, like writeIconZoomSettingsIfNeeded? Also it seems like there could be some code shared in a new function so that KDirOperator::Private::iconSizeForViewType() and KDirOperator::Private::writeIconZoomSettings() don't have to have so much duplicated code. They're both in the same scope so they have access to the same set of variables which should hopefully make it possible.

I did your two nice suggestions. See writeIconZoomSettingsIfNeeded and zoomSettingsForViewForView.

meven added inline comments.Wed, May 29, 2:13 PM
src/filewidgets/kdiroperator.cpp
2700

Perhaps we could use a more sensible default value for ColumnView.

What would you say about 32px ?

meven updated this revision to Diff 58854.Wed, May 29, 3:24 PM

Rebasing

meven marked an inline comment as done.Wed, May 29, 3:26 PM
ngraham added inline comments.Wed, May 29, 6:10 PM
src/filewidgets/kdiroperator.cpp
2700

That sounds like a good default size.

meven marked an inline comment as done.Fri, May 31, 6:58 AM
meven added a comment.Sun, Jun 2, 8:00 PM

With D21315 landing, great time to have a look at this review ;)

Could you rebase this on current master? It doesn't apply for me right now.

meven updated this revision to Diff 59058.Mon, Jun 3, 10:12 AM

Rebasing on master

meven added a comment.Mon, Jun 3, 10:12 AM

Could you rebase this on current master? It doesn't apply for me right now.

Thanks, I forgot to do it ;) Should be fixed now.

ngraham accepted this revision.Mon, Jun 3, 1:39 PM

If you're going to rename the functions because these actions no longer really toggle anything, I think we need to keep a verb in there. Suggest something like _k_slotShowDetailsView or _k_slotSwitchToDetailsView

Otherwise LGTM in terms of code and behavior!

This revision is now accepted and ready to land.Mon, Jun 3, 1:39 PM
meven added a comment.Mon, Jun 3, 6:01 PM

If you're going to rename the functions because these actions no longer really toggle anything, I think we need to keep a verb in there. Suggest something like _k_slotShowDetailsView or _k_slotSwitchToDetailsView

I was renaming those just to be consistent with the already existing similar functions _k_slotDetailedView() _k_slotSimpleView() _k_slotTreeView() and _k_slotDetailedTreeView.
I don't have a strong opinion about adding a verb or keeping as it is now.
Given the added information, I will follow recommendation.

meven edited the summary of this revision. (Show Details)Mon, Jun 3, 6:01 PM
meven edited the summary of this revision. (Show Details)Tue, Jun 4, 9:10 AM
meven added a comment.Thu, Jun 6, 6:48 AM

Any feedback @ngraham ?

Your reasoning makes sense. Shipit! :)

meven edited the summary of this revision. (Show Details)Thu, Jun 6, 5:40 PM
This revision was automatically updated to reflect the committed changes.