Bug 305036

Summary: Shuffle corrupts tile selection
Product: [Applications] kmahjongg Reporter: Jan-Peter Nilsson <kdebugs>
Component: generalAssignee: Christian Krippendorf <CerebrosuS>
Status: RESOLVED FIXED    
Severity: minor CC: kde-games-bugs
Priority: NOR    
Version: 0.8   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.1
Sentry Crash Report:
Attachments: Patch for clearing selections during shuffle

Description Jan-Peter Nilsson 2012-08-12 17:51:19 UTC
Shuffling while having one tile selected will result in the same position being selected afterwards, but the selected tile type is still that of the originally selected tile.

Reproducible: Always

Steps to Reproduce:
1. Select a tile
2. Shuffle until the selected tile becomes a different type
3. Select a tile of the same type as the one originally selected
Actual Results:  
The two unmatching tiles are considered a match and removed

Expected Results:  
Tiles of different type should not match
Comment 1 Jan-Peter Nilsson 2012-08-12 17:53:59 UTC
Created attachment 73122 [details]
Patch for clearing selections during shuffle

I see three possible solutions:
1. The selection location follows the original tile if possible (otherwise clear the selection)
2. The selection is properly updated to whatever tile is at the selected location after the shuffle
3. Any selection is cleared by shuffle

Alternative 3 makes most sense to me.
Comment 2 Christian Krippendorf 2012-08-12 18:55:42 UTC
Thanks for taking time to report this bug.

For me the third solution looks also as the best one. Thanks for the patch. I will have a look at it.
Comment 3 Christian Krippendorf 2012-08-26 16:27:01 UTC
SVN commit 1313425 by krippendorf:

Solve a bug with suffle while a tile is selected.

FIXED-IN: 4.9.1


 M  +1 -0      boardwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1313425
Comment 4 Jan-Peter Nilsson 2013-07-30 21:08:27 UTC
I noticed this problem seems to remain, looking at the git repository (git://anongit.kde.org/kmahjongg) I can't find the change.
Was the change just applied in the 4.9 branch in subversion and not carried forward or am I looking in the wrong place?
Comment 5 Christoph Feck 2013-08-11 12:11:16 UTC
Git commit 3e49459fba46dba581b36f92ccfa80092116e5fe by Christoph Feck, on behalf of Christian Krippendorf.
Committed on 26/08/2012 at 16:26.
Pushed by cfeck into branch 'master'.

Solve a bug with suffle while a tile is selected.
FIXED-IN: 4.9.1

svn path=/branches/KDE/4.9/kdegames/kmahjongg/; revision=1313425

(cherry picked from commit 61dbef0e9a15cb2305d29b0654e2eabfeb820111)

M  +3    -2    boardwidget.cpp

http://commits.kde.org/kmahjongg/3e49459fba46dba581b36f92ccfa80092116e5fe
Comment 6 Christoph Feck 2013-08-11 12:13:01 UTC
You are right, it was never in trunk/master. I cherry-picked it to 4.11 and merged to master, so it should not get lost again.