Bug 398657

Summary: Loading games shouldn’t change the game settings
Product: [Applications] kpat Reporter: Karl Ove Hufthammer <karl>
Component: generalAssignee: Stephan Kulow <coolo>
Status: CONFIRMED ---    
Severity: minor CC: 0inkane, kde-games-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Karl Ove Hufthammer 2018-09-15 09:31:36 UTC
I have set my favourite settings in Klondike to draw 3 cards at a time, as that’s the way I’m used to playing the game. This is correctly remembered by the KPat, so I don’t have to keep selecting it each time. That’s nice. But if I load a saved game which uses a different setting, this also changes the *default* settings (stored in the .config/kpatrc file).

IMHO, simply loading a game shouldn’t change the default settings; it should only change the settings *for that game*. Steps to reproduce:

1. Launch KPat and start a Klondike game.
2. Change ‘Settings → Klondike Options → Draw 1’.
3. Save the game.
4. Change ‘Settings → Klondike Options → Draw 3’.
5. Quit KPat.
1. Launch KPat and start a Klondike game.
7. Observe that the ‘Draw 3’ option is correctly restored, by a) drawing cards, *and* b) checking the ‘Settings → Klondike Options’ menu.
8. Restore the game saved in step 3.
9. Observe that the ‘Draw 1’ setting in the saved games is correctly restored.
10. Quit KPat.
11. Launch KPat and start a Klondike game.
12. Observe that the settings has been changed to ‘Draw 1’.

Steps 1–9 are correct. But changing the *default* settings, done in steps 10–12, should be considered a bug. Expected behaviour would be that the *manually* selected default settings should be respected, i.e. that settings shown in step 12 should be ’Draw 3’.
Comment 1 Fabian 2018-10-12 16:28:31 UTC
I confirm this behaviour and agree that it is a bug. This is due to klondike.cpp unconditionally calling

> Settings::setKlondikeIsDrawOne( easyRules );

in the call chain loadFile > setGameOptions > Klondike::setEasy.
Comment 2 Stephan Kulow 2023-01-18 19:30:23 UTC
I don't disagree that it's strange behaviour - but it's not really a bug. Because if you load a draw 1 game, you want the menu to reflect that. And if you start a game after the save game you also expect it to continue as such. This is not the "default" - it's the current state.

What you're asking for implicitly is to split klondike 1 and klondike 3 into different flavors you can switch between. But I don't think that's going to happen.
Comment 3 Karl Ove Hufthammer 2023-01-18 20:19:23 UTC
(In reply to Stephan Kulow from comment #2)
> I don't disagree that it's strange behaviour - but it's not really a bug.
> Because if you load a draw 1 game, you want the menu to reflect that. And if
> you start a game after the save game you also expect it to continue as such.
> This is not the "default" - it's the current state.
> 
> What you're asking for implicitly is to split klondike 1 and klondike 3 into
> different flavors you can switch between.

Not really. I am OK with the menu reflecting the settings from the loaded game. But the settings from the game should not be saved in  .config/kpatrc. So when quitting and restarting KPat, the settings should be the old/‘default’ (manually chosen) settings, not the settings from the game I loaded the previous session.