From 2dc1942680345477249bfe60b53ba6c60e5626643493affd29d1751e9d6ebc0e Mon Sep 17 00:00:00 2001 From: Wolfgang Bauer Date: Fri, 22 Mar 2019 12:39:48 +0000 Subject: [PATCH] Accepting request 687022 from home:wolfi323:test - Add Add-runtime-guard-that-pages-are-KCMs-in-KCMultiDialog.patch to fix Kontact crash when opening its settings (kde#405440) OBS-URL: https://build.opensuse.org/request/show/687022 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kcmutils?expand=0&rev=174 --- ...that-pages-are-KCMs-in-KCMultiDialog.patch | 46 +++++++++++++++++++ kcmutils.changes | 6 +++ kcmutils.spec | 3 ++ 3 files changed, 55 insertions(+) create mode 100644 Add-runtime-guard-that-pages-are-KCMs-in-KCMultiDialog.patch diff --git a/Add-runtime-guard-that-pages-are-KCMs-in-KCMultiDialog.patch b/Add-runtime-guard-that-pages-are-KCMs-in-KCMultiDialog.patch new file mode 100644 index 0000000..9e35f6a --- /dev/null +++ b/Add-runtime-guard-that-pages-are-KCMs-in-KCMultiDialog.patch @@ -0,0 +1,46 @@ +From d9ddd3524535ecb5debc2157ddf02922b6bb1685 Mon Sep 17 00:00:00 2001 +From: David Edmundson +Date: Tue, 19 Mar 2019 18:23:24 +0100 +Subject: Add runtime guard that pages are KCMs in KCMultiDialog + +Summary: +This situation can come up if a KCMultiDialog subclass adds pages +directly that aren't KCModules. + +BUG: 405440 + +Test Plan: acheronuk tested this patch on a crashing example + +Subscribers: kde-frameworks-devel + +Tags: #frameworks + +Differential Revision: https://phabricator.kde.org/D19888 +--- + src/kcmultidialog.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/kcmultidialog.cpp b/src/kcmultidialog.cpp +index 9ddd43b..b689f27 100644 +--- a/src/kcmultidialog.cpp ++++ b/src/kcmultidialog.cpp +@@ -99,7 +99,6 @@ void KCMultiDialogPrivate::_k_slotCurrentPageChanged(KPageWidgetItem *current, K + currentModule = modules[i].kcm; + } + } +- Q_ASSERT(currentModule); + + // For some reason the KCModuleQml modules handle their own margin internally + // to match that we need to adjust the spacing of our page widget +@@ -108,7 +107,7 @@ void KCMultiDialogPrivate::_k_slotCurrentPageChanged(KPageWidgetItem *current, K + + // TODO KF6 Fix this situation. + +- if (currentModule->realModule() && currentModule->realModule()->inherits("KCModuleQml")) { ++ if (currentModule && currentModule->realModule() && currentModule->realModule()->inherits("KCModuleQml")) { + bool padHackLeft = false; + bool padHackRight = false; + if (q->pageWidget()->model()->rowCount() < 2) { +-- +cgit v1.1 + diff --git a/kcmutils.changes b/kcmutils.changes index 00446eb..f291f4c 100644 --- a/kcmutils.changes +++ b/kcmutils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 20 17:03:22 UTC 2019 - wbauer@tmo.at + +- Add Add-runtime-guard-that-pages-are-KCMs-in-KCMultiDialog.patch + to fix Kontact crash when opening its settings (kde#405440) + ------------------------------------------------------------------- Sun Mar 10 20:15:35 UTC 2019 - lbeltrame@kde.org diff --git a/kcmutils.spec b/kcmutils.spec index 8c949cc..bcd715b 100644 --- a/kcmutils.spec +++ b/kcmutils.spec @@ -32,6 +32,8 @@ Group: System/GUI/KDE URL: https://www.kde.org Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-UPSTREAM +Patch0: Add-runtime-guard-that-pages-are-KCMs-in-KCMultiDialog.patch BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version} BuildRequires: fdupes @@ -86,6 +88,7 @@ created with the KConfigWidgets framework. Development files. %if 0%{?suse_version} == 1500 sed -i -e "s/^set *(REQUIRED_QT_VERSION 5.10.0)$/set(REQUIRED_QT_VERSION 5.9.0)/" CMakeLists.txt %endif +%autopatch -p1 %build %cmake_kf5 -d build