Accepting request 336235 from home:wolfi323:branches:KDE:Applications
Add create_state_dir.patch: fixes saving of the game state on exit when the application directory doesn't exist yet (boo#948289, kde#350160) OBS-URL: https://build.opensuse.org/request/show/336235 OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/kpat?expand=0&rev=18
This commit is contained in:
parent
fa9dd59b47
commit
3c96a8cd4d
39
create_state_dir.patch
Normal file
39
create_state_dir.patch
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
From: Wolfgang Bauer <wbauer@tmo.at>
|
||||||
|
Date: Sat, 03 Oct 2015 19:25:07 +0000
|
||||||
|
Subject: Create application directory if it doesn't exist
|
||||||
|
X-Git-Url: http://quickgit.kde.org/?p=kpat.git&a=commitdiff&h=a214428743993ac1ede3fa48d757ca339f498fd9
|
||||||
|
---
|
||||||
|
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.
|
||||||
|
|
||||||
|
BUG: 350160
|
||||||
|
FIXED-IN: 15.08.2
|
||||||
|
REVIEW: 125508
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
--- a/mainwindow.cpp
|
||||||
|
+++ b/mainwindow.cpp
|
||||||
|
@@ -756,7 +756,14 @@
|
||||||
|
|
||||||
|
void MainWindow::closeEvent(QCloseEvent *e)
|
||||||
|
{
|
||||||
|
- QString stateFileName = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + saved_state_file ;
|
||||||
|
+ QString stateDirName = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
|
||||||
|
+ QString stateFileName = stateDirName + QLatin1Char('/') + saved_state_file ;
|
||||||
|
+ QDir stateFileDir(stateDirName);
|
||||||
|
+ if(!stateFileDir.exists())
|
||||||
|
+ {
|
||||||
|
+ //create the directory if it doesn't exist (bug#350160)
|
||||||
|
+ stateFileDir.mkpath(QStringLiteral("."));
|
||||||
|
+ }
|
||||||
|
QFile stateFile( stateFileName );
|
||||||
|
|
||||||
|
// Remove the existing state file, if any.
|
||||||
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Oct 3 19:39:24 UTC 2015 - wbauer@tmo.at
|
||||||
|
|
||||||
|
- Add create_state_dir.patch: fixes saving of the game state on
|
||||||
|
exit when the application directory doesn't exist yet
|
||||||
|
(boo#948289, kde#350160)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Sep 13 19:22:26 UTC 2015 - tittiatcoke@gmail.com
|
Sun Sep 13 19:22:26 UTC 2015 - tittiatcoke@gmail.com
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@ Url: http://www.kde.org
|
|||||||
Version: 15.08.1
|
Version: 15.08.1
|
||||||
Release: 0
|
Release: 0
|
||||||
Source0: kpat-%{version}.tar.xz
|
Source0: kpat-%{version}.tar.xz
|
||||||
|
# PATCH-FIX-UPSTREAM create_state_dir.patch boo#948289, kde#350160 -- fixes saving of the game state on exit when the application directory doesn't exist yet
|
||||||
|
Patch: create_state_dir.patch
|
||||||
BuildRequires: libkdegames-devel
|
BuildRequires: libkdegames-devel
|
||||||
BuildRequires: update-desktop-files
|
BuildRequires: update-desktop-files
|
||||||
BuildRequires: extra-cmake-modules
|
BuildRequires: extra-cmake-modules
|
||||||
@ -64,6 +66,7 @@ more. The game has nice graphics and many different carddecks.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake_kf5 -d build
|
%cmake_kf5 -d build
|
||||||
|
Loading…
Reference in New Issue
Block a user