Fix resetting "View Modes" preferences to defaults
ClosedPublic

Authored by hoffmannrobert on Jan 30 2018, 10:50 AM.

Details

Summary

Removed call to settings.readConfig() in ViewSettingsTab::loadSettings(),
because it overwrites default settings with user settings even if called
from ViewSettingsTab::restoreDefaultSettings().

Test Plan

Settings -> Configure Dolphin -> View Modes:
Choose "Custom Font", "Choose...": other font settings than preselected;
alter "Icon Size" slider positions;
click OK; OK;
note modified text font next to icons, icon sizes

Settings -> Configure Dolphin -> View Modes:
Click "Defaults"
check "Font" is reset to "System Font";
check "Icon Size" slider positions are reset to default positions;
click OK
check text font next to icons, icon sizes are reset to defaults

Diff Detail

Repository
R318 Dolphin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Restricted Application added a subscriber: Dolphin. · View Herald TranscriptJan 30 2018, 10:50 AM
hoffmannrobert requested review of this revision.Jan 30 2018, 10:50 AM

This might interest you too.

elvisangelaccio added inline comments.
src/settings/viewmodes/viewsettingstab.cpp
236

This was added to fix https://bugs.kde.org/show_bug.cgi?id=292698

Can you please check that this patch does not reintroduce that bug?

ltoscano added a subscriber: ltoscano.

Please also reduce the length of the description (first line): https://chris.beams.io/posts/git-commit/

hoffmannrobert retitled this revision from This fixes the bug that font and other settings in "View Modes" preferences cannot be reset to their defaults. to Fix resetting "View Modes" preferences to defaults.Jan 31 2018, 9:50 AM
hoffmannrobert marked an inline comment as done.Jan 31 2018, 10:10 AM

I changed the title of this revision. Is this sufficient or is a new commit needed?

src/settings/viewmodes/viewsettingstab.cpp
236

I checked https://bugs.kde.org/show_bug.cgi?id=292698 , tried out to reproduce the described behaviour using scenarios from description and comment 2: https://bugs.kde.org/show_bug.cgi?id=292698#c2

Icons stay at the expected size set in the status bar when changing font width in the settings. Icons don't change sizes unexpectedly.

hoffmannrobert marked an inline comment as done.Jan 31 2018, 10:11 AM

I changed the title of this revision. Is this sufficient or is a new commit needed?

Sufficient.

Can you please expand the "Test Plan" section with details on how to reproduce the issue fixed by this patch?

hoffmannrobert edited the test plan for this revision. (Show Details)Feb 5 2018, 11:40 AM
hoffmannrobert edited the test plan for this revision. (Show Details)
src/settings/viewmodes/viewsettingstab.cpp
235–236

Makes sense and fixes the bug. But please make the settings variable const, like it was before the readConfig() call was added.

hoffmannrobert edited the test plan for this revision. (Show Details)
  • Make settings const, request by elvisangelaccio
hoffmannrobert marked an inline comment as done.Feb 12 2018, 7:38 PM
elvisangelaccio accepted this revision.Feb 13 2018, 10:17 PM
This revision is now accepted and ready to land.Feb 13 2018, 10:17 PM
This revision was automatically updated to reflect the committed changes.