Bug 337826

Summary: Computer player's name is not remembered
Product: [Unmaintained] ktron Reporter: Karthik Periagaram <karthik.periagaram>
Component: generalAssignee: Stas Verberkt <kde>
Status: RESOLVED FIXED    
Severity: normal CC: chaofeng111, kde-games-bugs, stephen.c.michalski
Priority: NOR Keywords: junior-jobs
Version First Reported In: 2.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Start and end of a 5-round game
Change default name from "Player n" to "KSnakeDuel".
Fix for issue #337826
Fix with indentation respect.

Description Karthik Periagaram 2014-07-27 04:54:10 UTC
Created attachment 87973 [details]
Start and end of a 5-round game

The attached montage shows the beginning and end of the first game showing the inconsistent references to the computer player's name. This is set to "Player 2" by default in the configuration settings.

The status bar identifies the computer player as Player 2 at the beginning. However, at the end of the game, the status bar identifies the computer player as KSnakeDuel. The notification message always refers to the computer player as KSnakeDuel.

The expected behavior is that the default name should be set to KSnakeDuel and all messages should use the provided name in the statusbar and notification messages.

The fix is likely to be trivial, so please mark this as a junior job.
Comment 1 Stephen Michalski 2014-09-12 07:51:49 UTC
Created attachment 88671 [details]
Change default name from "Player n" to "KSnakeDuel".
Comment 2 Stephen Michalski 2014-09-12 08:06:07 UTC
Posted patch does not fix issue. I posted the patch without testing all possible/feasible cases.
Comment 3 Stephen Michalski 2014-09-12 21:19:01 UTC
Created attachment 88683 [details]
Fix for issue #337826

Calls to loadSettings for Tron and KTron implementations were out of order, causing old values to be displayed until a paintEvent was triggered by pressing movement keys to start a new game. The default value for the second player has also been changed to "KSnakeDuel".
Comment 4 Stephen Michalski 2014-09-13 01:04:35 UTC
Created attachment 88688 [details]
Fix with indentation respect.

Fix with indentation respect.