Bug 450444

Summary: First run gives ugly unable to load tileset/background errors to user.
Product: [Applications] kshisen Reporter: Andrew Macks <andypoo>
Component: generalAssignee: Frederik Schwarzer <schwarzer>
Status: RESOLVED FIXED    
Severity: normal CC: kde-games-bugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Proposed workaround.

Description Andrew Macks 2022-02-17 11:38:07 UTC
Created attachment 146859 [details]
Proposed workaround.

SUMMARY
When starting kshisen for the first time on a fresh installation without ~/.config/kshisenrc in place, 


STEPS TO REPRODUCE
1. rm ~/.config/kshisenrc
2. kshisen

OBSERVED RESULT
Two modal dialog boxes one after the other complaining about inability to load tileset and background.

EXPECTED RESULT
No unusual error messages on first run.

SOFTWARE/OS VERSIONS
All

ADDITIONAL INFORMATION
kmahjongg (which uses the same tileset/background loading logic) actually as a silent debug message in this situation, but in kshisen it is a user-facing error dialog.

I have provided a proposed patch (untested, as I don't currently have the kde build environment on this PC), but should be fairly straightforward.  It only silences the error in the case where the functions were asked to load an "empty" background/tileset, and then it loads the default.  It still surfaces an error if the user has deleted an explicitly defined tileset/background and they can no longer be found.

An alternative would be to make the error completely silent like in kmahjongg.  I felt this was a better approach to keep with the idea of the dialog, but without it happening on first run (which simply gives a bad initial experience and feels like KDE/distribution install and/or game is buggy).
Comment 1 Andrew Macks 2022-02-17 11:40:10 UTC
Just thought I'd note, this error has been present for at least a couple of years.  I didn't look into its history.

I do a lot of new machine installs, and often use kshisen to test touchscreens, so have seen it a lot, but haven't got around to reporting.
Comment 2 Bug Janitor Service 2022-02-17 14:16:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/games/kshisen/-/merge_requests/3
Comment 3 Albert Astals Cid 2022-02-21 13:20:58 UTC
Git commit fa2745189b8484817fa15f37e1f6aba29f32a60e by Albert Astals Cid.
Committed on 17/02/2022 at 14:15.
Pushed by aacid into branch 'master'.

Don't report incorrect error when starting the game for the fist time

M  +55   -7    src/board.cpp

https://invent.kde.org/games/kshisen/commit/fa2745189b8484817fa15f37e1f6aba29f32a60e