* [gentoo-commits] repo/gentoo:master commit in: kde-plasma/khotkeys/, kde-plasma/khotkeys/files/
@ 2017-07-22 7:36 Andreas Sturmlechner
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2017-07-22 7:36 UTC (permalink / raw
To: gentoo-commits
commit: cdcbaf25b1e164c0dd087443e282453cdf6748d0
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 22 07:33:46 2017 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Jul 22 07:36:17 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cdcbaf25
kde-plasma/khotkeys: Fix build with cmake-3.9
Reported-by: Perfect Gentleman <perfect007gentleman <AT> gmail.com>
Gentoo-bug: 625744
Package-Manager: Portage-2.3.6, Repoman-2.3.1
.../khotkeys/files/khotkeys-5.10.4-cmake-3.9.patch | 60 ++++++++++++++++++++++
kde-plasma/khotkeys/khotkeys-5.10.4.ebuild | 2 +
2 files changed, 62 insertions(+)
diff --git a/kde-plasma/khotkeys/files/khotkeys-5.10.4-cmake-3.9.patch b/kde-plasma/khotkeys/files/khotkeys-5.10.4-cmake-3.9.patch
new file mode 100644
index 00000000000..541a184ec8d
--- /dev/null
+++ b/kde-plasma/khotkeys/files/khotkeys-5.10.4-cmake-3.9.patch
@@ -0,0 +1,60 @@
+From db3a04289d0f33285c3ca2d8fc05fc5bb45d608f Mon Sep 17 00:00:00 2001
+From: Heiko Becker <heirecka@exherbo.org>
+Date: Wed, 19 Jul 2017 22:28:32 +0200
+Subject: Make sure the dbus xml interface file exists before it's used
+
+Summary:
+This started to happen with cmake 3.9, producing this erorr:
+*** No rule to make target 'app/org.kde.khotkeys.xml', needed by
+'kcm_hotkeys/khotkeys_interface.cpp'."
+
+Test Plan: Builds fine with cmake 3.9.
+
+Reviewers: #plasma
+
+Subscribers: plasma-devel
+
+Tags: #plasma
+
+Differential Revision: https://phabricator.kde.org/D6792
+---
+ app/CMakeLists.txt | 8 ++++++--
+ kcm_hotkeys/CMakeLists.txt | 1 +
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
+index 0e6609f..2c1485e 100644
+--- a/app/CMakeLists.txt
++++ b/app/CMakeLists.txt
+@@ -1,10 +1,14 @@
+ ########### next target ###############
+
++set(dbus_interface_name org.kde.khotkeys.xml)
+ set(kded_khotkeys_PART_SRCS
+ kded.cpp
+- ${CMAKE_CURRENT_BINARY_DIR}/org.kde.khotkeys.xml)
++ ${CMAKE_CURRENT_BINARY_DIR}/${dbus_interface_name})
+
+-qt5_generate_dbus_interface(kded.h org.kde.khotkeys.xml )
++qt5_generate_dbus_interface(kded.h ${dbus_interface_name})
++set(dbus_interface_xml ${CMAKE_CURRENT_BINARY_DIR}/${dbus_interface_name})
++
++add_custom_target(khotkeysdbusinterface ALL DEPENDS ${dbus_interface_name})
+
+ add_library(kded_khotkeys MODULE ${kded_khotkeys_PART_SRCS})
+ set_target_properties(kded_khotkeys PROPERTIES OUTPUT_NAME khotkeys)
+diff --git a/kcm_hotkeys/CMakeLists.txt b/kcm_hotkeys/CMakeLists.txt
+index f0ef3d3..0df2b5c 100644
+--- a/kcm_hotkeys/CMakeLists.txt
++++ b/kcm_hotkeys/CMakeLists.txt
+@@ -82,6 +82,7 @@ add_library(
+ MODULE
+ ${kcm_hotkeys_PART_SRCS}
+ )
++add_dependencies(kcm_hotkeys khotkeysdbusinterface)
+
+ target_compile_definitions(kcm_hotkeys PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
+
+--
+cgit v0.11.2
+
diff --git a/kde-plasma/khotkeys/khotkeys-5.10.4.ebuild b/kde-plasma/khotkeys/khotkeys-5.10.4.ebuild
index 95b8eaf17fd..aab83644404 100644
--- a/kde-plasma/khotkeys/khotkeys-5.10.4.ebuild
+++ b/kde-plasma/khotkeys/khotkeys-5.10.4.ebuild
@@ -44,3 +44,5 @@ DEPEND="${COMMON_DEPEND}
x11-libs/libXtst
x11-proto/xproto
"
+
+PATCHES=( "${FILESDIR}/${P}-cmake-3.9.patch" )
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: kde-plasma/khotkeys/, kde-plasma/khotkeys/files/
@ 2021-11-23 14:59 Andreas Sturmlechner
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2021-11-23 14:59 UTC (permalink / raw
To: gentoo-commits
commit: df89d8fb9749a7eedcb07c39c964d6a3c42af74a
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 23 10:22:29 2021 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Nov 23 14:59:12 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df89d8fb
kde-plasma/khotkeys: Fix systemsettings crash in hotkeys handling
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=443656
Upstream commit a4137ac8f7b18824568fbee0f3e2dce7551841b7
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
.../khotkeys-5.23.3-delete-widgets-w-entry.patch | 118 +++++++++++++++++++++
kde-plasma/khotkeys/khotkeys-5.23.3-r1.ebuild | 52 +++++++++
2 files changed, 170 insertions(+)
diff --git a/kde-plasma/khotkeys/files/khotkeys-5.23.3-delete-widgets-w-entry.patch b/kde-plasma/khotkeys/files/khotkeys-5.23.3-delete-widgets-w-entry.patch
new file mode 100644
index 000000000000..9e8ae22f2d53
--- /dev/null
+++ b/kde-plasma/khotkeys/files/khotkeys-5.23.3-delete-widgets-w-entry.patch
@@ -0,0 +1,118 @@
+From a4137ac8f7b18824568fbee0f3e2dce7551841b7 Mon Sep 17 00:00:00 2001
+From: Harald Sitter <sitter@kde.org>
+Date: Wed, 13 Oct 2021 13:52:15 +0200
+Subject: [PATCH] when deleting an entry, also delete the widgets
+
+previously what would happen is that KCMHotkeys::currentChanged would
+run, find the new index (-1,-1) now invalid and show the global settings
+instead. this however left the simple_action's underlying widgets still
+sitting around referring to the previous index AND holding a dangling
+trigger point that would eventually crash when the simple_action would
+be poked by anything
+
+instead force unset the internal state of the simple_action when showing
+the global settings.
+
+FIXED-IN: 5.23.5
+BUG: 443656
+
+
+(cherry picked from commit 97f9339fd96d97e012347f8f7fca987bbe4fca0d)
+---
+ kcm_hotkeys/kcm_hotkeys.cpp | 3 +++
+ kcm_hotkeys/simple_action_data_widget.cpp | 18 +++++++++++-------
+ kcm_hotkeys/simple_action_data_widget.h | 3 +++
+ kcm_hotkeys/triggers/trigger_widget_base.cpp | 8 ++++++++
+ 4 files changed, 25 insertions(+), 7 deletions(-)
+
+diff --git a/kcm_hotkeys/kcm_hotkeys.cpp b/kcm_hotkeys/kcm_hotkeys.cpp
+index d3ed315..4dc4664 100644
+--- a/kcm_hotkeys/kcm_hotkeys.cpp
++++ b/kcm_hotkeys/kcm_hotkeys.cpp
+@@ -120,6 +120,9 @@ void KCMHotkeys::currentChanged(const QModelIndex &pCurrent, const QModelIndex &
+ }
+
+ if (!current.isValid()) {
++ if (previous.isValid()) { // throw away old widget and stuff lest we have dangling pointers https://bugs.kde.org/show_bug.cgi?id=443656
++ d->simple_action->unsetActionData();
++ }
+ return showGlobalSettings();
+ }
+
+diff --git a/kcm_hotkeys/simple_action_data_widget.cpp b/kcm_hotkeys/simple_action_data_widget.cpp
+index e20ccaa..eb8c4c1 100644
+--- a/kcm_hotkeys/simple_action_data_widget.cpp
++++ b/kcm_hotkeys/simple_action_data_widget.cpp
+@@ -60,14 +60,22 @@ void SimpleActionDataWidget::doCopyToObject()
+ }
+ }
+
+-void SimpleActionDataWidget::setActionData(KHotKeys::SimpleActionData *pData)
++void SimpleActionDataWidget::unsetActionData()
+ {
+- _data = pData;
++ _data = nullptr;
+
+- // Now go and work on the trigger
+ delete currentTrigger;
+ currentTrigger = nullptr;
+
++ delete currentAction;
++ currentAction = nullptr;
++}
++
++void SimpleActionDataWidget::setActionData(KHotKeys::SimpleActionData *pData)
++{
++ unsetActionData();
++ _data = pData;
++
+ if (KHotKeys::Trigger *trg = data()->trigger()) {
+ switch (trg->type()) {
+ case KHotKeys::Trigger::ShortcutTriggerType:
+@@ -95,10 +103,6 @@ void SimpleActionDataWidget::setActionData(KHotKeys::SimpleActionData *pData)
+ extend(currentTrigger, i18n("Trigger"));
+ }
+
+- // Now go and work on the action
+- delete currentAction;
+- currentAction = nullptr;
+-
+ if (KHotKeys::Action *act = data()->action()) {
+ switch (act->type()) {
+ case KHotKeys::Action::MenuEntryActionType:
+diff --git a/kcm_hotkeys/simple_action_data_widget.h b/kcm_hotkeys/simple_action_data_widget.h
+index bc203b1..7c347c5 100644
+--- a/kcm_hotkeys/simple_action_data_widget.h
++++ b/kcm_hotkeys/simple_action_data_widget.h
+@@ -32,6 +32,9 @@ public:
+ */
+ void setActionData(KHotKeys::SimpleActionData *action);
+
++ /// Throws away the held widgets and state.
++ void unsetActionData();
++
+ KHotKeys::SimpleActionData *data()
+ {
+ return static_cast<KHotKeys::SimpleActionData *>(_data);
+diff --git a/kcm_hotkeys/triggers/trigger_widget_base.cpp b/kcm_hotkeys/triggers/trigger_widget_base.cpp
+index 67f4f3e..3bfa39b 100644
+--- a/kcm_hotkeys/triggers/trigger_widget_base.cpp
++++ b/kcm_hotkeys/triggers/trigger_widget_base.cpp
+@@ -10,6 +10,14 @@ TriggerWidgetBase::TriggerWidgetBase(KHotKeys::Trigger *trigger, QWidget *parent
+ : HotkeysWidgetIFace(parent)
+ , _trigger(trigger)
+ {
++ // Safety net to catch use-after-free. The triggers are not held or managed by us nor our parent.
++ // Makes them easier to spot, unlike https://bugs.kde.org/show_bug.cgi?id=443656
++ auto qObject = dynamic_cast<QObject *>(trigger);
++ if (qObject) {
++ connect(qObject, &QObject::destroyed, this, [this] {
++ _trigger = nullptr;
++ });
++ }
+ }
+
+ TriggerWidgetBase::~TriggerWidgetBase()
+--
+GitLab
+
diff --git a/kde-plasma/khotkeys/khotkeys-5.23.3-r1.ebuild b/kde-plasma/khotkeys/khotkeys-5.23.3-r1.ebuild
new file mode 100644
index 000000000000..19b406f848a4
--- /dev/null
+++ b/kde-plasma/khotkeys/khotkeys-5.23.3-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_HANDBOOK="forceoptional" # not optional until !kdelibs4support
+KFMIN=5.86.0
+PVCUT=$(ver_cut 1-3)
+QTMIN=5.15.2
+inherit ecm kde.org
+
+DESCRIPTION="KDE Plasma workspace hotkey module"
+
+LICENSE="GPL-2" # TODO: CHECK
+SLOT="5"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE=""
+
+COMMON_DEPEND="
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtx11extras-${QTMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/kdbusaddons-${KFMIN}:5
+ >=kde-frameworks/kdelibs4support-${KFMIN}:5[X]
+ >=kde-frameworks/kglobalaccel-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kservice-${KFMIN}:5
+ >=kde-frameworks/ktextwidgets-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ >=kde-plasma/libkworkspace-${PVCUT}:5
+ x11-libs/libX11
+ x11-libs/libXtst
+"
+DEPEND="${COMMON_DEPEND}
+ x11-base/xorg-proto
+ x11-libs/libxcb
+ x11-libs/libXtst
+"
+RDEPEND="${COMMON_DEPEND}
+ >=kde-frameworks/kded-${KFMIN}:5
+ >=kde-plasma/kde-cli-tools-${PVCUT}:5
+"
+
+PATCHES=( "${FILESDIR}"/${P}-delete-widgets-w-entry.patch ) # KDE-bug 443656
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-23 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22 7:36 [gentoo-commits] repo/gentoo:master commit in: kde-plasma/khotkeys/, kde-plasma/khotkeys/files/ Andreas Sturmlechner
-- strict thread matches above, loose matches on Subject: below --
2021-11-23 14:59 Andreas Sturmlechner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox