summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-11-30 15:10:56 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2021-11-30 15:11:02 +0100
commit5ab4d3d92ec0416ca030f38a5f88d936f0d0f7c9 (patch)
tree0b7389d78a03d0baad68ff7c71cf923e8573b7f4
parentdev-libs/libical: Add missing app-doc/doxygen[dot] usedep (diff)
downloadgentoo-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>
-rw-r--r--sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-connectors-diverging.patch38
-rw-r--r--sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-propertyeditor.patch52
-rw-r--r--sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix.patch26
-rw-r--r--sci-electronics/ktechlab/ktechlab-0.50.0-r2.ebuild50
4 files changed, 166 insertions, 0 deletions
diff --git a/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-connectors-diverging.patch b/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-connectors-diverging.patch
new file mode 100644
index 00000000000..20222c89daa
--- /dev/null
+++ b/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix-connectors-diverging.patch
@@ -0,0 +1,38 @@
+From 1b814b266f1bd25d92b701e071473f2267330933 Mon Sep 17 00:00:00 2001
+From: "Martin T. H. Sandsmark" <martin.sandsmark@kde.org>
+Date: Mon, 22 Mar 2021 12:49:26 +0100
+Subject: [PATCH] fix crash when looking for where connectors diverge
+
+---
+ src/electronics/ecnode.cpp | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/src/electronics/ecnode.cpp b/src/electronics/ecnode.cpp
+index 385844c1..28f2a556 100644
+--- a/src/electronics/ecnode.cpp
++++ b/src/electronics/ecnode.cpp
+@@ -225,10 +225,18 @@ QPoint ECNode::findConnectorDivergePoint(bool *found)
+ if (!gotP1 || !gotP2 )
+ return QPoint(0,0);
+
+- unsigned maxLength = p1.size() > p2.size() ? p1.size() : p2.size();
++ // If they are differing lengths, return the end of the shortest
++ if (p1.size() < p2.size()) {
++ *found = true;
++ return p1.last();
++ } else if (p2.size() < p1.size()) {
++ *found = true;
++ return p2.last();
++ }
++
++ Q_ASSERT(p1.size() == p2.size());
+
+- for ( unsigned i = 1; i < maxLength; ++i )
+- {
++ for (unsigned i = 1; i < qMin(p1.size(), p2.size()); ++i) {
+ if ( p1[i] != p2[i] ) {
+ *found = true;
+ return p1[i-1];
+--
+GitLab
+
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 00000000000..ec970b64ad8
--- /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
+
diff --git a/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix.patch b/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix.patch
new file mode 100644
index 00000000000..c72fdd60021
--- /dev/null
+++ b/sci-electronics/ktechlab/files/ktechlab-0.50.0-crashfix.patch
@@ -0,0 +1,26 @@
+From e0bb9ff940f6eda544342c499998cf6142258629 Mon Sep 17 00:00:00 2001
+From: "Martin T. H. Sandsmark" <martin.sandsmark@kde.org>
+Date: Sun, 20 Dec 2020 14:43:31 +0100
+Subject: [PATCH] fix odd crash
+
+---
+ src/nodegroup.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/nodegroup.cpp b/src/nodegroup.cpp
+index f4cfa2b4..94430409 100644
+--- a/src/nodegroup.cpp
++++ b/src/nodegroup.cpp
+@@ -142,8 +142,7 @@ void NodeGroup::updateRoutes()
+ Node *next = (routeIt == routeEnd) ? n2 : (Node *)*(routeIt++);
+ removeRoutedNodes(&currentList, prev, next);
+ QPointList pointList = *it;
+- if ( prev != n1 )
+- {
++ if (!pointList.isEmpty() && prev != n1) {
+ QPoint first = pointList.first();
+ prev->moveBy( first.x() - prev->x(), first.y() - prev->y() );
+ }
+--
+GitLab
+
diff --git a/sci-electronics/ktechlab/ktechlab-0.50.0-r2.ebuild b/sci-electronics/ktechlab/ktechlab-0.50.0-r2.ebuild
new file mode 100644
index 00000000000..6359c002ea9
--- /dev/null
+++ b/sci-electronics/ktechlab/ktechlab-0.50.0-r2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_EXAMPLES="true"
+ECM_HANDBOOK="forceoptional"
+ECM_TEST="true"
+KDE_ORG_CATEGORY="sdk"
+KFMIN=5.74.0
+QTMIN=5.15.1
+inherit ecm kde.org
+
+DESCRIPTION="IDE for microcontrollers and electronics"
+HOMEPAGE="https://userbase.kde.org/KTechlab"
+SRC_URI="mirror://kde/unstable/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="5"
+KEYWORDS="~amd64"
+IUSE="+gpsim"
+
+DEPEND="
+ >=dev-qt/qtdbus-${QTMIN}:5
+ >=dev-qt/qtgui-${QTMIN}:5
+ >=dev-qt/qtprintsupport-${QTMIN}:5
+ >=dev-qt/qtwidgets-${QTMIN}:5
+ >=dev-qt/qtxml-${QTMIN}:5
+ >=kde-frameworks/kcompletion-${KFMIN}:5
+ >=kde-frameworks/kconfig-${KFMIN}:5
+ >=kde-frameworks/kconfigwidgets-${KFMIN}:5
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5
+ >=kde-frameworks/ki18n-${KFMIN}:5
+ >=kde-frameworks/kiconthemes-${KFMIN}:5
+ >=kde-frameworks/kio-${KFMIN}:5
+ >=kde-frameworks/kjobwidgets-${KFMIN}:5
+ >=kde-frameworks/kparts-${KFMIN}:5
+ >=kde-frameworks/ktexteditor-${KFMIN}:5
+ >=kde-frameworks/ktextwidgets-${KFMIN}:5
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5
+ >=kde-frameworks/kxmlgui-${KFMIN}:5
+ gpsim? ( dev-embedded/gpsim )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-deps.patch
+ "${FILESDIR}"/${P}-crashfix{-propertyeditor,-connectors-diverging,}.patch
+)