diff options
author | V3n3RiX <venerix@koprulu.sector> | 2021-12-05 02:47:11 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2021-12-05 02:47:11 +0000 |
commit | 2771f79232c273bc2a57d23bf335dd81ccf6af28 (patch) | |
tree | c8af0fd04194aed03cf067d44e53c7edd3e9ab84 /sci-electronics/ktechlab/files | |
parent | e9d044d4b9b71200a96adfa280848858c0f468c9 (diff) |
gentoo resync : 05.12.2021
Diffstat (limited to 'sci-electronics/ktechlab/files')
3 files changed, 116 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 000000000000..20222c89daab --- /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 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 + 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 000000000000..c72fdd60021b --- /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(¤tList, 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 + |