forked from pool/kdelibs4support
Accepting request 371016 from KDE:Frameworks5
Update to 5.20.0 OBS-URL: https://build.opensuse.org/request/show/371016 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kdelibs4support?expand=0&rev=26
This commit is contained in:
commit
251b9d9e0d
@ -1,123 +0,0 @@
|
||||
From 58e49487aece3de19aae90bbb9b80cd5aab94d04 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Hartmetz <ahartmetz@gmail.com>
|
||||
Date: Fri, 19 Feb 2016 19:49:01 +0100
|
||||
Subject: [PATCH 2/2] Fix session management for KApplication based
|
||||
applications.
|
||||
|
||||
- Call QGuiApplication::setFallbackSessionManagementEnabled(false)
|
||||
to prevent premature application exit
|
||||
- Wire up the saveStateRequest() and commitDataRequest() signals
|
||||
to the appropriate methods that had to be turned into slots first.
|
||||
Those methods were never even called, they were not ported properly.
|
||||
- Cancel logout when the user decides to do that. A comment in the
|
||||
code was not sufficient to do that. (?!?!)
|
||||
|
||||
CCBUG: 354724
|
||||
---
|
||||
src/kdeui/kapplication.cpp | 17 ++++++++++++++++-
|
||||
src/kdeui/kapplication.h | 29 +++++++++++++++--------------
|
||||
2 files changed, 31 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/kdeui/kapplication.cpp b/src/kdeui/kapplication.cpp
|
||||
index d78212a..54fd1de 100644
|
||||
--- a/src/kdeui/kapplication.cpp
|
||||
+++ b/src/kdeui/kapplication.cpp
|
||||
@@ -380,6 +380,9 @@ void KApplicationPrivate::init(bool GUIenabled)
|
||||
parseCommandLine();
|
||||
|
||||
QApplication::setDesktopSettingsAware(false);
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
+ QGuiApplication::setFallbackSessionManagementEnabled(false);
|
||||
+#endif
|
||||
|
||||
#if HAVE_X11
|
||||
isX11 = (QGuiApplication::platformName() == QStringLiteral("xcb"));
|
||||
@@ -472,6 +475,12 @@ void KApplicationPrivate::init(bool GUIenabled)
|
||||
q->connect(KToolInvocation::self(), SIGNAL(kapplication_hook(QStringList&,QByteArray&)),
|
||||
q, SLOT(_k_slot_KToolInvocation_hook(QStringList&,QByteArray&)));
|
||||
|
||||
+ q->connect(q, SIGNAL(commitDataRequest(QSessionManager&)),
|
||||
+ q, SLOT(commitData(QSessionManager&)));
|
||||
+ q->connect(q, SIGNAL(saveStateRequest(QSessionManager&)),
|
||||
+ q, SLOT(saveState(QSessionManager&)));
|
||||
+
|
||||
+
|
||||
#ifdef Q_OS_MAC
|
||||
// This is a QSystemTrayIcon instead of K* because we can't be sure q is a QWidget
|
||||
QSystemTrayIcon *trayIcon; //krazy:exclude=qclasses
|
||||
@@ -577,11 +586,13 @@ void KApplication::commitData(QSessionManager &sm)
|
||||
continue;
|
||||
}
|
||||
|
||||
+ // leave KMainWindows alone because they are handled by KMWSessionManager
|
||||
if (!w->isHidden() && !w->inherits("KMainWindow")) {
|
||||
QCloseEvent e;
|
||||
sendEvent(w, &e);
|
||||
if (!e.isAccepted()) {
|
||||
- break; //canceled
|
||||
+ canceled = true;
|
||||
+ break;
|
||||
}
|
||||
|
||||
donelist.append(w);
|
||||
@@ -597,6 +608,10 @@ void KApplication::commitData(QSessionManager &sm)
|
||||
} else {
|
||||
sm.setRestartHint(QSessionManager::RestartIfRunning);
|
||||
}
|
||||
+
|
||||
+ if (canceled) {
|
||||
+ sm.cancel();
|
||||
+ }
|
||||
d->session_save = false;
|
||||
}
|
||||
|
||||
diff --git a/src/kdeui/kapplication.h b/src/kdeui/kapplication.h
|
||||
index 2231084..c9b1cb6 100644
|
||||
--- a/src/kdeui/kapplication.h
|
||||
+++ b/src/kdeui/kapplication.h
|
||||
@@ -155,20 +155,6 @@ public:
|
||||
void enableSessionManagement();
|
||||
|
||||
/**
|
||||
- * Reimplemented for internal purposes, mainly the highlevel
|
||||
- * handling of session management with KSessionManager.
|
||||
- * @internal
|
||||
- */
|
||||
- void commitData(QSessionManager &sm);
|
||||
-
|
||||
- /**
|
||||
- * Reimplemented for internal purposes, mainly the highlevel
|
||||
- * handling of session management with KSessionManager.
|
||||
- * @internal
|
||||
- */
|
||||
- void saveState(QSessionManager &sm);
|
||||
-
|
||||
- /**
|
||||
* @deprecated since 5.0, use QGuiApplication::isSavingSession()
|
||||
*
|
||||
* Returns true if the application is currently saving its session
|
||||
@@ -359,6 +345,21 @@ public Q_SLOTS:
|
||||
*/
|
||||
Q_SCRIPTABLE void updateUserTimestamp(int time = 0);
|
||||
|
||||
+ /**
|
||||
+ * Slot connected to QGuiApplication::commitDataRequest() to implement highlevel
|
||||
+ * handling of session management with KSessionManager.
|
||||
+ * @internal
|
||||
+ */
|
||||
+ void commitData(QSessionManager &sm);
|
||||
+
|
||||
+ /**
|
||||
+ * Slot connected to QGuiApplication::saveStateRequest() to implement highlevel
|
||||
+ * handling of session management with KSessionManager.
|
||||
+ * @internal
|
||||
+ */
|
||||
+ void saveState(QSessionManager &sm);
|
||||
+
|
||||
+
|
||||
// D-Bus Q_SLOTS:
|
||||
Q_SCRIPTABLE void reparseConfiguration();
|
||||
Q_SCRIPTABLE void quit();
|
||||
--
|
||||
2.6.2
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f60a9b9a950191f5ecbd1fa8a8ccb4ad4327e92e66f3ac0c00c8bb67a4581647
|
||||
size 3225356
|
3
kdelibs4support-5.20.0.tar.xz
Normal file
3
kdelibs4support-5.20.0.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5492e549dc865d56a0da5826fcb9e6e90ed4ba9567107913da0298552172da23
|
||||
size 3227608
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 6 09:56:08 UTC 2016 - hrvoje.senjan@gmail.com
|
||||
|
||||
- Update to 5.20.0 (boo#970856)
|
||||
* Fix session management for KApplication based applications
|
||||
(kde#354724, boo#955280)
|
||||
* For more details please see:
|
||||
https://www.kde.org/announcements/kde-frameworks-5.20.0.php
|
||||
- Drop upstreamed fix-session-saving.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 26 14:59:32 UTC 2016 - wbauer@tmo.at
|
||||
|
||||
|
@ -18,9 +18,9 @@
|
||||
|
||||
%bcond_without lang
|
||||
%define lname libKF5KDELibs4Support5
|
||||
%define _tar_path 5.19
|
||||
%define _tar_path 5.20
|
||||
Name: kdelibs4support
|
||||
Version: 5.19.0
|
||||
Version: 5.20.0
|
||||
Release: 0
|
||||
%define kf5_version %{version}
|
||||
BuildRequires: NetworkManager-devel
|
||||
@ -76,11 +76,9 @@ Group: System/GUI/KDE
|
||||
Url: http://www.kde.org
|
||||
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/portingAids/%{name}-%{version}.tar.xz
|
||||
Source1: baselibs.conf
|
||||
# PATCH-FIX-UPSTREAM fix-session-saving.patch -- kde#354724, boo#955280
|
||||
Patch0: fix-session-saving.patch
|
||||
# PATCH-FIX-UPSTREAM use-setFallbackSessionManagementEnabled-API-with-5.5.1.patch -- We can enable usage of setFallbackSessionManagementEnabled function
|
||||
# with Qt 5.5.1, as we have the qtbase patch backported. -- kde#354724, boo#955280
|
||||
Patch1: use-setFallbackSessionManagementEnabled-API-with-5.5.1.patch
|
||||
# with Qt 5.5.1, as we have the qtbase patch backported. For now only apppy patch on 42.1 Leap, as TW doesn't have that patch yet -- #354724, boo#955280
|
||||
Patch0: use-setFallbackSessionManagementEnabled-API-with-5.5.1.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -194,7 +192,6 @@ KDEDIRS environment variable correctly. Development files.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
%cmake_kf5 -d build
|
||||
@ -222,6 +219,7 @@ KDEDIRS environment variable correctly. Development files.
|
||||
%doc %lang(uk) %{_kf5_mandir}/uk
|
||||
%doc %lang(ca) %{_kf5_htmldir}/ca
|
||||
%doc %lang(de) %{_kf5_htmldir}/de
|
||||
%doc %lang(it) %{_kf5_htmldir}/it
|
||||
%doc %lang(nl) %{_kf5_htmldir}/nl
|
||||
%doc %lang(pt_BR) %{_kf5_htmldir}/pt_BR
|
||||
%doc %lang(sr) %{_kf5_htmldir}/sr
|
||||
|
@ -5,7 +5,7 @@ index 54fd1de..631dc2b 100644
|
||||
@@ -380,7 +380,7 @@ void KApplicationPrivate::init(bool GUIenabled)
|
||||
parseCommandLine();
|
||||
|
||||
QApplication::setDesktopSettingsAware(false);
|
||||
QGuiApplication::setDesktopSettingsAware(false);
|
||||
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
+#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 1)
|
||||
QGuiApplication::setFallbackSessionManagementEnabled(false);
|
||||
|
Loading…
Reference in New Issue
Block a user