Hello community, here is the log from the commit of package kconfig for openSUSE:Factory checked in at 2015-05-18 22:19:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kconfig (Old) and /work/SRC/openSUSE:Factory/.kconfig.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kconfig" Changes: -------- --- /work/SRC/openSUSE:Factory/kconfig/kconfig.changes 2015-05-11 19:47:44.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kconfig.new/kconfig.changes 2015-05-18 22:19:10.000000000 +0200 @@ -1,0 +2,11 @@ +Sun May 17 18:54:53 UTC 2015 - [email protected] + +- Comment out 0001-ensure-platform-window-resize-processing.patch, + causes bad side-effects (kde#344183,boo#931167) + +------------------------------------------------------------------- +Tue May 12 13:17:01 UTC 2015 - [email protected] + +- Added 0001-Add-KConfigGui-setSessionConfig.patch (kde#346768) + +------------------------------------------------------------------- New: ---- 0001-Add-KConfigGui-setSessionConfig.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kconfig.spec ++++++ --- /var/tmp/diff_new_pack.QlBQpG/_old 2015-05-18 22:19:11.000000000 +0200 +++ /var/tmp/diff_new_pack.QlBQpG/_new 2015-05-18 22:19:11.000000000 +0200 @@ -40,6 +40,8 @@ Source1: baselibs.conf # PATCH-FIX-UPSTREAM 0001-ensure-platform-window-resize-processing.patch -- https://git.reviewboard.kde.org/r/119593/ Patch0: 0001-ensure-platform-window-resize-processing.patch +# PATCH-FIX-UPSTREAM 0001-Add-KConfigGui-setSessionConfig.patch +Patch1: 0001-Add-KConfigGui-setSessionConfig.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -123,7 +125,8 @@ %lang_package -n libKF5ConfigCore%sonum %prep %setup -q -%patch0 -p1 +#patch0 -p1 +%patch1 -p1 %build %cmake_kf5 -d build -- -Dlconvert_executable=%{_kf5_libdir}/qt5/bin/lconvert ++++++ 0001-Add-KConfigGui-setSessionConfig.patch ++++++ >From 9978cfd5ccd18509dd514b3a7ada8c158c209de1 Mon Sep 17 00:00:00 2001 From: Stefan Becker <[email protected]> Date: Sat, 9 May 2015 17:16:27 +0300 Subject: [PATCH 1/1] Add KConfigGui::setSessionConfig() When the application receives a saveState signal it needs to replace the current KConfig object with a new one based on the QSessionManager information. Add a new interface that accepts the new session id and key. BUG: 346768 REVIEW: 123705 --- src/gui/kconfiggui.cpp | 41 ++++++++++++++++++++++++++++++++--------- src/gui/kconfiggui.h | 17 +++++++++++++++-- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/gui/kconfiggui.cpp b/src/gui/kconfiggui.cpp index 0048c60aacbc2fa484491889abb6450777a222d3..67b6009a68cf3264f116231e3e9933cc31b9deca 100644 --- a/src/gui/kconfiggui.cpp +++ b/src/gui/kconfiggui.cpp @@ -25,28 +25,51 @@ #include <kconfig.h> +static QString configName(const QString &id, const QString &key) +{ + return(QLatin1String("session/") + QGuiApplication::applicationName() + + QLatin1Char('_') + id + + QLatin1Char('_') + key); +} + static KConfig *s_sessionConfig = Q_NULLPTR; KConfig *KConfigGui::sessionConfig() { - if (!s_sessionConfig) { // create an instance specific config object - s_sessionConfig = new KConfig(sessionConfigName(), KConfig::SimpleConfig); +#ifdef QT_NO_SESSIONMANAGER +#error QT_NO_SESSIONMANAGER was set, this will not compile. Reconfigure Qt with Session management support. +#endif + if (!hasSessionConfig()) { + // create the default instance specific config object + // from applications' -session command line parameter + s_sessionConfig = new KConfig(configName(qApp->sessionId(), + qApp->sessionKey()), + KConfig::SimpleConfig); } + return s_sessionConfig; } +void KConfigGui::setSessionConfig(const QString &id, const QString &key) +{ + if (hasSessionConfig()) { + delete s_sessionConfig; + s_sessionConfig = Q_NULLPTR; + } + + // create a new instance specific config object from supplied id & key + s_sessionConfig = new KConfig(configName(id, key), + KConfig::SimpleConfig); +} + bool KConfigGui::hasSessionConfig() { return s_sessionConfig != Q_NULLPTR; } +#ifndef KDE_NO_DEPRECATED QString KConfigGui::sessionConfigName() { -#ifdef QT_NO_SESSIONMANAGER -#error QT_NO_SESSIONMANAGER was set, this will not compile. Reconfigure Qt with Session management support. -#endif - const QString sessionKey = qApp->sessionKey(); - const QString sessionId = qApp->sessionId(); - return QString(QLatin1String("session/%1_%2_%3")).arg(QGuiApplication::applicationName()).arg(sessionId).arg(sessionKey); + return sessionConfig()->name(); } - +#endif diff --git a/src/gui/kconfiggui.h b/src/gui/kconfiggui.h index 173400fd797ae4b92974a05d956d740921d2fa92..fe1f820014794a4cab52df15e5a7459684b1c38f 100644 --- a/src/gui/kconfiggui.h +++ b/src/gui/kconfiggui.h @@ -31,7 +31,7 @@ class KConfig; namespace KConfigGui { /** - * Returns the application session config object. + * Returns the current application session config object. * * @return A pointer to the application's instance specific * KConfig object. @@ -40,6 +40,16 @@ namespace KConfigGui KCONFIGGUI_EXPORT KConfig *sessionConfig(); /** + * Replaces the current application session config object. + * + * @param id new session id + * @param key new session key + * + * @since 5.11 + */ +KCONFIGGUI_EXPORT void setSessionConfig(const QString &id, const QString &key); + +/** * Indicates if a session config has been created for that application * (ie. if sessionConfig() got called at least once) * @@ -51,8 +61,11 @@ KCONFIGGUI_EXPORT bool hasSessionConfig(); * Returns the name of the application session * * @return the application session name + * @deprecated since 5.11, use sessionConfig()->name() */ -KCONFIGGUI_EXPORT QString sessionConfigName(); +#ifndef KDE_NO_DEPRECATED +KCONFIGGUI_DEPRECATED_EXPORT QString sessionConfigName(); +#endif } #endif // KCONFIGGUI_H -- 2.3.7
