Bug 350160

Summary: save the situation when exit don't work
Product: [Applications] kpat Reporter: andreamal <andreamalfatti>
Component: generalAssignee: Stephan Kulow <coolo>
Status: RESOLVED FIXED    
Severity: minor CC: andreamalfatti, kde-games-bugs, wbauer1
Priority: NOR    
Version: 3.6   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In: 15.08.2
Sentry Crash Report:

Description andreamal 2015-07-13 06:17:27 UTC
In fedora 22 with cinnamon the option "save the situation when exit" don't work. I don't know if don't save or non reload at start.
P.s. sorry for my english

Reproducible: Always

Steps to Reproduce:
1. select option "save the situation when exit" and play a game
2. stop the game and exit
3. restart kpat 
should recharge the previous situation

Actual Results:  
don't recharge the previous situation

Expected Results:  
Fedora 22 wit kernel 4.0.7-300.fc22.x86_64
cinnamon-2.6.7-3.fc22.x86_64

a manual saving can be reloaded manually to workaround the problem
Comment 1 Wolfgang Bauer 2015-09-30 17:35:42 UTC
I can confirm this here with the latest stable version (15.08.1).

This is a regression in the KF5 port, it works fine in the last KDE4 version (14.12.3).
Comment 2 Wolfgang Bauer 2015-09-30 17:54:34 UTC
PS: When I quit kpat with this option enabled, I get this Konsole output:
QIODevice::write (QFile, "/home/wolfi/.local/share/kpat/savedstate.xml"): device not open

I tried to manually create the folder ~/.local/share/kpat/. and now it works!
Comment 3 andreamal 2015-10-01 16:31:43 UTC
I confirm, creating  ~/.local/share/kpat solve the problem.
Comment 4 Wolfgang Bauer 2015-10-03 17:31:58 UTC
This is a KF5 porting bug actually.
KDE4's KStandardDirs created the directory if it doesn't exist, while Qt5's QStandardDirs does not.
The application has to create it if necessary now.

Proposed fix:
https://git.reviewboard.kde.org/r/125508/
Comment 5 Wolfgang Bauer 2015-10-03 19:26:58 UTC
Git commit a214428743993ac1ede3fa48d757ca339f498fd9 by Wolfgang Bauer.
Committed on 03/10/2015 at 19:25.
Pushed by wbauer into branch 'Applications/15.08'.

Create application directory if it doesn't exist

Unlike KStandardDirs, QStandardDirs doesn't guarantee that the returned
directory actually exists, see also
https://community.kde.org/Frameworks/Porting_Notes/KStandardDirs .

This patch checks for the existence of the directory and creates it if
it isn't there, before the game state is saved.
FIXED-IN: 15.08.2
REVIEW: 125508

M  +8    -1    mainwindow.cpp

http://commits.kde.org/kpat/a214428743993ac1ede3fa48d757ca339f498fd9