diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2021-11-30 15:10:56 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2021-11-30 15:11:02 +0100 |
commit | 5ab4d3d92ec0416ca030f38a5f88d936f0d0f7c9 (patch) | |
tree | 0b7389d78a03d0baad68ff7c71cf923e8573b7f4 /sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-propertyeditor.patch | |
parent | dev-libs/libical: Add missing app-doc/doxygen[dot] usedep (diff) | |
download | gentoo-5ab4d3d92ec0416ca030f38a5f88d936f0d0f7c9.tar.gz gentoo-5ab4d3d92ec0416ca030f38a5f88d936f0d0f7c9.tar.bz2 gentoo-5ab4d3d92ec0416ca030f38a5f88d936f0d0f7c9.zip |
sci-electronics/ktechlab: Backport fixes for several crashes, EAPI-8
Upstream commits:
730a5492e4780504a80db1a27dc307d8f61b4696
1b814b266f1bd25d92b701e071473f2267330933
e0bb9ff940f6eda544342c499998cf6142258629
Closes: https://bugs.gentoo.org/798837
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-propertyeditor.patch')
-rw-r--r-- | sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-propertyeditor.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-propertyeditor.patch b/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-propertyeditor.patch new file mode 100644 index 000000000000..ec970b64ad81 --- /dev/null +++ b/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-propertyeditor.patch @@ -0,0 +1,52 @@ +From 730a5492e4780504a80db1a27dc307d8f61b4696 Mon Sep 17 00:00:00 2001 +From: Zoltan Padrah <zoltan_padrah@users.sf.net> +Date: Fri, 18 Dec 2020 20:47:55 +0200 +Subject: [PATCH] property editor: fix crash when changing a property and + clicking circuit + +apparently Ubuntu 18.04 is affected (Qt 5.9.5) +and Ubuntu 20.04 is not (Qt 5.12.8). + +to reproduce: + +1. place and select a resistor +2. in the property editor click on any of its properties, + in order to start editing it +3. click on the circuit, to stop editing of the properties +3.1. Expected: property value is kept, program continues +3.2. Actually: crash with the same stack trace from above + +Should fix issue on GitHub: +https://github.com/ktechlab/ktechlab/issues/60 +--- + src/gui/itemeditor/propertyeditor.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/gui/itemeditor/propertyeditor.cpp b/src/gui/itemeditor/propertyeditor.cpp +index 88b86842..60821177 100644 +--- a/src/gui/itemeditor/propertyeditor.cpp ++++ b/src/gui/itemeditor/propertyeditor.cpp +@@ -476,8 +476,19 @@ void PropertyEditor::showDefaultsButton(bool show) + + void PropertyEditor::updateDefaultsButton() + { +- if (!m_editItem) ++ QTableWidgetItem *currItem = currentItem(); ++ if (!currItem) { ++ m_editItem = nullptr; + return; ++ } ++ m_editItem = dynamic_cast<PropertyEditorItem*>(currItem); ++ if (!m_editItem) { ++ qWarning() << "failed to cast current item to PropertyEditorItem, " << currItem; ++ return; ++ } ++ qDebug() << "currentItem=" << currentItem(); ++ qDebug() << "m_editItem=" << m_editItem; ++ qDebug() << "m_editItem->property=" << m_editItem->property(); + showDefaultsButton( m_editItem->property()->changed() ); + repaint(); // m_editItem->repaint(); + } +-- +GitLab + |