Hello community, here is the log from the commit of package kxmlgui for openSUSE:Factory checked in at 2015-05-18 21:28:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kxmlgui (Old) and /work/SRC/openSUSE:Factory/.kxmlgui.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kxmlgui" Changes: -------- --- /work/SRC/openSUSE:Factory/kxmlgui/kxmlgui.changes 2015-05-11 19:48:25.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kxmlgui.new/kxmlgui.changes 2015-05-18 21:29:01.000000000 +0200 @@ -1,0 +2,5 @@ +Tue May 12 13:19:07 UTC 2015 - [email protected] + +- Add 0001-Add-session-management-for-KMainWindow.patch (kde#346768) + +------------------------------------------------------------------- New: ---- 0001-Add-session-management-for-KMainWindow.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kxmlgui.spec ++++++ --- /var/tmp/diff_new_pack.Wwlth7/_old 2015-05-18 21:29:02.000000000 +0200 +++ /var/tmp/diff_new_pack.Wwlth7/_new 2015-05-18 21:29:02.000000000 +0200 @@ -51,6 +51,8 @@ Url: http://www.kde.org Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-UPSTREAM 0001-Add-session-management-for-KMainWindow.patch +Patch0: 0001-Add-session-management-for-KMainWindow.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -93,6 +95,7 @@ %lang_package -n %lname %prep %setup -q +%patch0 -p1 %build %cmake_kf5 -d build -- -DSYSCONF_INSTALL_DIR=%{_kf5_sysconfdir} ++++++ 0001-Add-session-management-for-KMainWindow.patch ++++++ >From fa86f6e4afd4a4f32d297f271d3daececc6c0ba4 Mon Sep 17 00:00:00 2001 From: Stefan Becker <[email protected]> Date: Sat, 9 May 2015 17:17:25 +0300 Subject: [PATCH 1/1] Add session management for KMainWindow - replace the KConfig object in KConfigGui with a new one using the session id and key from the QSessionManager object - make sure that the data is stored after the application has update it - if the KConfig object is represented by a local file then add a discard command to the session manager object BUG: 346768 REVIEW: 123706 --- src/kmainwindow.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/kmainwindow.cpp b/src/kmainwindow.cpp index 15eecb7c1b2aae0691db2680b9e8400d6eb715ab..7c868417030f95cf575f04783894c8f62e1b354b 100644 --- a/src/kmainwindow.cpp +++ b/src/kmainwindow.cpp @@ -127,8 +127,10 @@ KMWSessionManager::~KMWSessionManager() { } -bool KMWSessionManager::saveState(QSessionManager &) +bool KMWSessionManager::saveState(QSessionManager &sm) { + KConfigGui::setSessionConfig(sm.sessionId(), sm.sessionKey()); + KConfig *config = KConfigGui::sessionConfig(); if (KMainWindow::memberList().count()) { // According to Jochen Wilhelmy <[email protected]>, this @@ -144,6 +146,19 @@ bool KMWSessionManager::saveState(QSessionManager &) KConfigGroup group(config, "Number"); group.writeEntry("NumberOfWindows", n); + + // store new status to disk + config->sync(); + + // generate discard command for new file + QString localFilePath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + config->name(); + if (QFile::exists(localFilePath)) { + QStringList discard; + discard << QLatin1String("rm"); + discard << localFilePath; + sm.setDiscardCommand(discard); + } + return true; } -- 2.3.7
