From 8f47c89054fdb85a098e2c2253e3e37573618628 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Thu, 10 Oct 2019 09:52:49 +0200 Subject: [PATCH 01/61] Handle extra qt install screen --- tools/qt_installer_noninteractive.qs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/qt_installer_noninteractive.qs b/tools/qt_installer_noninteractive.qs index ae0100492..7014259a6 100644 --- a/tools/qt_installer_noninteractive.qs +++ b/tools/qt_installer_noninteractive.qs @@ -63,3 +63,9 @@ Controller.prototype.FinishedPageCallback = function() { } gui.clickButton(buttons.FinishButton); } + +Controller.prototype.DynamicTelemetryPluginFormCallback = function() { + var widget = gui.currentPageWidget(); + widget.TelemetryPluginForm.statisticGroupBox.disableStatisticRadioButton.checked = true; + gui.clickButton(buttons.NextButton); +} \ No newline at end of file From 0e69b1aea574c6da6fa2d402fcb5b767eed1d2d2 Mon Sep 17 00:00:00 2001 From: Daniel Duller Date: Fri, 1 Nov 2019 19:38:47 +0100 Subject: [PATCH 02/61] Updated German translation --- .vs/slnx.sqlite | Bin 0 -> 90112 bytes translations/fritzing_de.qm | Bin 248206 -> 248825 bytes translations/fritzing_de.ts | 56 ++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 .vs/slnx.sqlite diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..2d65013b5a5eb1609b75b5de9331a2278d96837c GIT binary patch literal 90112 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 literal 0 HcmV?d00001 diff --git a/translations/fritzing_de.qm b/translations/fritzing_de.qm index d7a8118a22d4c13ab3ae559f626edb550d77bced..253afee67b79f93dbaa5ad006a8b35c833aed1f2 100644 GIT binary patch delta 15788 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 KvaN79^Zx)rwBC;Z delta 15588 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 Ng(e64)Dm`Y|3CLAuxbDR diff --git a/translations/fritzing_de.ts b/translations/fritzing_de.ts index 1cc986d34..0128963cc 100644 --- a/translations/fritzing_de.ts +++ b/translations/fritzing_de.ts @@ -1,6 +1,6 @@ - + AboutBox @@ -106,27 +106,27 @@ Yuelin and Ninjia - + Yuelin und Ninjia Chinese (Traditional): - Chinesisch traditionell: + Chinesisch (traditionell): Robert Lee - + Hiroshi Suzuki - + Jinbuhm Kim - + @@ -151,11 +151,11 @@ Chinese (Simplified): - Vereinfachtes Chinesisch: + Vereinfachtes Chinesisch: Robert Lee - Robert Lee + Robert Lee @@ -164,7 +164,7 @@ Hiroshi Suzuki - Hiroshi Suzuki + Hiroshi Suzuki @@ -1233,7 +1233,7 @@ Trotzdem diese Datei benutzen? Regenerate parts database? - Neuerstellung der Bauteil-Datenbank + Neuerstellung der Bauteil-Datenbank? @@ -1275,7 +1275,7 @@ Trotzdem diese Datei benutzen? <br/>The <b>Breadboard View</b> is meant to look like a <i>real-life</i> breadboard prototype.<br/><br/>Begin by dragging a part from the Parts Bin, which is over at the top right. Then pull in more parts, connecting them by placing them on the breadboard or clicking on the connectors and dragging wires. The process is similar to how you would arrange things in the physical world. <br/><br/>After you're finished creating your sketch in the breadboard view, try the other views. You can switch views by clicking the Tabs at the top of the window. Because different views have different purposes, parts will look different in the other views. - <br/> Die <b> Breadboard-Ansicht </ b> soll wie ein <i> realer </ i> Breadboard-Prototyp aussehen. <br/> <br/> Ziehen Sie zunächst ein Teil aus dem Teilefach , das oben rechts ist. Ziehen Sie dann weitere Teile hinein und verbinden Sie sie, indem Sie sie auf das Steckbrett legen oder auf die Anschlüsse klicken und Drähte ziehen. Der Vorgang ähnelt der Anordnung der Dinge in der physischen Welt. <br/> <br/> Probieren Sie die anderen Ansichten aus, nachdem Sie Ihre Skizze in der Steckbrettansicht erstellt haben. Sie können die Ansicht wechseln, indem Sie auf die Registerkarten oben im Fenster klicken. Da unterschiedliche Ansichten unterschiedliche Zwecke haben, sehen Teile in den anderen Ansichten unterschiedlich aus. + <br/>Die <b>Breadboard-Ansicht</b> soll wie ein <i> realer</i> Breadboard-Prototyp aussehen.<br/><br/>Ziehen Sie zunächst ein Teil aus dem Teilefach (oben rechts) hinein. Ziehen Sie dann weitere Teile hinein und verbinden Sie diese, indem Sie diese auf das Steckbrett legen oder auf die Anschlüsse klicken und Drähte ziehen. Der Vorgang ähnelt der Anordnung der Dinge in der realen Welt. <br/><br/>Probieren Sie auch die anderen Ansichten aus, nachdem Sie Ihre Skizze in der Steckbrettansicht erstellt haben. Sie können die Ansicht wechseln, indem Sie auf die Registerkarten oben im Fenster klicken. Da unterschiedliche Ansichten andere.Zwecke erfüllen, sehen Teile in den anderen Ansichten unterschiedlich aus. @@ -2898,7 +2898,7 @@ Du kannst auch per rechten Mausklick einen Verbinder als "Saat" für d Display breadboard wires using standard color coding by length - Auf dem Breadboard werden Kabel entsprechend der Länge gefärbt + Braeadboard-Kabel entsprechend ihrer Länge farbcodiert anzeigen @@ -3609,12 +3609,12 @@ Zurücksetzen? Rotate 45° Clockwise - Um 45° drehen + Um 45° im Uhrzeigersinn drehen Rotate 90° Clockwise - Um 90° drehen + Um 90° im Uhrzeigersinn drehen @@ -3624,12 +3624,12 @@ Zurücksetzen? Rotate 90° Counter Clockwise - Um 90° drehen (gegen den Uhrzeigersinn) + Um 90° gegen den Uhrzeigersinn drehen Rotate 45° Counter Clockwise - Um 45° drehen (gegen den Uhrzeigersinn) + Um 45° gegen den Uhrzeigersinn drehen @@ -5237,7 +5237,7 @@ Ursache: %2 (Fehlercode %3) <p>Please enter a prefix to help you identify the part files.<br/>The file names will have the form 'PREFIX_%1'.<br/>(It is not necessary to change the proposed prefix, since a unique suffix is always added.)</p> - <p> Geben Sie ein Präfix ein, um die Teiledateien leichter identifizieren zu können. <br/> Die Dateinamen haben die Form 'PREFIX_%1'. <br/> (Das vorgeschlagene Präfix muss nicht geändert werden, da ein eindeutiger Suffix immer hinzugefügt wird) </ p> + <p>Geben Sie ein Präfix ein, um die Teiledateien leichter identifizieren zu können.<br/>Die Dateinamen haben die Form 'PREFIX_%1'.<br/>(Das vorgeschlagene Präfix muss nicht geändert werden, da immer ein eindeutiger Suffix hinzugefügt wird.)</p> @@ -5976,7 +5976,7 @@ Fortsetzen und speichern? Rotate 45° Clockwise - Um 45° drehen + Um 45° im Uhrzeigersinn drehen @@ -5986,7 +5986,7 @@ Fortsetzen und speichern? Rotate 90° Clockwise - Um 90° drehen + Um 90° im Uhrzeigersinn drehen @@ -5996,7 +5996,7 @@ Fortsetzen und speichern? Rotate 135° Clockwise - Um 135° drehen + Um 135° im Uhrzeigersinn drehen @@ -6016,7 +6016,7 @@ Fortsetzen und speichern? Rotate 135° Counter Clockwise - Um 45° drehen (gegen den Uhrzeigersinn) + Um 135° gegen den Uhrzeigersinn drehen @@ -6026,7 +6026,7 @@ Fortsetzen und speichern? Rotate 90° Counter Clockwise - Um 90° drehen (gegen den Uhrzeigersinn) + Um 90° gegen den Uhrzeigersinn drehen @@ -6036,7 +6036,7 @@ Fortsetzen und speichern? Rotate 45° Counter Clockwise - Um 45° drehen (gegen den Uhrzeigersinn) + Um 45° gegen den Uhrzeigersinn drehen @@ -7599,27 +7599,27 @@ im Sortiment. Nicht erneut hinzufügen? the board outline layer, - + die Board Kontur-Schicht, silkscreen layer(s), - Siebdruckschicht(en) + Siebdruckschicht(en), copper layer(s), - Kupferschicht(en) + Kupferschicht(en), mask layer(s), - Maskenschicht(en) + Maskenschicht(en), paste mask layer(s), - Maskenebene(n) einfügen + Maskenebene(n) einfügen, From b4c6e75cffb92c5236a308361a0ca019ad494f00 Mon Sep 17 00:00:00 2001 From: Daniel Duller Date: Fri, 1 Nov 2019 19:46:53 +0100 Subject: [PATCH 03/61] removed Visual Studio files which got accidentally committed --- .vs/slnx.sqlite | Bin 90112 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .vs/slnx.sqlite diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite deleted file mode 100644 index 2d65013b5a5eb1609b75b5de9331a2278d96837c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90112 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 From f1086efc67196b2f9172e7b376c5f93857956f9f Mon Sep 17 00:00:00 2001 From: Daniel Duller Date: Fri, 1 Nov 2019 22:33:11 +0100 Subject: [PATCH 04/61] fixed a typo ("andere.Zwecke" -> "andere Zwecke") --- translations/fritzing_de.qm | Bin 248825 -> 248825 bytes translations/fritzing_de.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/fritzing_de.qm b/translations/fritzing_de.qm index 253afee67b79f93dbaa5ad006a8b35c833aed1f2..97354437cb2105a739ad39c05d0b62521fb7a851 100644 GIT binary patch delta 37 scmex4o&V=_{tY}1lY2dRH%mHrl`$$br)+Ca*~SROOxshoF;5i*04XgF{r~^~ delta 38 rcmex4o&V=_{tY}1EDS)fS->H <br/>The <b>Breadboard View</b> is meant to look like a <i>real-life</i> breadboard prototype.<br/><br/>Begin by dragging a part from the Parts Bin, which is over at the top right. Then pull in more parts, connecting them by placing them on the breadboard or clicking on the connectors and dragging wires. The process is similar to how you would arrange things in the physical world. <br/><br/>After you're finished creating your sketch in the breadboard view, try the other views. You can switch views by clicking the Tabs at the top of the window. Because different views have different purposes, parts will look different in the other views. - <br/>Die <b>Breadboard-Ansicht</b> soll wie ein <i> realer</i> Breadboard-Prototyp aussehen.<br/><br/>Ziehen Sie zunächst ein Teil aus dem Teilefach (oben rechts) hinein. Ziehen Sie dann weitere Teile hinein und verbinden Sie diese, indem Sie diese auf das Steckbrett legen oder auf die Anschlüsse klicken und Drähte ziehen. Der Vorgang ähnelt der Anordnung der Dinge in der realen Welt. <br/><br/>Probieren Sie auch die anderen Ansichten aus, nachdem Sie Ihre Skizze in der Steckbrettansicht erstellt haben. Sie können die Ansicht wechseln, indem Sie auf die Registerkarten oben im Fenster klicken. Da unterschiedliche Ansichten andere.Zwecke erfüllen, sehen Teile in den anderen Ansichten unterschiedlich aus. + <br/>Die <b>Breadboard-Ansicht</b> soll wie ein <i> realer</i> Breadboard-Prototyp aussehen.<br/><br/>Ziehen Sie zunächst ein Teil aus dem Teilefach (oben rechts) hinein. Ziehen Sie dann weitere Teile hinein und verbinden Sie diese, indem Sie diese auf das Steckbrett legen oder auf die Anschlüsse klicken und Drähte ziehen. Der Vorgang ähnelt der Anordnung der Dinge in der realen Welt. <br/><br/>Probieren Sie auch die anderen Ansichten aus, nachdem Sie Ihre Skizze in der Steckbrettansicht erstellt haben. Sie können die Ansicht wechseln, indem Sie auf die Registerkarten oben im Fenster klicken. Da unterschiedliche Ansichten andere Zwecke erfüllen, sehen Teile in den anderen Ansichten unterschiedlich aus. From 0eea189e481b179d71688f603ba0a970e5cd35a1 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Fri, 1 Nov 2019 16:10:49 +0100 Subject: [PATCH 05/61] Fix for issue #2186 . Allow seed connectors nearby other parts, value optimized for keepout distance ~ 2-30 --- src/connectors/connectoritem.cpp | 6 +- src/sketch/pcbsketchwidget.cpp | 100 ++++++++++++++++--------------- src/sketch/pcbsketchwidget.h | 7 ++- src/svg/groundplanegenerator.cpp | 23 ++++--- 4 files changed, 73 insertions(+), 63 deletions(-) diff --git a/src/connectors/connectoritem.cpp b/src/connectors/connectoritem.cpp index 4aaa5a83d..90e82678a 100644 --- a/src/connectors/connectoritem.cpp +++ b/src/connectors/connectoritem.cpp @@ -1902,11 +1902,11 @@ double ConnectorItem::calcClipRadius() { } if (m_effectively == EffectivelyCircular) { - double rad = rect().width() / 2; - return rad - (rad / 5); + double rad = rect().width() / 2.0; + return rad - (rad / 5.0); } - return 0; + return 0.0; } bool ConnectorItem::isEffectivelyCircular() { diff --git a/src/sketch/pcbsketchwidget.cpp b/src/sketch/pcbsketchwidget.cpp index b4af2b3aa..49f0878de 100644 --- a/src/sketch/pcbsketchwidget.cpp +++ b/src/sketch/pcbsketchwidget.cpp @@ -1872,9 +1872,31 @@ ViewGeometry::WireFlag PCBSketchWidget::getTraceFlag() { return ViewGeometry::PCBTraceFlag; } +/** + * @brief canConnectSeed + * Check if we can connect a seed without getting to close to another part + * Also checks if a seed is already connected with a wire on that layer + */ +bool PCBSketchWidget::canConnectSeed(QRectF boardRect, + QImage * copperImage, + ConnectorItem * connectorItem, + ViewLayer::ViewLayerID viewLayerID, + QRectF s) +{ + const double clear = 18.0; // aribtrary value, seems to work fine with keepouts from 2..30 + // with larger keepouts >> 30, most seeds can not be automatically connected anymore + // so the workaround would be to set a manual wiretrace. + + QRectF check(boardRect.left() + (s.left()-clear) * boardRect.width()/ copperImage->width(), + boardRect.top() + (s.top()-clear) * boardRect.height() / copperImage->height(), + (s.width()+2*clear) * boardRect.width()/ copperImage->width(), + (s.height()+2*clear) * boardRect.width()/ copperImage->width()); + return (!hasNeighbor(connectorItem, viewLayerID, check)); +} + void PCBSketchWidget::postImageSlot(GroundPlaneGenerator * gpg, QImage * copperImage, QImage * boardImage, QGraphicsItem * board, QList * rects) { - if (m_groundFillSeeds == NULL) return; + if (m_groundFillSeeds == nullptr) return; ViewLayer::ViewLayerID viewLayerID = (gpg->layerName() == "groundplane") ? ViewLayer::Copper0 : ViewLayer::Copper1; @@ -1887,26 +1909,6 @@ void PCBSketchWidget::postImageSlot(GroundPlaneGenerator * gpg, QImage * copperI //connectorItem->debugInfo("post image b"); QRectF r = connectorItem->sceneBoundingRect(); - //DebugDialog::debug("pb", r); - QRectF check = r; - check.setLeft(r.right()); - check.setRight(r.right() + r.width()); - bool checkRight = !hasNeighbor(connectorItem, viewLayerID, check); - - check = r; - check.setLeft(r.left() - r.width()); - check.setRight(r.left()); - bool checkLeft = !hasNeighbor(connectorItem, viewLayerID, check); - - check = r; - check.setTop(r.bottom()); - check.setBottom(r.bottom() + r.height()); - bool checkDown = !hasNeighbor(connectorItem, viewLayerID, check); - - check = r; - check.setTop(r.top() - r.width()); - check.setBottom(r.top()); - bool checkUp = !hasNeighbor(connectorItem, viewLayerID, check); double x1 = (r.left() - boardRect.left()) * copperImage->width() / boardRect.width(); double x2 = (r.right() - boardRect.left()) * copperImage->width() / boardRect.width(); @@ -1917,10 +1919,10 @@ void PCBSketchWidget::postImageSlot(GroundPlaneGenerator * gpg, QImage * copperI double cw = w / 4; double ch = h / 4; - int cx = (x1 + x2) /2; - int cy = (y1 + y2) /2; + double cx = (x1 + x2) /2; + double cy = (y1 + y2) /2; - int rad = qFloor(connectorItem->calcClipRadius() * copperImage->width() / boardRect.width()); + double rad = qFloor(connectorItem->calcClipRadius() * copperImage->width() / boardRect.width()); double borderl = qMax(0.0, x1 - w); double borderr = qMin(x2 + w, copperImage->width()); @@ -1928,41 +1930,45 @@ void PCBSketchWidget::postImageSlot(GroundPlaneGenerator * gpg, QImage * copperI double borderb = qMin(y2 + h, copperImage->height()); // check left, up, right, down for groundplane, and if it's there draw to it from the connector - - if (checkUp) { - for (int y = y1; y > bordert; y--) { - if ((copperImage->pixel(cx, y) & 0xffffff) || (boardImage->pixel(cx, y) == 0xff000000)) { - QRectF s(cx - cw, y - 1, cw + cw, cy - y - rad); + for (int y = y1; y > bordert; y--) { + if ((copperImage->pixel(cx, y) & 0xffffff) || (boardImage->pixel(cx, y) == 0xff000000)) { + QRectF s(cx - cw, y - 1, cw + cw, cy - y - rad); + if (canConnectSeed(boardRect, copperImage, connectorItem, viewLayerID, s)) { rects->append(s); - break; } + break; } } - if (checkDown) { - for (int y = y2; y < borderb; y++) { - if ((copperImage->pixel(cx, y) & 0xffffff) || (boardImage->pixel(cx, y) == 0xff000000)) { - QRectF s(cx - cw, cy + rad, cw + cw, y - cy - rad); + + + for (int y = y2; y < borderb; y++) { + if ((copperImage->pixel(cx, y) & 0xffffff) || (boardImage->pixel(cx, y) == 0xff000000)) { + QRectF s(cx - cw, cy + rad, cw + cw, y - cy - rad); + if (canConnectSeed(boardRect, copperImage, connectorItem, viewLayerID, s)) { rects->append(s); - break; } + break; } } - if (checkLeft) { - for (int x = x1; x > borderl; x--) { - if ((copperImage->pixel(x, cy) & 0xffffff) || (boardImage->pixel(x, cy) == 0xff000000)) { - QRectF s(x - 1, cy - ch, cx - x - rad, ch + ch); + + + for (int x = x1; x > borderl; x--) { + if ((copperImage->pixel(x, cy) & 0xffffff) || (boardImage->pixel(x, cy) == 0xff000000)) { + QRectF s(x - 1, cy - ch, cx - x - rad, ch + ch); + if (canConnectSeed(boardRect, copperImage, connectorItem, viewLayerID, s)) { rects->append(s); - break; } + break; } } - if (checkRight) { - for (int x = x2; x < borderr; x++) { - if ((copperImage->pixel(x, cy) & 0xffffff) || (boardImage->pixel(x, cy) == 0xff000000)) { - QRectF s(cx + rad, cy - ch, x - cx - rad, ch + ch); + + for (int x = x2; x < borderr; x++) { + if ((copperImage->pixel(x, cy) & 0xffffff) || (boardImage->pixel(x, cy) == 0xff000000)) { + QRectF s(cx + rad, cy - ch, x - cx - rad, ch + ch); + if (canConnectSeed(boardRect, copperImage, connectorItem, viewLayerID, s)) { rects->append(s); - break; } + break; } } @@ -1974,7 +1980,7 @@ bool PCBSketchWidget::hasNeighbor(ConnectorItem * connectorItem, ViewLayer::View { foreach (QGraphicsItem * item, scene()->items(r)) { ConnectorItem * ci = dynamic_cast(item); - if (ci != NULL) { + if (ci != nullptr) { if (ci->attachedToViewLayerID() != viewLayerID) continue; if (!ci->attachedTo()->isEverVisible()) continue; if (ci == connectorItem) continue; @@ -1983,7 +1989,7 @@ bool PCBSketchWidget::hasNeighbor(ConnectorItem * connectorItem, ViewLayer::View } TraceWire * traceWire = dynamic_cast(item); - if (traceWire != NULL) { + if (traceWire != nullptr) { if (!sameElectricalLayer2(traceWire->viewLayerID(), viewLayerID)) continue; if (!traceWire->isTraceType(getTraceFlag())) continue; diff --git a/src/sketch/pcbsketchwidget.h b/src/sketch/pcbsketchwidget.h index 470b1c47d..dc24968f9 100644 --- a/src/sketch/pcbsketchwidget.h +++ b/src/sketch/pcbsketchwidget.h @@ -163,7 +163,12 @@ public slots: Wire * createTempWireForDragging(Wire * fromWire, ModelPart * wireModel, ConnectorItem * connectorItem, ViewGeometry & viewGeometry, ViewLayer::ViewLayerPlacement); void prereleaseTempWireForDragging(Wire*); void rotatePartLabels(double degrees, QTransform &, QPointF center, QUndoCommand * parentCommand); - bool hasNeighbor(ConnectorItem * connectorItem, ViewLayer::ViewLayerID viewLayerID, const QRectF & r); + bool hasNeighbor(ConnectorItem * connectorItem, ViewLayer::ViewLayerID viewLayerID, const QRectF & r); + bool canConnectSeed(QRectF boardRect, + QImage * copperImage, + ConnectorItem * connectorItem, + ViewLayer::ViewLayerID viewLayerID, + QRectF s); void setGroundFillSeeds(const QString & intro); bool collectGroundFillSeeds(QList & seeds, bool includePotential); void shiftHoles(); diff --git a/src/svg/groundplanegenerator.cpp b/src/svg/groundplanegenerator.cpp index c1e2fd418..9f18c74dd 100644 --- a/src/svg/groundplanegenerator.cpp +++ b/src/svg/groundplanegenerator.cpp @@ -274,18 +274,17 @@ bool GroundPlaneGenerator::generateGroundPlaneFn(GPGParams & params) double pixelFactor = GraphicsUtils::StandardFritzingDPI / params.res; scanImage(*image, bWidth, bHeight, pixelFactor, params.res, params.color, true, true, QSizeF(.05, .05), 1 / GraphicsUtils::SVGDPI, QPointF(0,0)); - if (rects.count() > 0) { - foreach (QRectF r, rects) { - // add the rects separately as tiny SVGs which don't get clipped (since they are connected) - QList polygons; - QPolygon polygon; - polygon << QPoint(r.left() * pixelFactor, r.top() * pixelFactor) - << QPoint(r.right() * pixelFactor, r.top() * pixelFactor) - << QPoint(r.right() * pixelFactor, r.bottom() * pixelFactor) - << QPoint(r.left() * pixelFactor, r.bottom() * pixelFactor); - polygons.append(polygon); - makePolySvg(polygons, params.res, bWidth, bHeight, pixelFactor, params.color, false, true, QSizeF(0, 0), 0, QPointF(0, 0)); - } + + foreach (QRectF r, rects) { + // add the rects separately as tiny SVGs which don't get clipped (since they are connected) + QList polygons; + QPolygon polygon; + polygon << QPoint(r.left() * pixelFactor, r.top() * pixelFactor) + << QPoint(r.right() * pixelFactor, r.top() * pixelFactor) + << QPoint(r.right() * pixelFactor, r.bottom() * pixelFactor) + << QPoint(r.left() * pixelFactor, r.bottom() * pixelFactor); + polygons.append(polygon); + makePolySvg(polygons, params.res, bWidth, bHeight, pixelFactor, params.color, false, true, QSizeF(0, 0), 0, QPointF(0, 0)); } delete image; From ac93ed7b9409fd74ff06a7f5bce4d35669e20639 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Sat, 2 Nov 2019 18:17:19 +0100 Subject: [PATCH 06/61] Fix issue #3537 Relative SVG commands did not properly update the current position when chained, only the first movement was used. GerberGenerator did not parse moveto commands with negative values. GerberGenerator did not parse loops closed with capital Z. svg2Gerber lost postion on chained relative moveto and lineto commands. svg2Gerber accumulated truncation errors by adding doubles to int in a loop. Also fix an issue when using scalar scaling (operation would silently fail / application would segfault) caused by a missing y-scale factor. --- src/sketch/sketchwidget.cpp | 12 +++++------ src/svg/gerbergenerator.cpp | 13 ++++++++---- src/svg/svg2gerber.cpp | 36 ++++++++++++++++---------------- src/svg/svgfilesplitter.cpp | 41 +++++++++++++++---------------------- src/utils/textutils.cpp | 7 ++++++- 5 files changed, 55 insertions(+), 54 deletions(-) diff --git a/src/sketch/sketchwidget.cpp b/src/sketch/sketchwidget.cpp index 126f8e4a1..c38b4cab7 100644 --- a/src/sketch/sketchwidget.cpp +++ b/src/sketch/sketchwidget.cpp @@ -7222,7 +7222,7 @@ QString SketchWidget::renderToSVG(RenderThing & renderThing, const LayerList & l if (renderThing.selectedItems) { items = scene()->selectedItems(); } - else if (renderThing.board == NULL) { + else if (renderThing.board == nullptr) { items = scene()->items(); } else { @@ -7231,11 +7231,11 @@ QString SketchWidget::renderToSVG(RenderThing & renderThing, const LayerList & l } foreach (QGraphicsItem * item, items) { ItemBase * itemBase = dynamic_cast(item); - if (itemBase == NULL) continue; + if (itemBase == nullptr) continue; if (itemBase->hidden() || itemBase->layerHidden()) continue; if (!renderThing.renderBlocker) { Pad * pad = qobject_cast(itemBase); - if (pad != NULL && pad->copperBlocker()) { + if (pad != nullptr && pad->copperBlocker()) { continue; } } @@ -7295,9 +7295,9 @@ QString SketchWidget::renderToSVG(RenderThing & renderThing, QList gotLabel; foreach (QGraphicsItem * item, itemsAndLabels) { ItemBase * itemBase = dynamic_cast(item); - if (itemBase == NULL) { + if (itemBase == nullptr) { PartLabel * partLabel = dynamic_cast(item); - if (partLabel == NULL) continue; + if (partLabel == nullptr) continue; QString labelSvg = partLabel->owner()->makePartLabelSvg(renderThing.blackOnly, renderThing.dpi, renderThing.printerScale); if (labelSvg.isEmpty()) continue; @@ -7372,7 +7372,7 @@ QString SketchWidget::renderToSVG(RenderThing & renderThing, QList(itemBase); - if (wire == NULL) continue; + if (wire == nullptr) continue; //if (wire->getTrace()) { // DebugDialog::debug(QString("trace %1 %2,%3 %4,%5") diff --git a/src/svg/gerbergenerator.cpp b/src/svg/gerbergenerator.cpp index 134b92a16..a9bae604a 100644 --- a/src/svg/gerbergenerator.cpp +++ b/src/svg/gerbergenerator.cpp @@ -37,8 +37,9 @@ along with Fritzing. If not, see . #include "../version/version.h" static const QRegExp AaCc("[aAcCqQtTsS]"); -static const QRegExp MFinder("([mM])\\s*([0-9.]*)[\\s,]*([0-9.]*)"); -const QRegExp GerberGenerator::MultipleZs("z\\s*[^\\s]"); +//static const QRegExp MFinder("([mM])\\s*([0-9.]*)[\\s,]*([0-9.]*)"); +static const QRegExp MFinder("([mM])\\s*([+-\\.\\d]+)[\\s,]+([+-\\.\\d]+)"); +const QRegExp GerberGenerator::MultipleZs("[zZ]\\s*[^\\s]"); const QString GerberGenerator::SilkTopSuffix = "_silkTop.gto"; const QString GerberGenerator::SilkBottomSuffix = "_silkBottom.gbo"; @@ -862,7 +863,7 @@ bool GerberGenerator::dealWithMultipleContours(QDomElement & root, bool displayM QDomElement path = paths.at(p).toElement(); QString originalPath = path.attribute("d", "").trimmed(); if (MultipleZs.indexIn(originalPath) >= 0) { - QStringList subpaths = path.attribute("d").split("z", QString::SkipEmptyParts); + QStringList subpaths = path.attribute("d").split("z", QString::SkipEmptyParts, Qt::CaseInsensitive); QString priorM; MFinder.indexIn(subpaths.at(0).trimmed()); priorM += MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; @@ -874,7 +875,11 @@ bool GerberGenerator::dealWithMultipleContours(QDomElement & root, bool displayM if (d.startsWith("m", Qt::CaseSensitive)) { d = priorM + d; } - priorM += MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; + if (MFinder.cap(1) == "M") { + priorM = MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; + } else { + priorM += MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; + } newPath.setAttribute("d", d); path.parentNode().appendChild(newPath); } diff --git a/src/svg/svg2gerber.cpp b/src/svg/svg2gerber.cpp index 872f2dbc9..982c83ccc 100644 --- a/src/svg/svg2gerber.cpp +++ b/src/svg/svg2gerber.cpp @@ -751,7 +751,7 @@ QString SVG2gerber::path2gerber(QDomElement pathElement) { void SVG2gerber::path2gerbCommandSlot(QChar command, bool relative, QList & args, void * userData) { QString gerb_path; - int x, y; + double x, y; PathUserData * pathUserData = (PathUserData *) userData; @@ -774,25 +774,25 @@ void SVG2gerber::path2gerbCommandSlot(QChar command, bool relative, QListpathStarting) { - x += pathUserData->x; - y += pathUserData->y; + pathUserData->x += args[argIndex]; + pathUserData->y += args[argIndex + 1]; + } else { + pathUserData->x = args[argIndex]; + pathUserData->y = args[argIndex + 1]; } + x = pathUserData->x; + y = pathUserData->y; + if (argIndex == 0) { // treat first 'm' arg pair as a move to gerb_path = "X" + QString::number(flipx(x)) + "Y" + QString::number(flipy(y)) + "D02*\n"; m_pathstart_x = x; m_pathstart_y = y; - } - else { + } else { // treat subsequent 'm' arg pair as line to gerb_path = "X" + QString::number(flipx(x)) + "Y" + QString::number(flipy(y)) + "D01*\n"; } - - pathUserData->x = x; - pathUserData->y = y; pathUserData->pathStarting = false; pathUserData->string.append(gerb_path); argIndex += 2; @@ -807,15 +807,14 @@ void SVG2gerber::path2gerbCommandSlot(QChar command, bool relative, QListx; - y += pathUserData->y; + pathUserData->x += args[argIndex]; + pathUserData->y += args[argIndex+1]; + } else { + pathUserData->x = args[argIndex]; + pathUserData->y = args[argIndex+1]; } - gerb_path = "X" + QString::number(flipx(x)) + "Y" + QString::number(flipy(y)) + "D01*\n"; - pathUserData->x = x; - pathUserData->y = y; + gerb_path = "X" + QString::number(flipx(pathUserData->x)) + "Y" + QString::number(flipy(pathUserData->y)) + "D01*\n"; pathUserData->string.append(gerb_path); argIndex += 2; break; @@ -823,8 +822,9 @@ void SVG2gerber::path2gerbCommandSlot(QChar command, bool relative, QListx = m_pathstart_x; + pathUserData->y = m_pathstart_y; pathUserData->string.append(gerb_path); - pathUserData->pathStarting = true; break; default: argIndex = args.count(); diff --git a/src/svg/svgfilesplitter.cpp b/src/svg/svgfilesplitter.cpp index 4e930e234..a9e515f57 100644 --- a/src/svg/svgfilesplitter.cpp +++ b/src/svg/svgfilesplitter.cpp @@ -866,7 +866,6 @@ void SvgFileSplitter::convertHVSlot(QChar command, bool relative, QList Q_UNUSED(relative); HVConvertData * data = (HVConvertData *) userData; - double x, y; switch(command.toLatin1()) { case 'M': data->path.append(command); @@ -879,11 +878,13 @@ void SvgFileSplitter::convertHVSlot(QChar command, bool relative, QList break; case 'm': data->path.append(command); - x = data->x; - y = data->y; + if (args.count() > 1) { + data->subX = data->x + args[0]; + data->subY = data->y + args[1]; + } for (int i = 0; i < args.count(); i += 2) { - data->subX = data->x = (x + args[i]); - data->subY = data->y = (y + args[i + 1]); + data->x += args[i]; + data->y += args[i + 1]; appendPair(data->path, args[i], args[i + 1]); } data->path.chop(1); @@ -901,11 +902,9 @@ void SvgFileSplitter::convertHVSlot(QChar command, bool relative, QList case 'l': case 't': data->path.append(command); - x = data->x; - y = data->y; for (int i = 0; i < args.count(); i += 2) { - data->x = x + args[i]; - data->y = y + args[i + 1]; + data->x += args[i]; + data->y += args[i + 1]; appendPair(data->path, args[i], args[i + 1]); } data->path.chop(1); @@ -923,11 +922,9 @@ void SvgFileSplitter::convertHVSlot(QChar command, bool relative, QList break; case 'c': data->path.append(command); - x = data->x; - y = data->y; for (int i = 0; i < args.count(); i += 6) { - data->x = x + args[i + 4]; - data->y = y + args[i + 5]; + data->x += args[i + 4]; + data->y += args[i + 5]; appendPair(data->path, args[i], args[i + 1]); appendPair(data->path, args[i + 2], args[i + 3]); appendPair(data->path, args[i + 4], args[i + 5]); @@ -948,11 +945,9 @@ void SvgFileSplitter::convertHVSlot(QChar command, bool relative, QList case 's': case 'q': data->path.append(command); - x = data->x; - y = data->y; for (int i = 0; i < args.count(); i += 4) { - data->x = x + args[i + 2]; - data->y = y + args[i + 3]; + data->x += args[i + 2]; + data->y += args[i + 3]; appendPair(data->path, args[i], args[i + 1]); appendPair(data->path, args[i + 2], args[i + 3]); } @@ -982,11 +977,9 @@ void SvgFileSplitter::convertHVSlot(QChar command, bool relative, QList break; case 'a': data->path.append(command); - x = data->x; - y = data->y; for (int i = 0; i < args.count(); i += 7) { - data->x = x + args[i + 5]; - data->y = y + args[i + 6]; + data->x += args[i + 5]; + data->y += args[i + 6]; appendPair(data->path, args[i], args[i + 1]); appendPair(data->path, args[i + 2], args[i + 3]); appendPair(data->path, args[i + 4], args[i + 5]); @@ -997,18 +990,16 @@ void SvgFileSplitter::convertHVSlot(QChar command, bool relative, QList break; case 'v': data->path.append('l'); - y = data->y; for (int i = 0; i < args.count(); i++) { - data->y = y + args[i]; + data->y += args[i]; appendPair(data->path, 0, args[i]); } data->path.chop(1); break; case 'h': data->path.append('l'); - x = data->x; for (int i = 0; i < args.count(); i++) { - data->x = x + args[i]; + data->x += args[i]; appendPair(data->path, args[i], 0); } data->path.chop(1); diff --git a/src/utils/textutils.cpp b/src/utils/textutils.cpp index bb880e10d..b98e9e1ad 100644 --- a/src/utils/textutils.cpp +++ b/src/utils/textutils.cpp @@ -903,7 +903,12 @@ QMatrix TextUtils::transformStringToMatrix(const QString & transform) { return QMatrix(floats[0], floats[1], floats[2], floats[3], floats[4], floats[5]); } else if (transform.startsWith("scale")) { - return QMatrix().scale(floats[0], floats[1]); + if (floats.size() == 2) { + return QMatrix().scale(floats[0], floats[1]); + } else { + Q_ASSERT(floats.size() == 1); + return QMatrix().scale(floats[0], floats[0]); + } } else if (transform.startsWith("skewX")) { return QMatrix().shear(floats[0], 0); From 8f950b5025c1ebc0d8a83cf80a6ed9bc40af9ae5 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Fri, 8 Nov 2019 21:57:50 +0100 Subject: [PATCH 07/61] Fix 2961: cache did not take part placement into account --- src/items/paletteitembase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/items/paletteitembase.cpp b/src/items/paletteitembase.cpp index 4cf37d380..061388558 100644 --- a/src/items/paletteitembase.cpp +++ b/src/items/paletteitembase.cpp @@ -622,7 +622,7 @@ QString PaletteItemBase::retrieveSvg(ViewLayer::ViewLayerID viewLayerID, QHash Date: Fri, 8 Nov 2019 22:03:26 +0100 Subject: [PATCH 08/61] NULL -> nullptr --- src/items/itembase.cpp | 182 ++++++++++++++++++------------------ src/model/modelpart.cpp | 114 +++++++++++----------- src/svg/gerbergenerator.cpp | 20 ++-- src/svg/svgpathrunner.cpp | 12 +-- src/viewlayer.cpp | 8 +- 5 files changed, 168 insertions(+), 168 deletions(-) diff --git a/src/items/itembase.cpp b/src/items/itembase.cpp index b2b2519d0..2bcb6e978 100644 --- a/src/items/itembase.cpp +++ b/src/items/itembase.cpp @@ -103,7 +103,7 @@ const QString ItemBase::ITEMBASE_FONT_SUFFIX = ""; QHash ItemBase::TranslatedPropertyNames; -QPointer ItemBase::TheReferenceModel = NULL; +QPointer ItemBase::TheReferenceModel = nullptr; QString ItemBase::PartInstanceDefaultTitle; const QList ItemBase::EmptyList; @@ -139,8 +139,8 @@ static QHash CachedValues; ItemBase::ItemBase( ModelPart* modelPart, ViewLayer::ViewID viewID, const ViewGeometry & viewGeometry, long id, QMenu * itemMenu ) : QGraphicsSvgItem() { - m_fsvgRenderer = NULL; - m_superpart = NULL; + m_fsvgRenderer = nullptr; + m_superpart = nullptr; m_acceptsMousePressLegEvent = true; m_squashShape = false; @@ -148,14 +148,14 @@ ItemBase::ItemBase( ModelPart* modelPart, ViewLayer::ViewID viewID, const ViewGe //DebugDialog::debug(QString("itembase %1 %2").arg(id).arg((long) static_cast(this), 0, 16)); m_hasRubberBandLeg = m_moveLock = m_hoverEnterSpaceBarWasPressed = m_spaceBarWasPressed = false; - m_moveLockItem = NULL; - m_stickyItem = NULL; + m_moveLockItem = nullptr; + m_stickyItem = nullptr; m_swappable = m_everVisible = true; - m_rightClickedConnector = NULL; + m_rightClickedConnector = nullptr; - m_partLabel = NULL; + m_partLabel = nullptr; m_itemMenu = itemMenu; m_hoverCount = m_connectorHoverCount = m_connectorHoverCount2 = 0; m_viewID = viewID; @@ -177,7 +177,7 @@ ItemBase::~ItemBase() { //DebugDialog::debug(QString("deleting itembase %1 %2 %3").arg((long) this, 0, 16).arg(m_id).arg((long) m_modelPart, 0, 16)); if (m_partLabel) { delete m_partLabel; - m_partLabel = NULL; + m_partLabel = nullptr; } foreach (ConnectorItem * connectorItem, cachedConnectorItems()) { @@ -190,7 +190,7 @@ ItemBase::~ItemBase() { itemBase->addSticky(this, false); } - if (m_modelPart != NULL) { + if (m_modelPart != nullptr) { m_modelPart->removeViewItem(this); } @@ -258,7 +258,7 @@ void ItemBase::setModelPart(ModelPart * modelPart) { } ModelPartShared * ItemBase::modelPartShared() { - if (m_modelPart == NULL) return NULL; + if (m_modelPart == nullptr) return nullptr; return m_modelPart->modelPartShared(); } @@ -420,7 +420,7 @@ void ItemBase::setViewLayerID(ViewLayer::ViewLayerID viewLayerID, const LayerHas m_viewLayerID = viewLayerID; if (m_zUninitialized) { ViewLayer * viewLayer = viewLayers.value(m_viewLayerID); - if (viewLayer != NULL) { + if (viewLayer != nullptr) { m_zUninitialized = false; if (!viewLayer->alreadyInLayer(m_viewGeometry.z())) { m_viewGeometry.setZ(viewLayer->nextZ()); @@ -535,11 +535,11 @@ void ItemBase::connectedMoved(ConnectorItem * from, ConnectorItem * to, QList(item); - if (itemBase == NULL) return NULL; + if (itemBase == nullptr) return nullptr; if (itemBase->topLevel()) return itemBase; - return NULL; + return nullptr; } bool ItemBase::topLevel() { @@ -552,7 +552,7 @@ void ItemBase::setHidden(bool hide) { updateHidden(); foreach (QGraphicsItem * item, childItems()) { NonConnectorItem * nonconnectorItem = dynamic_cast(item); - if (nonconnectorItem == NULL) continue; + if (nonconnectorItem == nullptr) continue; nonconnectorItem->setHidden(hide); } @@ -564,7 +564,7 @@ void ItemBase::setInactive(bool inactivate) { updateHidden(); foreach (QGraphicsItem * item, childItems()) { NonConnectorItem * nonconnectorItem = dynamic_cast(item); - if (nonconnectorItem == NULL) continue; + if (nonconnectorItem == nullptr) continue; nonconnectorItem->setInactive(inactivate); } @@ -576,7 +576,7 @@ void ItemBase::setLayerHidden(bool layerHidden) { updateHidden(); foreach (QGraphicsItem * item, childItems()) { NonConnectorItem * nonconnectorItem = dynamic_cast(item); - if (nonconnectorItem == NULL) continue; + if (nonconnectorItem == nullptr) continue; nonconnectorItem->setLayerHidden(layerHidden); } @@ -603,7 +603,7 @@ bool ItemBase::inactive() { void ItemBase::collectConnectors(ConnectorPairHash & connectorHash, SkipCheckFunction skipCheckFunction) { // Is this modelpart check obsolete? ModelPart * modelPart = this->modelPart(); - if (modelPart == NULL) return; + if (modelPart == nullptr) return; // collect all the connectorItem pairs @@ -615,7 +615,7 @@ void ItemBase::collectConnectors(ConnectorPairHash & connectorHash, SkipCheckFun } ConnectorItem * crossConnectorItem = fromConnectorItem->getCrossLayerConnectorItem(); - if (crossConnectorItem == NULL) continue; + if (crossConnectorItem == nullptr) continue; foreach (ConnectorItem * toConnectorItem, crossConnectorItem->connectedToItems()) { if (skipCheckFunction && skipCheckFunction(toConnectorItem)) continue; @@ -631,7 +631,7 @@ ConnectorItem * ItemBase::findConnectorItemWithSharedID(const QString & connecto return connector->connectorItem(m_viewID); } - return NULL; + return nullptr; } ConnectorItem * ItemBase::findConnectorItemWithSharedID(const QString & connectorID, ViewLayer::ViewLayerPlacement viewLayerPlacement) { @@ -640,13 +640,13 @@ ConnectorItem * ItemBase::findConnectorItemWithSharedID(const QString & connecto return connectorItem->chooseFromSpec(viewLayerPlacement); } - return NULL; + return nullptr; } void ItemBase::hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) { // debugInfo("itembase hover enter"); InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL && infoGraphicsView->spaceBarIsPressed()) { + if (infoGraphicsView != nullptr && infoGraphicsView->spaceBarIsPressed()) { m_hoverEnterSpaceBarWasPressed = true; event->ignore(); return; @@ -656,7 +656,7 @@ void ItemBase::hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) { m_hoverCount++; //debugInfo(QString("inc hover %1").arg(m_hoverCount)); hoverUpdate(); - if (infoGraphicsView != NULL) { + if (infoGraphicsView != nullptr) { infoGraphicsView->hoverEnterItem(event, this); } } @@ -674,7 +674,7 @@ void ItemBase::hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView != nullptr) { infoGraphicsView->hoverLeaveItem(event, this); } } @@ -695,25 +695,25 @@ void ItemBase::updateConnections(ConnectorItem * connectorItem, bool includeRats } const QString & ItemBase::title() { - if (m_modelPart == NULL) return ___emptyString___; + if (m_modelPart == nullptr) return ___emptyString___; return m_modelPart->title(); } const QString & ItemBase::constTitle() const { - if (m_modelPart == NULL) return ___emptyString___; + if (m_modelPart == nullptr) return ___emptyString___; return m_modelPart->title(); } const QString & ItemBase::spice() const { - if (m_modelPart == NULL) return ___emptyString___; + if (m_modelPart == nullptr) return ___emptyString___; return m_modelPart->spice(); } const QString & ItemBase::spiceModel() const { - if (m_modelPart == NULL) return ___emptyString___; + if (m_modelPart == nullptr) return ___emptyString___; return m_modelPart->spiceModel(); } @@ -724,7 +724,7 @@ bool ItemBase::getRatsnest() { QList ItemBase::buses() { QList busList; - if (m_modelPart == NULL) return busList; + if (m_modelPart == nullptr) return busList; foreach (Bus * bus, m_modelPart->buses().values()) { busList.append(bus); @@ -736,11 +736,11 @@ QList ItemBase::buses() { void ItemBase::busConnectorItems(class Bus * bus, ConnectorItem * fromConnectorItem, QList & items) { Q_UNUSED(fromConnectorItem) - if (bus == NULL) return; + if (bus == nullptr) return; foreach (Connector * connector, bus->connectors()) { foreach (ConnectorItem * connectorItem, connector->viewItems()) { - if (connectorItem != NULL) { + if (connectorItem != nullptr) { //connectorItem->debugInfo(QString("on the bus %1").arg((long) connector, 0, 16)); if (connectorItem->attachedTo() == this) { items.append(connectorItem); @@ -753,7 +753,7 @@ void ItemBase::busConnectorItems(class Bus * bus, ConnectorItem * fromConnectorI Connector * connector = bus->subConnector(); if (connector) { foreach (ConnectorItem * connectorItem, connector->viewItems()) { - if (connectorItem != NULL) { + if (connectorItem != nullptr) { //connectorItem->debugInfo(QString("on the bus %1").arg((long) connector, 0, 16)); if (connectorItem->attachedToViewID() == m_viewID) { items.append(connectorItem); @@ -776,7 +776,7 @@ void ItemBase::busConnectorItems(class Bus * bus, ConnectorItem * fromConnectorI int ItemBase::itemType() const { - if (m_modelPart == NULL) return ModelPart::Unknown; + if (m_modelPart == nullptr) return ModelPart::Unknown; return m_modelPart->itemType(); } @@ -848,7 +848,7 @@ void ItemBase::paintHover(QPainter *painter, const QStyleOptionGraphicsItem *opt void ItemBase::mousePressEvent(QGraphicsSceneMouseEvent *event) { InfoGraphicsView *infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL && infoGraphicsView->spaceBarIsPressed()) { + if (infoGraphicsView != nullptr && infoGraphicsView->spaceBarIsPressed()) { event->ignore(); return; } @@ -860,7 +860,7 @@ void ItemBase::mousePressEvent(QGraphicsSceneMouseEvent *event) { void ItemBase::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - m_rightClickedConnector = NULL; + m_rightClickedConnector = nullptr; // calling parent class so that multiple selection will work // haven't yet discovered any nasty side-effect QGraphicsSvgItem::mouseReleaseEvent(event); @@ -917,7 +917,7 @@ void ItemBase::setLocalSticky(bool s) modelPart()->setLocalProp("sticky", s ? "true" : "false"); if (s) { - if (m_stickyItem == NULL) { + if (m_stickyItem == nullptr) { if (!StickyRenderer.isValid()) { QString fn(":resources/images/part_sticky.svg"); bool success = StickyRenderer.load(fn); @@ -929,7 +929,7 @@ void ItemBase::setLocalSticky(bool s) m_stickyItem->setAcceptHoverEvents(false); m_stickyItem->setAcceptedMouseButtons(Qt::NoButton); m_stickyItem->setSharedRenderer(&StickyRenderer); - m_stickyItem->setPos(m_moveLockItem == NULL ? 0 : m_moveLockItem->boundingRect().width() + 1, 0); + m_stickyItem->setPos(m_moveLockItem == nullptr ? 0 : m_moveLockItem->boundingRect().width() + 1, 0); m_stickyItem->setZValue(-99999); m_stickyItem->setParentItem(this); m_stickyItem->setVisible(true); @@ -938,7 +938,7 @@ void ItemBase::setLocalSticky(bool s) else { if (m_stickyItem) { delete m_stickyItem; - m_stickyItem = NULL; + m_stickyItem = nullptr; } } @@ -967,9 +967,9 @@ void ItemBase::addSticky(ItemBase * stickyBase, bool stickem) { ItemBase * ItemBase::stickingTo() { - if (isBaseSticky()) return NULL; + if (isBaseSticky()) return nullptr; - if (m_stickyList.count() < 1) return NULL; + if (m_stickyList.count() < 1) return nullptr; if (m_stickyList.count() > 1) { DebugDialog::debug(QString("error: sticky list > 1 %1").arg(title())); @@ -983,7 +983,7 @@ QList< QPointer > ItemBase::stickyList() { } bool ItemBase::alreadySticking(ItemBase * itemBase) { - return m_stickyList.value(itemBase->layerKinChief()->id(), NULL) != NULL; + return m_stickyList.value(itemBase->layerKinChief()->id(), nullptr) != nullptr; } ConnectorItem* ItemBase::newConnectorItem(Connector *connector) @@ -1001,7 +1001,7 @@ ConnectorItem * ItemBase::anyConnectorItem() { return connectorItem; } - return NULL; + return nullptr; } @@ -1033,7 +1033,7 @@ void ItemBase::setInstanceTitleAux(const QString &title, bool initial) setInstanceTitleTooltip(title); // InfoGraphicsView *infographics = InfoGraphicsView::getInfoGraphicsView(this); -// if (infographics != NULL) { +// if (infographics != nullptr) { // infographics->setItemTooltip(this, title); // } } @@ -1095,11 +1095,11 @@ void ItemBase::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) scene()->clearSelection(); setSelected(true); - if (m_itemMenu != NULL) { - m_rightClickedConnector = NULL; + if (m_itemMenu != nullptr) { + m_rightClickedConnector = nullptr; foreach (QGraphicsItem * item, scene()->items(event->scenePos())) { ConnectorItem * connectorItem = dynamic_cast(item); - if (connectorItem == NULL) continue; + if (connectorItem == nullptr) continue; if (connectorItem->attachedTo() == this) { m_rightClickedConnector = connectorItem; @@ -1117,7 +1117,7 @@ bool ItemBase::hasConnectors() { bool ItemBase::hasNonConnectors() { foreach (QGraphicsItem * childItem, childItems()) { - if (dynamic_cast(childItem) != NULL) return true; + if (dynamic_cast(childItem) != nullptr) return true; } return false; @@ -1163,7 +1163,7 @@ bool ItemBase::freeRotationAllowed() { } void ItemBase::clearModelPart() { - m_modelPart = NULL; + m_modelPart = nullptr; } void ItemBase::hidePartLabel() @@ -1183,13 +1183,13 @@ void ItemBase::partLabelChanged(const QString & newText) { InfoGraphicsView *infographics = InfoGraphicsView::getInfoGraphicsView(this); QString oldText = modelPart()->instanceTitle(); setInstanceTitleAux(newText, false); - if (infographics != NULL) { + if (infographics != nullptr) { infographics->partLabelChanged(this, oldText, newText); } } bool ItemBase::isPartLabelVisible() { - if (m_partLabel == NULL) return false; + if (m_partLabel == nullptr) return false; if (!hasPartLabel()) return false; if (!m_partLabel->initialized()) return false; @@ -1197,7 +1197,7 @@ bool ItemBase::isPartLabelVisible() { } void ItemBase::clearPartLabel() { - m_partLabel = NULL; + m_partLabel = nullptr; } void ItemBase::restorePartLabel(QDomElement & labelGeometry, ViewLayer::ViewLayerID viewLayerID) @@ -1225,7 +1225,7 @@ void ItemBase::partLabelSetHidden(bool hide) { void ItemBase::partLabelMoved(QPointF oldPos, QPointF oldOffset, QPointF newPos, QPointF newOffset) { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView != nullptr) { infoGraphicsView->partLabelMoved(this, oldPos, oldOffset, newPos, newOffset); } } @@ -1233,7 +1233,7 @@ void ItemBase::partLabelMoved(QPointF oldPos, QPointF oldOffset, QPointF newPos, void ItemBase::rotateFlipPartLabel(double degrees, Qt::Orientations orientation) { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView != nullptr) { infoGraphicsView->rotateFlipPartLabel(this, degrees, orientation); } } @@ -1373,9 +1373,9 @@ FSvgRenderer * ItemBase::setUpImage(ModelPart * modelPart, LayerAttributes & lay ModelPartShared * modelPartShared = modelPart->modelPartShared(); - if (modelPartShared == NULL) { + if (modelPartShared == nullptr) { layerAttributes.error = tr("model part problem"); - return NULL; + return nullptr; } //if (modelPartShared->moduleID() == "df9d072afa2b594ac67b60b4153ff57b_29" && viewID == ViewLayer::PCBView) { @@ -1397,7 +1397,7 @@ FSvgRenderer * ItemBase::setUpImage(ModelPart * modelPart, LayerAttributes & lay if (filename.isEmpty()) { //QString deleteme = modelPartShared->domDocument()->toString(); layerAttributes.error = tr("file for %1 %2 not found").arg(modelPartShared->title()).arg(modelPartShared->moduleID()); - return NULL; + return nullptr; } LoadInfo loadInfo; @@ -1444,7 +1444,7 @@ FSvgRenderer * ItemBase::setUpImage(ModelPart * modelPart, LayerAttributes & lay bool hasText = false; bytesToLoad = SvgFileSplitter::showText(filename, hasText); if (!hasText) { - return NULL; + return nullptr; } } else if ((layerAttributes.viewID != ViewLayer::IconView) && modelPartShared->hasMultipleLayers(layerAttributes.viewID)) { @@ -1500,7 +1500,7 @@ FSvgRenderer * ItemBase::setUpImage(ModelPart * modelPart, LayerAttributes & lay if (resultBytes.isEmpty()) { delete newRenderer; layerAttributes.error = tr("unable to create renderer for svg %1").arg(filename); - newRenderer = NULL; + newRenderer = nullptr; } //DebugDialog::debug(QString("set up image elapsed (3) %1").arg(t.elapsed()) ); @@ -1602,7 +1602,7 @@ bool ItemBase::connectionIsAllowed(ConnectorItem * other) { } QString ItemBase::getProperty(const QString & key) { - if (m_modelPart == NULL) return ""; + if (m_modelPart == nullptr) return ""; QString result = m_modelPart->localProp(key).toString(); if (!result.isEmpty()) return result; @@ -1661,13 +1661,13 @@ void ItemBase::setProp(const QString & prop, const QString & value) { QString ItemBase::prop(const QString & p) { - if (m_modelPart == NULL) return ""; + if (m_modelPart == nullptr) return ""; return m_modelPart->localProp(p).toString(); } bool ItemBase::isObsolete() { - if (modelPart() == NULL) return false; + if (modelPart() == nullptr) return false; return modelPart()->isObsolete(); } @@ -1675,7 +1675,7 @@ bool ItemBase::isObsolete() { bool ItemBase::collectExtraInfo(QWidget * parent, const QString & family, const QString & prop, const QString & value, bool swappingEnabled, QString & returnProp, QString & returnValue, QWidget * & returnWidget, bool & hide) { Q_UNUSED(hide); // assume this is set by the caller (HtmlInfoView) - returnWidget = NULL; + returnWidget = nullptr; returnProp = ItemBase::translatePropertyName(prop); returnValue = value; @@ -1721,12 +1721,12 @@ bool ItemBase::collectExtraInfo(QWidget * parent, const QString & family, const void ItemBase::swapEntry(const QString & text) { FamilyPropertyComboBox * comboBox = qobject_cast(sender()); - if (comboBox == NULL) return; + if (comboBox == nullptr) return; m_propsMap.insert(comboBox->prop(), text); InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView != nullptr) { infoGraphicsView->swap(comboBox->family(), comboBox->prop(), m_propsMap, this); } } @@ -1738,7 +1738,7 @@ void ItemBase::setReferenceModel(ReferenceModel * rm) { QStringList ItemBase::collectValues(const QString & family, const QString & prop, QString & value) { Q_UNUSED(value); - if (TheReferenceModel == NULL) return ___emptyStringList___; + if (TheReferenceModel == nullptr) return ___emptyStringList___; QStringList values = CachedValues.value(family + prop, QStringList()); if (values.count() > 0) return values; @@ -1799,25 +1799,25 @@ void ItemBase::setViewLayerPlacement(ViewLayer::ViewLayerPlacement viewLayerPlac } ViewLayer::ViewLayerID ItemBase::partLabelViewLayerID() { - if (m_partLabel == NULL) return ViewLayer::UnknownLayer; + if (m_partLabel == nullptr) return ViewLayer::UnknownLayer; if (!m_partLabel->initialized()) return ViewLayer::UnknownLayer; return m_partLabel->viewLayerID(); } QString ItemBase::makePartLabelSvg(bool blackOnly, double dpi, double printerScale) { - if (m_partLabel == NULL) return ""; + if (m_partLabel == nullptr) return ""; if (!m_partLabel->initialized()) return ""; return m_partLabel->makeSvg(blackOnly, dpi, printerScale, true); } QPointF ItemBase::partLabelScenePos() { - if (m_partLabel == NULL) return QPointF(); + if (m_partLabel == nullptr) return QPointF(); if (!m_partLabel->initialized()) return QPointF(); return m_partLabel->scenePos(); } QRectF ItemBase::partLabelSceneBoundingRect() { - if (m_partLabel == NULL) return QRectF(); + if (m_partLabel == nullptr) return QRectF(); if (!m_partLabel->initialized()) return QRectF(); return m_partLabel->sceneBoundingRect(); } @@ -1906,7 +1906,7 @@ void ItemBase::setMoveLock(bool moveLock) { m_moveLock = moveLock; if (moveLock) { - if (m_moveLockItem == NULL) { + if (m_moveLockItem == nullptr) { if (!MoveLockRenderer.isValid()) { QString fn(":resources/images/part_lock.svg"); bool success = MoveLockRenderer.load(fn); @@ -1927,12 +1927,12 @@ void ItemBase::setMoveLock(bool moveLock) else { if (m_moveLockItem) { delete m_moveLockItem; - m_moveLockItem = NULL; + m_moveLockItem = nullptr; } } if (m_stickyItem) { - m_stickyItem->setPos(m_moveLockItem == NULL ? 0 : m_moveLockItem->boundingRect().width() + 1, 0); + m_stickyItem->setPos(m_moveLockItem == nullptr ? 0 : m_moveLockItem->boundingRect().width() + 1, 0); } update(); @@ -2022,7 +2022,7 @@ const QList & ItemBase::cachedConnectorItems() if (m_cachedConnectorItems.isEmpty()) { foreach (QGraphicsItem * childItem, childItems()) { ConnectorItem * connectorItem = dynamic_cast(childItem); - if (connectorItem != NULL) m_cachedConnectorItems.append(connectorItem); + if (connectorItem != nullptr) m_cachedConnectorItems.append(connectorItem); } } @@ -2061,7 +2061,7 @@ QRectF ItemBase::boundingRectWithoutLegs() const QRectF ItemBase::boundingRect() const { FSvgRenderer * frenderer = fsvgRenderer(); - if (frenderer == NULL) { + if (frenderer == nullptr) { return QGraphicsSvgItem::boundingRect(); } @@ -2099,7 +2099,7 @@ FSvgRenderer * ItemBase::fsvgRenderer() const { if (m_fsvgRenderer) return m_fsvgRenderer; FSvgRenderer * f = qobject_cast(renderer()); - if (f == NULL) { + if (f == nullptr) { DebugDialog::debug("shouldn't happen: missing fsvgRenderer"); } return f; @@ -2167,18 +2167,18 @@ void ItemBase::getPixmaps(QPixmap * & pixmap1, QPixmap * & pixmap2, QPixmap * & QPixmap * ItemBase::getPixmap(ViewLayer::ViewID vid, bool swappingEnabled, QSize size) { - ItemBase * vItemBase = NULL; + ItemBase * vItemBase = nullptr; if (viewID() == vid) { - if (!isEverVisible()) return NULL; + if (!isEverVisible()) return nullptr; } else { vItemBase = modelPart()->viewItem(vid); - if (vItemBase && !vItemBase->isEverVisible()) return NULL; + if (vItemBase && !vItemBase->isEverVisible()) return nullptr; } vid = useViewIDForPixmap(vid, swappingEnabled); - if (vid == ViewLayer::UnknownView) return NULL; + if (vid == ViewLayer::UnknownView) return nullptr; if (viewID() == vid) { return getPixmap(size); @@ -2189,14 +2189,14 @@ QPixmap * ItemBase::getPixmap(ViewLayer::ViewID vid, bool swappingEnabled, QSize } - if (!modelPart()->hasViewFor(vid)) return NULL; + if (!modelPart()->hasViewFor(vid)) return nullptr; QString baseName = modelPart()->hasBaseNameFor(vid); - if (baseName.isEmpty()) return NULL; + if (baseName.isEmpty()) return nullptr; QString filename = PartFactory::getSvgFilename(modelPart(), baseName, true, true); if (filename.isEmpty()) { - return NULL; + return nullptr; } QSvgRenderer renderer(filename); @@ -2261,11 +2261,11 @@ void ItemBase::addSubpart(ItemBase * sub) sub->setSuperpart(this); foreach (ConnectorItem * connectorItem, sub->cachedConnectorItems()) { Bus * subbus = connectorItem->bus(); - Connector * subconnector = NULL; - if (subbus == NULL) { + Connector * subconnector = nullptr; + if (subbus == nullptr) { subconnector = connectorItem->connector(); if (subconnector) { - subbus = new Bus(NULL, NULL); + subbus = new Bus(nullptr, nullptr); subconnector->setBus(subbus); } } @@ -2275,8 +2275,8 @@ void ItemBase::addSubpart(ItemBase * sub) if (subbus) subbus->addSubConnector(connector); if (subconnector) { Bus * bus = connector->bus(); - if (bus == NULL) { - bus = new Bus(NULL, NULL); + if (bus == nullptr) { + bus = new Bus(nullptr, nullptr); connector->setBus(bus); } @@ -2300,7 +2300,7 @@ ItemBase * ItemBase::findSubpart(const QString & connectorID, ViewLayer::ViewLay if (connectorItem) return itemBase; } - return NULL; + return nullptr; } const QList< QPointer > & ItemBase::subparts() @@ -2335,7 +2335,7 @@ QHash ItemBase::prepareProps(ModelPart * modelPart, bool wantD int insertAt = 2; PaletteItemBase * paletteItemBase = qobject_cast(this); - if (paletteItemBase != NULL) { + if (paletteItemBase != nullptr) { props.insert("svg", paletteItemBase->filename()); keys.insert(insertAt++, "svg"); } @@ -2433,7 +2433,7 @@ void ItemBase::initLayerAttributes(LayerAttributes & layerAttributes, ViewLayer: layerAttributes.doConnectors = doConnectors; layerAttributes.createShape = doCreateShape; InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView != nullptr) { layerAttributes.orientation = infoGraphicsView->smdOrientation(); } } @@ -2443,7 +2443,7 @@ void ItemBase::showInFolder() { if (!path.isEmpty()) { FolderUtils::showInFolder(path); QClipboard *clipboard = QApplication::clipboard(); - if (clipboard != NULL) { + if (clipboard != nullptr) { clipboard->setText(path); } } @@ -2458,7 +2458,7 @@ QString ItemBase::getInspectorTitle() { void ItemBase::setInspectorTitle(const QString & oldText, const QString & newText) { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView == NULL) return; + if (infoGraphicsView == nullptr) return; DebugDialog::debug(QString("set instance title to %1").arg(newText)); infoGraphicsView->setInstanceTitle(id(), oldText, newText, true, false); diff --git a/src/model/modelpart.cpp b/src/model/modelpart.cpp index 5d81c3989..6a104de92 100644 --- a/src/model/modelpart.cpp +++ b/src/model/modelpart.cpp @@ -50,7 +50,7 @@ ModelPart::ModelPart(ItemType type) : QObject() { commonInit(type); - m_modelPartShared = NULL; + m_modelPartShared = nullptr; m_index = m_nextIndex++; } @@ -91,37 +91,37 @@ ModelPart::~ModelPart() { } const QString & ModelPart::moduleID() const { - if (m_modelPartShared != NULL) return m_modelPartShared->moduleID(); + if (m_modelPartShared != nullptr) return m_modelPartShared->moduleID(); return ___emptyString___; } const QString & ModelPart::label() { - if (m_modelPartShared != NULL) return m_modelPartShared->label(); + if (m_modelPartShared != nullptr) return m_modelPartShared->label(); return ___emptyString___; } const QString & ModelPart::author() { - if (m_modelPartShared != NULL) return m_modelPartShared->author(); + if (m_modelPartShared != nullptr) return m_modelPartShared->author(); return ___emptyString___; } const QString & ModelPart::taxonomy() { - if (m_modelPartShared != NULL) return m_modelPartShared->taxonomy(); + if (m_modelPartShared != nullptr) return m_modelPartShared->taxonomy(); return ___emptyString___; } const QString & ModelPart::uri() { - if (m_modelPartShared != NULL) return m_modelPartShared->uri(); + if (m_modelPartShared != nullptr) return m_modelPartShared->uri(); return ___emptyString___; } const QDate & ModelPart::date() { - if (m_modelPartShared != NULL) return m_modelPartShared->date(); + if (m_modelPartShared != nullptr) return m_modelPartShared->date(); static QDate tempDate; tempDate = QDate::currentDate(); @@ -133,7 +133,7 @@ void ModelPart::setItemType(ItemType t) { } void ModelPart::copy(ModelPart * modelPart) { - if (modelPart == NULL) return; + if (modelPart == nullptr) return; m_type = modelPart->itemType(); m_modelPartShared = modelPart->modelPartShared(); @@ -179,7 +179,7 @@ ItemBase * ModelPart::viewItem(QGraphicsScene * scene) { if (itemBase->scene() == scene) return itemBase; } - return NULL; + return nullptr; } ItemBase * ModelPart::viewItem(ViewLayer::ViewID viewID) { @@ -187,7 +187,7 @@ ItemBase * ModelPart::viewItem(ViewLayer::ViewID viewID) { if (itemBase->viewID() == viewID) return itemBase; } - return NULL; + return nullptr; } void ModelPart::saveInstances(const QString & fileName, QXmlStreamWriter & streamWriter, bool startDocument) { @@ -214,7 +214,7 @@ void ModelPart::saveInstances(const QString & fileName, QXmlStreamWriter & strea streamWriter.writeStartElement("instances"); } - if (parent() != NULL) { // m_viewItems.size() > 0 + if (parent() != nullptr) { // m_viewItems.size() > 0 saveInstance(streamWriter); } @@ -226,7 +226,7 @@ void ModelPart::saveInstances(const QString & fileName, QXmlStreamWriter & strea QList::const_iterator i; for (i = children.constBegin(); i != children.constEnd(); ++i) { ModelPart* mp = qobject_cast(*i); - if (mp == NULL) continue; + if (mp == nullptr) continue; mp->saveInstances(fileName, streamWriter, false); } @@ -246,7 +246,7 @@ void ModelPart::saveInstance(QXmlStreamWriter & streamWriter) } streamWriter.writeStartElement("instance"); - if (m_modelPartShared != NULL) { + if (m_modelPartShared != nullptr) { QString moduleIdRef = m_modelPartShared->moduleID(); moduleIdRef.remove(PartFactory::OldSchematicPrefix); streamWriter.writeAttribute("moduleIdRef", moduleIdRef); @@ -402,7 +402,7 @@ void ModelPart::saveAsPart(QXmlStreamWriter & streamWriter, bool startDocument) QList::const_iterator i; for (i = children().constBegin(); i != children().constEnd(); ++i) { ModelPart * mp = qobject_cast(*i); - if (mp == NULL) continue; + if (mp == nullptr) continue; mp->saveAsPart(streamWriter, false); } @@ -415,7 +415,7 @@ void ModelPart::saveAsPart(QXmlStreamWriter & streamWriter, bool startDocument) } void ModelPart::initConnectors(bool force) { - if(m_modelPartShared == NULL) return; + if(m_modelPartShared == nullptr) return; if(force) { foreach (Connector * connector, m_connectorHash.values()) { @@ -446,9 +446,9 @@ void ModelPart::clearBuses() { void ModelPart::initBuses() { foreach (Connector * connector, m_connectorHash.values()) { BusShared * busShared = connector->connectorShared()->bus(); - if (busShared != NULL) { + if (busShared != nullptr) { Bus * bus = m_busHash.value(busShared->id()); - if (bus == NULL) { + if (bus == nullptr) { bus = new Bus(busShared, this); m_busHash.insert(busShared->id(), bus); } @@ -509,7 +509,7 @@ const QDomElement & ModelPart::instanceDomElement() { const QString & ModelPart::fritzingVersion() { - if (m_modelPartShared != NULL) return m_modelPartShared->fritzingVersion(); + if (m_modelPartShared != nullptr) return m_modelPartShared->fritzingVersion(); return ___emptyString___; } @@ -517,7 +517,7 @@ const QString & ModelPart::fritzingVersion() { const QString & ModelPart::title() { if (!m_localTitle.isEmpty()) return m_localTitle; - if (m_modelPartShared != NULL) return m_modelPartShared->title(); + if (m_modelPartShared != nullptr) return m_modelPartShared->title(); return m_localTitle; } @@ -527,49 +527,49 @@ void ModelPart::setLocalTitle(const QString & localTitle) { } const QString & ModelPart::version() { - if (m_modelPartShared != NULL) return m_modelPartShared->version(); + if (m_modelPartShared != nullptr) return m_modelPartShared->version(); return ___emptyString___; } const QString & ModelPart::path() { - if (m_modelPartShared != NULL) return m_modelPartShared->path(); + if (m_modelPartShared != nullptr) return m_modelPartShared->path(); return ___emptyString___; } const QString & ModelPart::description() { - if (m_modelPartShared != NULL) return m_modelPartShared->description(); + if (m_modelPartShared != nullptr) return m_modelPartShared->description(); return ___emptyString___; } const QString & ModelPart::spice() { - if (m_modelPartShared != NULL) return m_modelPartShared->spice(); + if (m_modelPartShared != nullptr) return m_modelPartShared->spice(); return ___emptyString___; } const QString & ModelPart::spiceModel() { - if (m_modelPartShared != NULL) return m_modelPartShared->spiceModel(); + if (m_modelPartShared != nullptr) return m_modelPartShared->spiceModel(); return ___emptyString___; } const QString & ModelPart::url() { - if (m_modelPartShared != NULL) return m_modelPartShared->url(); + if (m_modelPartShared != nullptr) return m_modelPartShared->url(); return ___emptyString___; } const QStringList & ModelPart::tags() { - if (m_modelPartShared != NULL) return m_modelPartShared->tags(); + if (m_modelPartShared != nullptr) return m_modelPartShared->tags(); return ___emptyStringList___; } const QHash & ModelPart::properties() const { - if (m_modelPartShared != NULL) return m_modelPartShared->properties(); + if (m_modelPartShared != nullptr) return m_modelPartShared->properties(); return ___emptyStringHash___; } @@ -587,7 +587,7 @@ Bus * ModelPart::bus(const QString & busID) { } bool ModelPart::ignoreTerminalPoints() { - if (m_modelPartShared != NULL) return m_modelPartShared->ignoreTerminalPoints(); + if (m_modelPartShared != nullptr) return m_modelPartShared->ignoreTerminalPoints(); return true; } @@ -690,7 +690,7 @@ QList ModelPart::getAllParts() { QList::const_iterator i; for (i = children().constBegin(); i != children().constEnd(); ++i) { ModelPart* mp = qobject_cast(*i); - if (mp == NULL) continue; + if (mp == nullptr) continue; retval << mp; } @@ -702,7 +702,7 @@ QList ModelPart::getAllNonCoreParts() { QList::const_iterator i; for (i = children().constBegin(); i != children().constEnd(); ++i) { ModelPart* mp = qobject_cast(*i); - if (mp == NULL) continue; + if (mp == nullptr) continue; if(!mp->isCore()) { retval << mp; @@ -734,15 +734,15 @@ void ModelPart::setInstanceText(QString text) { void ModelPart::clearOldInstanceTitle(const QString & title) { - InstanceTitleIncrementHash * itih = NULL; - if (parent() == NULL) { + InstanceTitleIncrementHash * itih = nullptr; + if (parent() == nullptr) { itih = &NullInstanceTitleIncrements; } else { - itih = AllInstanceTitleIncrements.value(parent(), NULL); + itih = AllInstanceTitleIncrements.value(parent(), nullptr); } - if (itih == NULL) return; + if (itih == nullptr) return; //DebugDialog::debug(QString("clearing title:%1 ix:%2").arg(title).arg(modelPart->modelIndex())); QString prefix = title; @@ -750,7 +750,7 @@ void ModelPart::clearOldInstanceTitle(const QString & title) if (ix >= 0) { prefix = InstanceTitleRegExp.cap(1); } - ModelPartList * modelParts = itih->value(prefix, NULL); + ModelPartList * modelParts = itih->value(prefix, nullptr); if (modelParts) { modelParts->removeOne(this); //DebugDialog::debug(QString("\tc:%1").arg(modelParts->count())); @@ -759,20 +759,20 @@ void ModelPart::clearOldInstanceTitle(const QString & title) ModelPartList * ModelPart::ensureInstanceTitleIncrements(const QString & prefix) { - InstanceTitleIncrementHash * itih = NULL; - if (parent() == NULL) { + InstanceTitleIncrementHash * itih = nullptr; + if (parent() == nullptr) { itih = &NullInstanceTitleIncrements; } else { - itih = AllInstanceTitleIncrements.value(parent(), NULL); - if (itih == NULL) { + itih = AllInstanceTitleIncrements.value(parent(), nullptr); + if (itih == nullptr) { itih = new InstanceTitleIncrementHash; AllInstanceTitleIncrements.insert(parent(), itih); } } - ModelPartList * modelParts = itih->value(prefix, NULL); - if (modelParts == NULL) { + ModelPartList * modelParts = itih->value(prefix, nullptr); + if (modelParts == nullptr) { modelParts = new ModelPartList; itih->insert(prefix, modelParts); } @@ -812,15 +812,15 @@ void ModelPart::setInstanceTitle(QString title, bool initial) { } bool ModelPart::setSubpartInstanceTitle() { - if (m_modelPartShared == NULL) return false; - if (m_modelPartShared->superpart() == NULL) return false; + if (m_modelPartShared == nullptr) return false; + if (m_modelPartShared->superpart() == nullptr) return false; if (m_viewItems.count() <= 0) return false; ItemBase * itemBase = m_viewItems.last(); - if (itemBase == NULL) return false; + if (itemBase == nullptr) return false; itemBase = itemBase->superpart(); - if (itemBase == NULL) return false; + if (itemBase == nullptr) return false; QString superTitle = itemBase->instanceTitle(); if (superTitle.isEmpty()) return false; @@ -856,7 +856,7 @@ QString ModelPart::getNextTitle(const QString & title) { int highestSoFar = 0; bool gotNull = false; foreach (ModelPart * modelPart, *modelParts) { - if (modelPart == NULL) { + if (modelPart == nullptr) { gotNull = true; continue; } @@ -870,7 +870,7 @@ QString ModelPart::getNextTitle(const QString & title) { } if (gotNull) { - modelParts->removeAll(NULL); + modelParts->removeAll(nullptr); } //DebugDialog::debug(QString("returning increment %1, %2").arg(prefix).arg(highestSoFar + 1)); @@ -909,19 +909,19 @@ const QStringList & ModelPart::possibleFolders() { } const QString & ModelPart::replacedby() { - if (m_modelPartShared != NULL) return m_modelPartShared->replacedby(); + if (m_modelPartShared != nullptr) return m_modelPartShared->replacedby(); return ___emptyString___; } bool ModelPart::isObsolete() { - if (m_modelPartShared != NULL) return !m_modelPartShared->replacedby().isEmpty(); + if (m_modelPartShared != nullptr) return !m_modelPartShared->replacedby().isEmpty(); return false; } bool ModelPart::flippedSMD() { - if (m_modelPartShared != NULL) { + if (m_modelPartShared != nullptr) { return m_modelPartShared->flippedSMD(); } @@ -929,7 +929,7 @@ bool ModelPart::flippedSMD() { } bool ModelPart::needsCopper1() { - if (m_modelPartShared != NULL) { + if (m_modelPartShared != nullptr) { return m_modelPartShared->needsCopper1(); } @@ -937,25 +937,25 @@ bool ModelPart::needsCopper1() { } bool ModelPart::hasViewFor(ViewLayer::ViewID viewID) { - if (m_modelPartShared == NULL) return false; + if (m_modelPartShared == nullptr) return false; return m_modelPartShared->hasViewFor(viewID); } bool ModelPart::hasViewFor(ViewLayer::ViewID viewID, ViewLayer::ViewLayerID viewLayerID) { - if (m_modelPartShared == NULL) return false; + if (m_modelPartShared == nullptr) return false; return m_modelPartShared->hasViewFor(viewID, viewLayerID); } QString ModelPart::hasBaseNameFor(ViewLayer::ViewID viewID) { - if (m_modelPartShared == NULL) return ___emptyString___; + if (m_modelPartShared == nullptr) return ___emptyString___; return m_modelPartShared->hasBaseNameFor(viewID); } const QStringList & ModelPart::displayKeys() { - if (m_modelPartShared == NULL) return ___emptyStringList___; + if (m_modelPartShared == nullptr) return ___emptyStringList___; return m_modelPartShared->displayKeys(); } @@ -968,7 +968,7 @@ ModelPart::ItemType ModelPart::itemType() const void ModelPart::setConnectorLocalName(const QString & id, const QString & name) { if (id.isEmpty()) return; - Connector * connector = m_connectorHash.value(id, NULL); + Connector * connector = m_connectorHash.value(id, nullptr); if (connector) { connector->setConnectorLocalName(name); } @@ -978,7 +978,7 @@ QString ModelPart::connectorLocalName(const QString & id) { if (id.isEmpty()) return ""; - Connector * connector = m_connectorHash.value(id, NULL); + Connector * connector = m_connectorHash.value(id, nullptr); if (connector) { return connector->connectorLocalName(); } diff --git a/src/svg/gerbergenerator.cpp b/src/svg/gerbergenerator.cpp index a9bae604a..9d1f7ccc3 100644 --- a/src/svg/gerbergenerator.cpp +++ b/src/svg/gerbergenerator.cpp @@ -79,14 +79,14 @@ bool pixelsCollide(QImage * image1, QImage * image2, int x1, int y1, int x2, int void GerberGenerator::exportToGerber(const QString & prefix, const QString & exportDir, ItemBase * board, PCBSketchWidget * sketchWidget, bool displayMessageBoxes) { - if (board == NULL) { + if (board == nullptr) { int boardCount; board = sketchWidget->findSelectedBoard(boardCount); if (boardCount == 0) { DebugDialog::debug("board not found"); return; } - if (board == NULL) { + if (board == nullptr) { DebugDialog::debug("multiple boards found"); return; } @@ -173,7 +173,7 @@ int GerberGenerator::doCopper(ItemBase * board, PCBSketchWidget * sketchWidget, QMultiHash treatAsCircle; foreach (QGraphicsItem * item, sketchWidget->scene()->collidingItems(board)) { ConnectorItem * connectorItem = dynamic_cast(item); - if (connectorItem == NULL) continue; + if (connectorItem == nullptr) continue; if (!connectorItem->isPath()) continue; if (connectorItem->radius() == 0) continue; @@ -245,7 +245,7 @@ int GerberGenerator::doDrill(ItemBase * board, PCBSketchWidget * sketchWidget, c QMultiHash treatAsCircle; foreach (QGraphicsItem * item, sketchWidget->scene()->collidingItems(board)) { ConnectorItem * connectorItem = dynamic_cast(item); - if (connectorItem == NULL) continue; + if (connectorItem == nullptr) continue; if (!connectorItem->isPath()) continue; if (connectorItem->radius() == 0) continue; @@ -360,7 +360,7 @@ bool GerberGenerator::saveEnd(const QString & layerName, const QString & exportD void GerberGenerator::displayMessage(const QString & message, bool displayMessageBoxes) { // don't use QMessageBox if running conversion as a service if (displayMessageBoxes) { - QMessageBox::warning(NULL, QObject::tr("Fritzing"), message); + QMessageBox::warning(nullptr, QObject::tr("Fritzing"), message); return; } @@ -489,7 +489,7 @@ QString GerberGenerator::clipToBoard(QString svgString, QRectF & boardRect, cons QSize imgSize(twidth + 2, theight + 2); QRectF target(0, 0, twidth, theight); - QImage * clipImage = NULL; + QImage * clipImage = nullptr; if (!clipString.isEmpty()) { clipImage = new QImage(imgSize, QImage::Format_Mono); clipImage->fill(0xffffffff); @@ -685,7 +685,7 @@ QString GerberGenerator::clipToBoard(QString svgString, QRectF & boardRect, cons image.save(FolderUtils::getTopLevelUserDataStorePath() + "/preclip_output.png"); #endif - if (clipImage != NULL) { + if (clipImage != nullptr) { // can this be done with a single blt using composition mode // if not, grab a scanline instead of testing every pixel for (int y = 0; y < theight; y++) { @@ -896,7 +896,7 @@ void GerberGenerator::exportPickAndPlace(const QString & prefix, const QString & QSet itemBases; foreach (QGraphicsItem * item, sketchWidget->scene()->collidingItems(board)) { ItemBase * itemBase = dynamic_cast(item); - if (itemBase == NULL) continue; + if (itemBase == nullptr) continue; if (itemBase == board) continue; if (itemBase->itemType() == ModelPart::Wire) continue; @@ -994,7 +994,7 @@ void GerberGenerator::handleDonuts(QDomElement & root1, QMultiHash & pathData, void * userData) { - PathCommand * currentCommand = NULL; + PathCommand * currentCommand = nullptr; QList args; foreach (QVariant variant, pathData) { if (variant.type() == QVariant::Char) { - PathCommand * newCommand = pathCommands.value(variant.toChar(), NULL); - if (newCommand == NULL) return false; + PathCommand * newCommand = pathCommands.value(variant.toChar(), nullptr); + if (newCommand == nullptr) return false; - if (currentCommand != NULL) { + if (currentCommand != nullptr) { if (currentCommand->argCount == 0) { if (args.count() != 0) return false; } @@ -56,12 +56,12 @@ bool SVGPathRunner::runPath(QVector & pathData, void * userData) { currentCommand = newCommand; } else if (variant.type() == QVariant::Double) { - if (currentCommand == NULL) return false; + if (currentCommand == nullptr) return false; args.append(variant.toDouble()); } } - if (currentCommand != NULL) { + if (currentCommand != nullptr) { if (currentCommand->argCount == 0) { if (args.count() != 0) return false; } diff --git a/src/viewlayer.cpp b/src/viewlayer.cpp index 8f9261d17..39727bc8b 100644 --- a/src/viewlayer.cpp +++ b/src/viewlayer.cpp @@ -90,10 +90,10 @@ ViewLayer::ViewLayer(ViewLayerID viewLayerID, bool visible, double initialZ) m_fromBelow = false; m_viewLayerID = viewLayerID; m_visible = visible; - m_action = NULL; + m_action = nullptr; m_initialZFromBelow = m_initialZ = initialZ; m_nextZ = 0; - m_parentLayer = NULL; + m_parentLayer = nullptr; m_active = true; m_includeChildLayers = true; } @@ -260,14 +260,14 @@ double ViewLayer::getZIncrement() { const QString & ViewLayer::viewLayerNameFromID(ViewLayerID viewLayerID) { NamePair * sp = names.value(viewLayerID); - if (sp == NULL) return ___emptyString___; + if (sp == nullptr) return ___emptyString___; return sp->displayName; } const QString & ViewLayer::viewLayerXmlNameFromID(ViewLayerID viewLayerID) { NamePair * sp = names.value(viewLayerID); - if (sp == NULL) return ___emptyString___; + if (sp == nullptr) return ___emptyString___; return sp->xmlName; } From 4c2fad143da59ae153f915cc3787ea6dea37ee19 Mon Sep 17 00:00:00 2001 From: Sublime Date: Thu, 14 Dec 2017 20:43:57 -0800 Subject: [PATCH 09/61] Start trace at center of connection point Allow traces to start in the center of rings and pads. Results in the ends of the traces overlapping hole in through hole parts. --- src/items/clipablewire.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/items/clipablewire.cpp b/src/items/clipablewire.cpp index 2e4c080d3..c5e496fdc 100644 --- a/src/items/clipablewire.cpp +++ b/src/items/clipablewire.cpp @@ -223,14 +223,14 @@ void ClipableWire::calcClip(QPointF & p1, QPointF & p2, ConnectorItem * c1, Conn //qDebug() << "clause 1" << p1 << p2 << c1->calcClipRadius() + (m_pen.width() / 2.0) << c2->calcClipRadius() + (m_pen.width() / 2.0); //c1->debugInfo(" c1"); //c2->debugInfo(" c2"); - GraphicsUtils::shortenLine(p1, p2, c1->calcClipRadius() + (m_pen.width() / 2.0), c2->calcClipRadius() + (m_pen.width() / 2.0)); + GraphicsUtils::shortenLine(p1, p2, c1->calcClipRadius(), c2->calcClipRadius()); return; } if (c1 != NULL && c1->isEffectivelyCircular()) { //qDebug() << "clause 2" << p1 << p2 << c1->calcClipRadius() + (m_pen.width() / 2.0) << 0; //c1->debugInfo(" c1"); - GraphicsUtils::shortenLine(p1, p2, c1->calcClipRadius() + (m_pen.width() / 2.0), 0); + GraphicsUtils::shortenLine(p1, p2, c1->calcClipRadius(), 0); p2 = findIntersection(c2, p2); return; } @@ -238,7 +238,7 @@ void ClipableWire::calcClip(QPointF & p1, QPointF & p2, ConnectorItem * c1, Conn if (c2 != NULL && c2->isEffectivelyCircular()) { //qDebug() << "clause 3" << p1 << p2 << 0 << c2->calcClipRadius() + (m_pen.width() / 2.0); //c2->debugInfo(" c2"); - GraphicsUtils::shortenLine(p1, p2, 0, c2->calcClipRadius() + (m_pen.width() / 2.0)); + GraphicsUtils::shortenLine(p1, p2, 0, c2->calcClipRadius()); p1 = findIntersection(c1, p1); return; } From 1d4a21cd214ea4c3daa25803197e7d22c2780ae3 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Sat, 9 Nov 2019 11:48:46 +0100 Subject: [PATCH 10/61] Fix warnings --- src/items/clipablewire.cpp | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/items/clipablewire.cpp b/src/items/clipablewire.cpp index c5e496fdc..9826e9d0e 100644 --- a/src/items/clipablewire.cpp +++ b/src/items/clipablewire.cpp @@ -52,10 +52,10 @@ int CrossingsTest( double pgon[][2], int numverts, double point[2] ) #ifdef WINDING register int crossings ; #endif - register int j, yflag0, yflag1, inside_flag, xflag0 ; - register double ty, tx, *vtx0, *vtx1 ; + int j, yflag0, yflag1, inside_flag, xflag0 ; + double ty, tx, *vtx0, *vtx1 ; #ifdef CONVEX - register int line_flag ; + int line_flag ; #endif tx = point[XCOORD] ; @@ -139,8 +139,8 @@ ClipableWire::ClipableWire( ModelPart * modelPart, ViewLayer::ViewID viewID, co : Wire(modelPart, viewID, viewGeometry, id, itemMenu, initLabel) { m_clipEnds = false; - m_trackHoverItem = NULL; - m_justFilteredEvent = NULL; + m_trackHoverItem = nullptr; + m_justFilteredEvent = nullptr; m_cachedOriginalLine.setPoints(QPointF(-99999,-99999), QPointF(-99999,-99999)); } @@ -157,7 +157,7 @@ const QLineF & ClipableWire::getPaintLine() { } int t0c = 0; - ConnectorItem* to0 = NULL; + ConnectorItem* to0 = nullptr; foreach (ConnectorItem * toConnectorItem, m_connector0->connectedToItems()) { if (toConnectorItem->attachedToItemType() != ModelPart::Wire) { to0 = toConnectorItem; @@ -167,7 +167,7 @@ const QLineF & ClipableWire::getPaintLine() { } int t1c = 0; - ConnectorItem* to1 = NULL; + ConnectorItem* to1 = nullptr; foreach (ConnectorItem * toConnectorItem, m_connector1->connectedToItems()) { if (toConnectorItem->attachedToItemType() != ModelPart::Wire) { to1 = toConnectorItem; @@ -176,9 +176,9 @@ const QLineF & ClipableWire::getPaintLine() { t1c++; } - if ((to0 == NULL && to1 == NULL) || // no need to clip an unconnected wire - (to0 == NULL && t0c == 0) || // dragging out a wire, no need to clip - (to1 == NULL && t1c == 0) || // dragging out a wire, no need to clip + if ((to0 == nullptr && to1 == nullptr) || // no need to clip an unconnected wire + (to0 == nullptr && t0c == 0) || // dragging out a wire, no need to clip + (to1 == nullptr && t1c == 0) || // dragging out a wire, no need to clip m_dragEnd) // dragging out a wire, no need to clip { return Wire::getPaintLine(); @@ -219,7 +219,7 @@ void ClipableWire::setClipEnds(bool clipEnds ) { void ClipableWire::calcClip(QPointF & p1, QPointF & p2, ConnectorItem * c1, ConnectorItem * c2) { - if (c1 != NULL && c2 != NULL && c1->isEffectivelyCircular() && c2->isEffectivelyCircular()) { + if (c1 != nullptr && c2 != nullptr && c1->isEffectivelyCircular() && c2->isEffectivelyCircular()) { //qDebug() << "clause 1" << p1 << p2 << c1->calcClipRadius() + (m_pen.width() / 2.0) << c2->calcClipRadius() + (m_pen.width() / 2.0); //c1->debugInfo(" c1"); //c2->debugInfo(" c2"); @@ -227,7 +227,7 @@ void ClipableWire::calcClip(QPointF & p1, QPointF & p2, ConnectorItem * c1, Conn return; } - if (c1 != NULL && c1->isEffectivelyCircular()) { + if (c1 != nullptr && c1->isEffectivelyCircular()) { //qDebug() << "clause 2" << p1 << p2 << c1->calcClipRadius() + (m_pen.width() / 2.0) << 0; //c1->debugInfo(" c1"); GraphicsUtils::shortenLine(p1, p2, c1->calcClipRadius(), 0); @@ -235,7 +235,7 @@ void ClipableWire::calcClip(QPointF & p1, QPointF & p2, ConnectorItem * c1, Conn return; } - if (c2 != NULL && c2->isEffectivelyCircular()) { + if (c2 != nullptr && c2->isEffectivelyCircular()) { //qDebug() << "clause 3" << p1 << p2 << 0 << c2->calcClipRadius() + (m_pen.width() / 2.0); //c2->debugInfo(" c2"); GraphicsUtils::shortenLine(p1, p2, 0, c2->calcClipRadius()); @@ -253,7 +253,7 @@ void ClipableWire::calcClip(QPointF & p1, QPointF & p2, ConnectorItem * c1, Conn QPointF ClipableWire::findIntersection(ConnectorItem * connectorItem, const QPointF & p) { - if (connectorItem == NULL) return p; + if (connectorItem == nullptr) return p; QRectF r = connectorItem->rect(); r.adjust(connectorRectClipInset, connectorRectClipInset, -connectorRectClipInset, -connectorRectClipInset); // inset it a little bit so the wire touches @@ -272,19 +272,19 @@ QPointF ClipableWire::findIntersection(ConnectorItem * connectorItem, const QPoi } bool ClipableWire::filterMousePressConnectorEvent(ConnectorItem * connectorItem, QGraphicsSceneMouseEvent * event) { - m_justFilteredEvent = NULL; + m_justFilteredEvent = nullptr; if (!m_clipEnds) return false; if (m_viewID != ViewLayer::PCBView) return false; - ConnectorItem * to = NULL; + ConnectorItem * to = nullptr; foreach (ConnectorItem * toConnectorItem, connectorItem->connectedToItems()) { if (toConnectorItem->attachedToItemType() != ModelPart::Wire) { to = toConnectorItem; break; } } - if (to == NULL) return false; + if (to == nullptr) return false; if (insideInnerCircle(to, event->scenePos()) || !insideSpoke(this, event->scenePos())) { m_justFilteredEvent = event; @@ -297,7 +297,7 @@ bool ClipableWire::filterMousePressConnectorEvent(ConnectorItem * connectorItem, void ClipableWire::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if ((long) event == (long) m_justFilteredEvent) { + if (event == m_justFilteredEvent) { event->ignore(); return; } @@ -311,7 +311,7 @@ void ClipableWire::hoverEnterConnectorItem(QGraphicsSceneHoverEvent * event, Con // track mouse move events for hover redirecting - ConnectorItem * to = NULL; + ConnectorItem * to = nullptr; foreach (ConnectorItem * toConnectorItem, item->connectedToItems()) { if (toConnectorItem->attachedToItemType() != ModelPart::Wire) { to = toConnectorItem; @@ -321,8 +321,8 @@ void ClipableWire::hoverEnterConnectorItem(QGraphicsSceneHoverEvent * event, Con if (to) { m_trackHoverItem = to; - m_trackHoverLastWireItem = NULL; - m_trackHoverLastItem = NULL; + m_trackHoverLastWireItem = nullptr; + m_trackHoverLastItem = nullptr; dispatchHover(event->scenePos()); } } @@ -330,8 +330,8 @@ void ClipableWire::hoverEnterConnectorItem(QGraphicsSceneHoverEvent * event, Con void ClipableWire::hoverLeaveConnectorItem(QGraphicsSceneHoverEvent * event, ConnectorItem * item) { Q_UNUSED(item); Q_UNUSED(event); - dispatchHoverAux(false, NULL); - m_trackHoverItem = NULL; + dispatchHoverAux(false, nullptr); + m_trackHoverItem = nullptr; //Wire::hoverLeaveConnectorItem(event, item); } @@ -345,7 +345,7 @@ void ClipableWire::hoverMoveConnectorItem(QGraphicsSceneHoverEvent * event, Conn void ClipableWire::dispatchHover(QPointF scenePos) { bool inInner = false; - ClipableWire * inWire = NULL; + ClipableWire * inWire = nullptr; if (insideInnerCircle(m_trackHoverItem, scenePos)) { //DebugDialog::debug("got inner circle"); inInner = true; @@ -355,7 +355,7 @@ void ClipableWire::dispatchHover(QPointF scenePos) { if (toConnectorItem->attachedToItemType() != ModelPart::Wire) continue; ClipableWire * w = dynamic_cast(toConnectorItem->attachedTo()); - if (w == NULL) continue; + if (w == nullptr) continue; if (w->getRatsnest()) continue; // is there a better way to check this? if (insideSpoke(w, scenePos)) { @@ -371,7 +371,7 @@ void ClipableWire::dispatchHover(QPointF scenePos) { void ClipableWire::dispatchHoverAux(bool inInner, Wire * inWire) { - if (m_trackHoverItem == NULL) return; + if (m_trackHoverItem == nullptr) return; if (inInner) { if (m_trackHoverLastItem == m_trackHoverItem) { @@ -380,7 +380,7 @@ void ClipableWire::dispatchHoverAux(bool inInner, Wire * inWire) } if (m_trackHoverLastWireItem) { ((ItemBase *) m_trackHoverLastWireItem)->hoverLeaveConnectorItem(); - m_trackHoverLastWireItem = NULL; + m_trackHoverLastWireItem = nullptr; } m_trackHoverLastItem = m_trackHoverItem; @@ -396,7 +396,7 @@ void ClipableWire::dispatchHoverAux(bool inInner, Wire * inWire) QList visited; m_trackHoverLastItem->restoreColor(visited); m_trackHoverLastItem->attachedTo()->hoverLeaveConnectorItem(); - m_trackHoverLastItem = NULL; + m_trackHoverLastItem = nullptr; } if (m_trackHoverLastWireItem) { ((ItemBase *) m_trackHoverLastWireItem)->hoverLeaveConnectorItem(); @@ -406,15 +406,15 @@ void ClipableWire::dispatchHoverAux(bool inInner, Wire * inWire) } else { //DebugDialog::debug("got none"); - if (m_trackHoverLastItem != NULL) { + if (m_trackHoverLastItem != nullptr) { QList visited; m_trackHoverLastItem->restoreColor(visited); m_trackHoverLastItem->attachedTo()->hoverLeaveConnectorItem(); - m_trackHoverLastItem = NULL; + m_trackHoverLastItem = nullptr; } - if (m_trackHoverLastWireItem != NULL) { + if (m_trackHoverLastWireItem != nullptr) { ((ItemBase *) m_trackHoverLastWireItem)->hoverLeaveConnectorItem(); - m_trackHoverLastWireItem = NULL; + m_trackHoverLastWireItem = nullptr; } } } From 97bb963b7da55f2a2dee4bff7740e2a15d68704c Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 20:50:43 -0800 Subject: [PATCH 11/61] Fix up searchlineedit Use a std::unique_ptr instead of raw pointer for SearchFieldPixmap. --- src/partsbinpalette/searchlineedit.cpp | 25 +++++++------------------ src/partsbinpalette/searchlineedit.h | 8 ++++---- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/partsbinpalette/searchlineedit.cpp b/src/partsbinpalette/searchlineedit.cpp index fc6295761..5d25f9416 100644 --- a/src/partsbinpalette/searchlineedit.cpp +++ b/src/partsbinpalette/searchlineedit.cpp @@ -24,25 +24,17 @@ along with Fritzing. If not, see . #include #include #include +#include +std::unique_ptr SearchFieldPixmap; -static QPixmap * SearchFieldPixmap; - -SearchLineEdit::SearchLineEdit(QWidget * parent) : QLineEdit(parent) +SearchLineEdit::SearchLineEdit(QWidget * parent) : QLineEdit(parent), m_decoy(true) { - SearchFieldPixmap = NULL; - setDecoy(true); + SearchFieldPixmap.reset(); } -SearchLineEdit::~SearchLineEdit() -{ -} void SearchLineEdit::cleanup() { - if (SearchFieldPixmap != NULL) { - delete SearchFieldPixmap; - SearchFieldPixmap = NULL; - } - + SearchFieldPixmap.reset(); } void SearchLineEdit::mousePressEvent(QMouseEvent * event) { @@ -52,8 +44,8 @@ void SearchLineEdit::mousePressEvent(QMouseEvent * event) { void SearchLineEdit::paintEvent(QPaintEvent * event) { QLineEdit::paintEvent(event); - if (SearchFieldPixmap == NULL) { - SearchFieldPixmap = new QPixmap(":/resources/images/icons/searchField.png"); + if (!SearchFieldPixmap) { + SearchFieldPixmap.reset(new QPixmap(":/resources/images/icons/searchField.png")); } if (SearchFieldPixmap == NULL) return; if (SearchFieldPixmap->isNull()) return; @@ -99,6 +91,3 @@ void SearchLineEdit::setDecoy(bool d) { setCursor(Qt::IBeamCursor); } -bool SearchLineEdit::decoy() { - return m_decoy; -} diff --git a/src/partsbinpalette/searchlineedit.h b/src/partsbinpalette/searchlineedit.h index bc650122a..e86b814f9 100644 --- a/src/partsbinpalette/searchlineedit.h +++ b/src/partsbinpalette/searchlineedit.h @@ -28,11 +28,11 @@ class SearchLineEdit : public QLineEdit { Q_OBJECT public: - SearchLineEdit(QWidget * parent = NULL); - ~SearchLineEdit(); + SearchLineEdit(QWidget * parent = nullptr); + ~SearchLineEdit() = default; - void setDecoy(bool); - bool decoy(); + void setDecoy(bool value) noexcept { m_decoy = value; } + constexpr bool decoy() noexcept { return m_decoy; } public: static void cleanup(); From 29192d73dc3bf567043b1eefdce2f239bf1daf40 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 20:55:08 -0800 Subject: [PATCH 12/61] More inplace initialization --- src/svg/x2svg.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/svg/x2svg.cpp b/src/svg/x2svg.cpp index c242888c6..7d920e8ea 100644 --- a/src/svg/x2svg.cpp +++ b/src/svg/x2svg.cpp @@ -32,13 +32,12 @@ along with Fritzing. If not, see . #include #include -static const int MAX_INT = std::numeric_limits::max(); -static const int MIN_INT = std::numeric_limits::min(); - -X2Svg::X2Svg() { - m_attribute = "%2\n"; - m_comment = "%2\n"; +constexpr auto MAX_INT = std::numeric_limits::max(); +constexpr auto MIN_INT = std::numeric_limits::min(); +X2Svg::X2Svg() : m_maxX(MIN_INT), m_maxY(MIN_INT), m_minX(MAX_INT), m_minY(MAX_INT), + m_attribute("%2\n"), + m_comment ("%2\n") { } void X2Svg::initLimits() { From f179c1aaa4bca89897289fce50871a0809ee10f5 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 21:03:27 -0800 Subject: [PATCH 13/61] Fix more sa violations found in C++test --- src/dialogs/setcolordialog.cpp | 25 +++++++++++-------------- src/dialogs/setcolordialog.h | 4 ++-- src/items/layerkinpaletteitem.cpp | 6 ++---- src/partsbinpalette/searchlineedit.h | 4 ++-- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/dialogs/setcolordialog.cpp b/src/dialogs/setcolordialog.cpp index d741e8627..7008dc4b3 100644 --- a/src/dialogs/setcolordialog.cpp +++ b/src/dialogs/setcolordialog.cpp @@ -36,13 +36,17 @@ static const int BUTTON_WIDTH = 150; ///////////////////////////////////// -SetColorDialog::SetColorDialog(const QString & message, QColor & currentColor, QColor & standardColor, bool askPrefs, QWidget *parent) : QDialog(parent) +SetColorDialog::SetColorDialog(const QString & message, QColor & currentColor, QColor & standardColor, bool askPrefs, QWidget *parent) : QDialog(parent), + m_message(message), + m_currentColor(currentColor), + m_standardColor(standardColor), + m_selectedColor(currentColor), + m_currentColorLabel(nullptr), + m_standardColorLabel(nullptr), + m_customColorLabel(nullptr), + m_selectedColorLabel(nullptr), + m_prefsCheckBox(nullptr) { - m_prefsCheckBox = NULL; - m_message = message; - m_currentColor = m_selectedColor = currentColor; - m_standardColor = standardColor; - this->setWindowTitle(tr("%1 Color...").arg(message)); QVBoxLayout * vLayout = new QVBoxLayout(this); @@ -103,13 +107,6 @@ SetColorDialog::SetColorDialog(const QString & message, QColor & currentColor, Q this->setLayout(vLayout); } -SetColorDialog::~SetColorDialog() { -} - -const QColor & SetColorDialog::selectedColor() { - return m_selectedColor; -} - void SetColorDialog::selectCurrent() { setColor(m_currentColor); } @@ -131,7 +128,7 @@ void SetColorDialog::selectCustom() { } bool SetColorDialog::isPrefsColor() { - if (m_prefsCheckBox == NULL) return false; + if (!m_prefsCheckBox) return false; return m_prefsCheckBox->isChecked(); } diff --git a/src/dialogs/setcolordialog.h b/src/dialogs/setcolordialog.h index 12ca8a420..cffbdde5f 100644 --- a/src/dialogs/setcolordialog.h +++ b/src/dialogs/setcolordialog.h @@ -33,9 +33,9 @@ class SetColorDialog : public QDialog public: SetColorDialog(const QString & message, QColor & currentColor, QColor & standardColor, bool askPrefs, QWidget *parent = 0); - ~SetColorDialog(); + ~SetColorDialog() = default; - const QColor & selectedColor(); + const QColor & selectedColor() const noexcept { return m_selectedColor; } bool isPrefsColor(); protected: diff --git a/src/items/layerkinpaletteitem.cpp b/src/items/layerkinpaletteitem.cpp index 9a23df8c9..97732f88f 100644 --- a/src/items/layerkinpaletteitem.cpp +++ b/src/items/layerkinpaletteitem.cpp @@ -36,11 +36,9 @@ static QString IDString("-_-_-text-_-_-%1"); //////////////////////////////////////////////// LayerKinPaletteItem::LayerKinPaletteItem(PaletteItemBase * chief, ModelPart * modelPart, ViewLayer::ViewID viewID, const ViewGeometry & viewGeometry, long id, QMenu* itemMenu) - : PaletteItemBase(modelPart, viewID, viewGeometry, id, itemMenu) - + : PaletteItemBase(modelPart, viewID, viewGeometry, id, itemMenu), + m_layerKinChief(chief), m_ok(false), m_passMouseEvents(false) { - m_passMouseEvents = false; - m_layerKinChief = chief; setFlag(QGraphicsItem::ItemIsSelectable, true); m_modelPart->removeViewItem(this); // we don't need to save layerkin } diff --git a/src/partsbinpalette/searchlineedit.h b/src/partsbinpalette/searchlineedit.h index e86b814f9..ab1ec4cba 100644 --- a/src/partsbinpalette/searchlineedit.h +++ b/src/partsbinpalette/searchlineedit.h @@ -31,8 +31,8 @@ class SearchLineEdit : public QLineEdit { SearchLineEdit(QWidget * parent = nullptr); ~SearchLineEdit() = default; - void setDecoy(bool value) noexcept { m_decoy = value; } - constexpr bool decoy() noexcept { return m_decoy; } + void setDecoy(bool value); + constexpr bool decoy() const noexcept { return m_decoy; } public: static void cleanup(); From 6fbe304f8f2779956bbd1b5ccce862a7b4dfa6ef Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 21:08:41 -0800 Subject: [PATCH 14/61] More structure initialization --- src/utils/fileprogressdialog.cpp | 9 ++++----- src/utils/fileprogressdialog.h | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/utils/fileprogressdialog.cpp b/src/utils/fileprogressdialog.cpp index 33cf69814..072696f09 100644 --- a/src/utils/fileprogressdialog.cpp +++ b/src/utils/fileprogressdialog.cpp @@ -37,11 +37,10 @@ along with Fritzing. If not, see . ///////////////////////////////////// -FileProgressDialog::FileProgressDialog(const QString & title, int initialMaximum, QWidget * parent) : QDialog(parent) +FileProgressDialog::FileProgressDialog(const QString & title, int initialMaximum, QWidget * parent) : QDialog(parent), + m_incValueMod(2) { - m_incValueMod = 2; - - QSplashScreen *splash = NULL; + QSplashScreen *splash = nullptr; foreach (QWidget *widget, QApplication::topLevelWidgets()) { splash = qobject_cast(widget); if (splash) { @@ -50,7 +49,7 @@ FileProgressDialog::FileProgressDialog(const QString & title, int initialMaximum } init(title, initialMaximum); - setModal(splash == NULL); // OS X Lion doesn't seem to like modal dialogs during splash time + setModal(splash == nullptr); // OS X Lion doesn't seem to like modal dialogs during splash time show(); if (splash) { diff --git a/src/utils/fileprogressdialog.h b/src/utils/fileprogressdialog.h index 20ce914a8..dcf5b2ac4 100644 --- a/src/utils/fileprogressdialog.h +++ b/src/utils/fileprogressdialog.h @@ -33,7 +33,7 @@ class FileProgressDialog : public QDialog Q_OBJECT public: - FileProgressDialog(QWidget *parent = 0); + FileProgressDialog(QWidget *parent = nullptr); FileProgressDialog(const QString & title, int initialMaximum, QWidget *parent); ~FileProgressDialog(); @@ -71,16 +71,16 @@ protected slots: void init(const QString & title, int initialMaximum); protected: - QProgressBar * m_progressBar; - QLabel * m_message; - - int m_binLoadingCount; - int m_binLoadingIndex; - int m_binLoadingStart; - int m_binLoadingChunk; - int m_incValueMod; - double m_binLoadingInc; - double m_binLoadingValue; + QProgressBar * m_progressBar = nullptr; + QLabel * m_message = nullptr; + + int m_binLoadingCount = 0; + int m_binLoadingIndex = 0; + int m_binLoadingStart = 0; + int m_binLoadingChunk = 0; + int m_incValueMod = 0; + double m_binLoadingInc = 0.0; + double m_binLoadingValue = 0.0; QTimer m_timer; }; From 42d6b290313cbcade9874106efa9bc9b099fafc0 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 21:16:25 -0800 Subject: [PATCH 15/61] More C++test violation fixes --- src/autoroute/autorouter.cpp | 99 +++++++++++++++++------------------- src/autoroute/autorouter.h | 42 ++++++++------- 2 files changed, 70 insertions(+), 71 deletions(-) diff --git a/src/autoroute/autorouter.cpp b/src/autoroute/autorouter.cpp index 572aaa0d2..c647e9975 100644 --- a/src/autoroute/autorouter.cpp +++ b/src/autoroute/autorouter.cpp @@ -38,13 +38,7 @@ along with Fritzing. If not, see . const QString Autorouter::MaxCyclesName("cmrouter/maxcycles"); -Autorouter::Autorouter(PCBSketchWidget * sketchWidget) -{ - m_sketchWidget = sketchWidget; - m_useBest = m_stopTracing = m_cancelTrace = m_cancelled = false; -} - -Autorouter::~Autorouter(void) +Autorouter::Autorouter(PCBSketchWidget * sketchWidget) : m_sketchWidget(sketchWidget) { } @@ -70,7 +64,7 @@ TraceWire * Autorouter::drawOneTrace(QPointF fromPos, QPointF toPos, double widt } #endif - long newID = ItemBase::getNextID(); + auto newID = ItemBase::getNextID(); ViewGeometry viewGeometry; viewGeometry.setWireFlags(m_sketchWidget->getTraceFlag()); viewGeometry.setAutoroutable(true); @@ -78,20 +72,20 @@ TraceWire * Autorouter::drawOneTrace(QPointF fromPos, QPointF toPos, double widt QLineF line(0, 0, toPos.x() - fromPos.x(), toPos.y() - fromPos.y()); viewGeometry.setLine(line); - ItemBase * trace = m_sketchWidget->addItem(m_sketchWidget->referenceModel()->retrieveModelPart(ModuleIDNames::WireModuleIDName), + auto trace = m_sketchWidget->addItem(m_sketchWidget->referenceModel()->retrieveModelPart(ModuleIDNames::WireModuleIDName), viewLayerPlacement, BaseCommand::SingleView, viewGeometry, newID, -1, NULL); - if (trace == NULL) { + if (!trace) { // we're in trouble DebugDialog::debug("autorouter unable to draw one trace"); - return NULL; + return nullptr; } // addItem calls trace->setSelected(true) so unselect it (TODO: this may no longer be necessary) trace->setSelected(false); - TraceWire * traceWire = dynamic_cast(trace); - if (traceWire == NULL) { + auto traceWire = dynamic_cast(trace); + if (!traceWire) { DebugDialog::debug("autorouter unable to draw one trace as trace"); - return NULL; + return nullptr; } @@ -128,8 +122,8 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) if (m_pcbType) { collidingItems = m_sketchWidget->scene()->collidingItems(m_board); foreach (QGraphicsItem * item, collidingItems) { - JumperItem * jumperItem = dynamic_cast(item); - if (jumperItem == NULL) continue; + auto jumperItem = dynamic_cast(item); + if (!jumperItem) continue; if (jumperItem->getAutoroutable()) { addUndoConnection(false, jumperItem, parentCommand); @@ -142,8 +136,8 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) foreach (ConnectorItem * ci, jumperItem->connector0()->connectedToItems()) both.append(ci); foreach (ConnectorItem * ci, jumperItem->connector1()->connectedToItems()) both.append(ci); foreach (ConnectorItem * connectorItem, both) { - TraceWire * w = qobject_cast(connectorItem->attachedTo()); - if (w == NULL) continue; + auto w = qobject_cast(connectorItem->attachedTo()); + if (!w) continue; if (!w->isTraceType(m_sketchWidget->getTraceFlag())) continue; QList wires; @@ -156,8 +150,8 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) } } foreach (QGraphicsItem * item, collidingItems) { - Via * via = dynamic_cast(item); - if (via == NULL) continue; + auto via = dynamic_cast(item); + if (!via) continue; if (via->getAutoroutable()) { addUndoConnection(false, via, parentCommand); @@ -170,8 +164,8 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) foreach (ConnectorItem * ci, via->connectorItem()->connectedToItems()) both.append(ci); foreach (ConnectorItem * ci, via->connectorItem()->getCrossLayerConnectorItem()->connectedToItems()) both.append(ci); foreach (ConnectorItem * connectorItem, both) { - TraceWire * w = qobject_cast(connectorItem->attachedTo()); - if (w == NULL) continue; + auto w = qobject_cast(connectorItem->attachedTo()); + if (!w) continue; if (!w->isTraceType(m_sketchWidget->getTraceFlag())) continue; QList wires; @@ -187,7 +181,7 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) else { collidingItems = m_sketchWidget->scene()->items(); foreach (QGraphicsItem * item, collidingItems) { - SymbolPaletteItem * netLabel = dynamic_cast(item); + auto netLabel = dynamic_cast(item); if (netLabel == NULL) continue; if (!netLabel->isOnlyNetLabel()) continue; @@ -199,8 +193,8 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) // deal with the traces connecting the netlabel to the part foreach (ConnectorItem * connectorItem, netLabel->connector0()->connectedToItems()) { - TraceWire * w = qobject_cast(connectorItem->attachedTo()); - if (w == NULL) continue; + auto w = qobject_cast(connectorItem->attachedTo()); + if (!w) continue; if (!w->isTraceType(m_sketchWidget->getTraceFlag())) continue; QList wires; @@ -216,8 +210,8 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) QList visited; foreach (QGraphicsItem * item, collidingItems) { - TraceWire * traceWire = dynamic_cast(item); - if (traceWire == NULL) continue; + auto traceWire = dynamic_cast(item); + if (!traceWire) continue; if (!traceWire->isTraceType(m_sketchWidget->getTraceFlag())) continue; if (traceWire->getAutoroutable()) continue; if (visited.contains(traceWire)) continue; @@ -234,8 +228,8 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) } foreach (QGraphicsItem * item, collidingItems) { - TraceWire * traceWire = dynamic_cast(item); - if (traceWire == NULL) continue; + auto traceWire = dynamic_cast(item); + if (!traceWire) continue; if (!traceWire->isTraceType(m_sketchWidget->getTraceFlag())) continue; if (!traceWire->getAutoroutable()) continue; @@ -274,14 +268,14 @@ void Autorouter::addUndoConnection(bool connect, TraceWire * traceWire, QUndoCom void Autorouter::addUndoConnection(bool connect, ConnectorItem * connectorItem, BaseCommand::CrossViewType crossView, QUndoCommand * parentCommand) { foreach (ConnectorItem * toConnectorItem, connectorItem->connectedToItems()) { - VirtualWire * vw = qobject_cast(toConnectorItem->attachedTo()); - if (vw != NULL) continue; - - ChangeConnectionCommand * ccc = new ChangeConnectionCommand(m_sketchWidget, crossView, - toConnectorItem->attachedToID(), toConnectorItem->connectorSharedID(), - connectorItem->attachedToID(), connectorItem->connectorSharedID(), - ViewLayer::specFromID(toConnectorItem->attachedToViewLayerID()), - connect, parentCommand); + auto vw = qobject_cast(toConnectorItem->attachedTo()); + if (vw) continue; + + auto ccc = new ChangeConnectionCommand(m_sketchWidget, crossView, + toConnectorItem->attachedToID(), toConnectorItem->connectorSharedID(), + connectorItem->attachedToID(), connectorItem->connectorSharedID(), + ViewLayer::specFromID(toConnectorItem->attachedToViewLayerID()), + connect, parentCommand); ccc->setUpdateConnections(false); } } @@ -297,14 +291,14 @@ void Autorouter::clearTracesAndJumpers() { foreach (QGraphicsItem * item, (m_board == NULL) ? m_sketchWidget->scene()->items() : m_sketchWidget->scene()->collidingItems(m_board)) { if (m_pcbType) { - JumperItem * jumperItem = dynamic_cast(item); + auto jumperItem = dynamic_cast(item); if (jumperItem != NULL) { if (jumperItem->getAutoroutable()) { toDelete.append(jumperItem); } continue; } - Via * via = dynamic_cast(item); + auto via = dynamic_cast(item); if (via != NULL) { if (via->getAutoroutable()) { toDelete.append(via); @@ -313,7 +307,7 @@ void Autorouter::clearTracesAndJumpers() { } } else { - SymbolPaletteItem * netLabel = dynamic_cast(item); + auto netLabel = dynamic_cast(item); if (netLabel != NULL && netLabel->isOnlyNetLabel()) { if (netLabel->getAutoroutable()) { toDelete.append(netLabel); @@ -322,7 +316,7 @@ void Autorouter::clearTracesAndJumpers() { } } - TraceWire * traceWire = dynamic_cast(item); + auto traceWire = dynamic_cast(item); if (traceWire != NULL) { if (traceWire->isTraceType(m_sketchWidget->getTraceFlag()) && traceWire->getAutoroutable()) { toDelete.append(traceWire); @@ -350,8 +344,8 @@ void Autorouter::addToUndo(QUndoCommand * parentCommand) QList vias; QList netLabels; foreach (QGraphicsItem * item, (m_board == NULL) ? m_sketchWidget->scene()->items() : m_sketchWidget->scene()->collidingItems(m_board)) { - TraceWire * wire = dynamic_cast(item); - if (wire != NULL) { + auto wire = dynamic_cast(item); + if (wire) { if (!wire->getAutoroutable()) continue; if (!wire->isTraceType(m_sketchWidget->getTraceFlag())) continue; @@ -362,8 +356,8 @@ void Autorouter::addToUndo(QUndoCommand * parentCommand) continue; } if (m_pcbType) { - JumperItem * jumperItem = dynamic_cast(item); - if (jumperItem != NULL) { + auto jumperItem = dynamic_cast(item); + if (jumperItem) { jumperItems.append(jumperItem); if (!jumperItem->getAutoroutable()) { continue; @@ -372,15 +366,16 @@ void Autorouter::addToUndo(QUndoCommand * parentCommand) jumperItem->saveParams(); QPointF pos, c0, c1; jumperItem->getParams(pos, c0, c1); - + /// @todo this can cause leaks if the constructors of these + /// commands change. new AddItemCommand(m_sketchWidget, BaseCommand::CrossView, ModuleIDNames::JumperModuleIDName, jumperItem->viewLayerPlacement(), jumperItem->getViewGeometry(), jumperItem->id(), false, -1, parentCommand); new ResizeJumperItemCommand(m_sketchWidget, jumperItem->id(), pos, c0, c1, pos, c0, c1, parentCommand); new CheckStickyCommand(m_sketchWidget, BaseCommand::SingleView, jumperItem->id(), false, CheckStickyCommand::RemoveOnly, parentCommand); continue; } - Via * via = dynamic_cast(item); - if (via != NULL) { + auto via = dynamic_cast(item); + if (via) { vias.append(via); if (!via->getAutoroutable()) { continue; @@ -394,8 +389,8 @@ void Autorouter::addToUndo(QUndoCommand * parentCommand) } } else { - SymbolPaletteItem * netLabel = dynamic_cast(item); - if (netLabel != NULL && netLabel->isOnlyNetLabel()) { + auto netLabel = dynamic_cast(item); + if (netLabel && netLabel->isOnlyNetLabel()) { netLabels.append(netLabel); if (!netLabel->getAutoroutable()) { continue; @@ -427,8 +422,8 @@ void Autorouter::addToUndo(QUndoCommand * parentCommand) void Autorouter::addWireToUndo(Wire * wire, QUndoCommand * parentCommand) { - if (wire == NULL) return; - + if (!wire) return; + /// @todo this can cause leaks if the ctor of the commands change new AddItemCommand(m_sketchWidget, BaseCommand::CrossView, ModuleIDNames::WireModuleIDName, wire->viewLayerPlacement(), wire->getViewGeometry(), wire->id(), false, -1, parentCommand); new CheckStickyCommand(m_sketchWidget, BaseCommand::SingleView, wire->id(), false, CheckStickyCommand::RemoveOnly, parentCommand); diff --git a/src/autoroute/autorouter.h b/src/autoroute/autorouter.h index b10d94909..e3bd3a1d6 100644 --- a/src/autoroute/autorouter.h +++ b/src/autoroute/autorouter.h @@ -36,15 +36,19 @@ along with Fritzing. If not, see . #include "../connectors/connectoritem.h" #include "../commands.h" +class PCBSketchWidget; +class SymbolPaletteItem; +class JumperItem; +class Via; class Autorouter : public QObject { Q_OBJECT public: - Autorouter(class PCBSketchWidget *); - virtual ~Autorouter(void); + Autorouter(PCBSketchWidget *); + virtual ~Autorouter() = default; - virtual void start()=0; + virtual void start() = 0; public: static const QString MaxCyclesName; @@ -55,9 +59,9 @@ class Autorouter : public QObject virtual void updateRoutingStatus(); virtual class TraceWire * drawOneTrace(QPointF fromPos, QPointF toPos, double width, ViewLayer::ViewLayerPlacement); void initUndo(QUndoCommand * parentCommand); - void addUndoConnection(bool connect, class SymbolPaletteItem *, QUndoCommand * parentCommand); - void addUndoConnection(bool connect, class JumperItem *, QUndoCommand * parentCommand); - void addUndoConnection(bool connect, class Via *, QUndoCommand * parentCommand); + void addUndoConnection(bool connect, SymbolPaletteItem *, QUndoCommand * parentCommand); + void addUndoConnection(bool connect, JumperItem *, QUndoCommand * parentCommand); + void addUndoConnection(bool connect, Via *, QUndoCommand * parentCommand); void addUndoConnection(bool connect, TraceWire *, QUndoCommand * parentCommand); void addUndoConnection(bool connect, ConnectorItem *, BaseCommand::CrossViewType, QUndoCommand * parentCommand); void restoreOriginalState(QUndoCommand * parentCommand); @@ -86,20 +90,20 @@ public slots: void disableButtons(); protected: - class PCBSketchWidget * m_sketchWidget; - QList< QList* > m_allPartConnectorItems; - bool m_cancelled; - bool m_cancelTrace; - bool m_stopTracing; - bool m_useBest; - bool m_bothSidesNow; - int m_maximumProgressPart; - int m_currentProgressPart; - QGraphicsItem * m_board; - int m_maxCycles; - double m_keepoutPixels; + PCBSketchWidget * m_sketchWidget = nullptr; + QList< QList* > m_allPartConnectorItems; + bool m_cancelled = false; + bool m_cancelTrace = false; + bool m_stopTracing = false; + bool m_useBest = false; + bool m_bothSidesNow = false; + int m_maximumProgressPart = 0; + int m_currentProgressPart = 0; + QGraphicsItem * m_board = nullptr; + int m_maxCycles = 0; + double m_keepoutPixels = 0.0; QRectF m_maxRect; - bool m_pcbType; + bool m_pcbType = false; }; #endif From 700bf8bf669a1ffa2f3e186c183ab4e087296327 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 21:32:05 -0800 Subject: [PATCH 16/61] Added sev 1 violation fixes for ctors + other fixes --- src/autoroute/mazerouter/mazerouter.cpp | 205 +++++++++++++----------- src/autoroute/mazerouter/mazerouter.h | 8 +- 2 files changed, 114 insertions(+), 99 deletions(-) diff --git a/src/autoroute/mazerouter/mazerouter.cpp b/src/autoroute/mazerouter/mazerouter.cpp index 113cc6d33..06484e0ac 100644 --- a/src/autoroute/mazerouter/mazerouter.cpp +++ b/src/autoroute/mazerouter/mazerouter.cpp @@ -488,7 +488,7 @@ QList ConnectionThing::values(ConnectorItem * s) { //} QList result; foreach (ConnectorItem * d, sd.values(s)) { - if (d == NULL) continue; + if (d == nullptr) continue; if (sd.values(d).count() == 0) continue; result << d; //if (hasID(s)) d->debugInfo("\t"); @@ -498,12 +498,24 @@ QList ConnectionThing::values(ConnectorItem * s) { //////////////////////////////////////////////////////////////////// -MazeRouter::MazeRouter(PCBSketchWidget * sketchWidget, QGraphicsItem * board, bool adjustIf) : Autorouter(sketchWidget) +MazeRouter::MazeRouter(PCBSketchWidget * sketchWidget, QGraphicsItem * board, bool adjustIf) : + Autorouter(sketchWidget), + m_keepoutMils(0.0), + m_keepoutGrid(0.0), + m_keepoutGridInt(0), + m_halfGridViaSize(0), + m_halfGridJumperSize(0), + m_gridPixels(0.0), + m_standardWireWidth(0.0), + m_boardImage(nullptr), + m_spareImage(nullptr), + m_spareImage2(nullptr), + m_temporaryBoard(false), + m_grid(nullptr), + m_cleanupCount(0), + m_netLabelIndex(-1), + m_commandCount(0) { - m_netLabelIndex = -1; - m_grid = NULL; - m_displayItem[0] = m_displayItem[1] = NULL; - m_boardImage = m_spareImage = m_spareImage2 = m_displayImage[0] = m_displayImage[1] = NULL; CancelledMessage = tr("Autorouter was cancelled."); @@ -513,7 +525,6 @@ MazeRouter::MazeRouter(PCBSketchWidget * sketchWidget, QGraphicsItem * board, bo m_bothSidesNow = sketchWidget->routeBothSides(); m_pcbType = sketchWidget->autorouteTypePCB(); m_board = board; - m_temporaryBoard = false; if (m_board) { m_maxRect = m_board->sceneBoundingRect(); @@ -561,6 +572,8 @@ MazeRouter::MazeRouter(PCBSketchWidget * sketchWidget, QGraphicsItem * board, bo MazeRouter::~MazeRouter() { + /// @todo replace explicit deletes with std::shared_ptr and std::unique_ptr + /// where it makes sense. foreach (QDomDocument * doc, m_masterDocs) { delete doc; } @@ -576,7 +589,7 @@ MazeRouter::~MazeRouter() if (m_displayImage[1]) { delete m_displayImage[1]; } - if (m_temporaryBoard && m_board != NULL) { + if (m_temporaryBoard && m_board != nullptr) { delete m_board; } if (m_grid) { @@ -596,8 +609,8 @@ MazeRouter::~MazeRouter() void MazeRouter::start() { if (m_pcbType) { - if (m_board == NULL) { - QMessageBox::warning(NULL, QObject::tr("Fritzing"), QObject::tr("Cannot autoroute: no board (or multiple boards) found")); + if (!m_board) { + QMessageBox::warning(nullptr, QObject::tr("Fritzing"), QObject::tr("Cannot autoroute: no board (or multiple boards) found")); return; } m_jumperWillFitFunction = jumperWillFit; @@ -619,11 +632,11 @@ void MazeRouter::start() double ringThickness, holeSize; m_sketchWidget->getViaSize(ringThickness, holeSize); - int gridViaSize = qCeil((ringThickness + ringThickness + holeSize + m_keepoutPixels + m_keepoutPixels) / m_gridPixels); + auto gridViaSize = qCeil((ringThickness + ringThickness + holeSize + m_keepoutPixels + m_keepoutPixels) / m_gridPixels); m_halfGridViaSize = gridViaSize / 2; QSizeF jumperSize = m_sketchWidget->jumperItemSize(); - int gridJumperSize = qCeil((qMax(jumperSize.width(), jumperSize.height()) + m_keepoutPixels + m_keepoutPixels) / m_gridPixels); + auto gridJumperSize = qCeil((qMax(jumperSize.width(), jumperSize.height()) + m_keepoutPixels + m_keepoutPixels) / m_gridPixels); m_halfGridJumperSize = gridJumperSize / 2; emit setMaximumProgress(m_maxCycles); @@ -640,21 +653,22 @@ void MazeRouter::start() if (m_allPartConnectorItems.count() == 0) { QString message = m_pcbType ? QObject::tr("No connections (on the PCB) to route.") : QObject::tr("No connections to route."); - QMessageBox::information(NULL, QObject::tr("Fritzing"), message); + QMessageBox::information(nullptr, QObject::tr("Fritzing"), message); Autorouter::cleanUpNets(); return; } - QUndoCommand * parentCommand = new QUndoCommand("Autoroute"); + auto parentCommand = new QUndoCommand("Autoroute"); + /// @todo can have leaks if ctors of these commands changes new CleanUpWiresCommand(m_sketchWidget, CleanUpWiresCommand::UndoOnly, parentCommand); new CleanUpRatsnestsCommand(m_sketchWidget, CleanUpWiresCommand::UndoOnly, parentCommand); initUndo(parentCommand); NetList netList; - int totalToRoute = 0; - for (int i = 0; i < m_allPartConnectorItems.count(); i++) { - Net * net = new Net; + auto totalToRoute = 0; + for (auto i = 0; i < m_allPartConnectorItems.count(); i++) { + auto net = new Net; net->net = m_allPartConnectorItems[i]; //foreach (ConnectorItem * connectorItem, *(net->net)) { @@ -664,7 +678,7 @@ void MazeRouter::start() QList todo; todo.append(*(net->net)); while (todo.count() > 0) { - ConnectorItem * first = todo.takeFirst(); + auto first = todo.takeFirst(); QList equi; equi.append(first); ConnectorItem::collectEqualPotential(equi, m_bothSidesNow, (ViewGeometry::RatsnestFlag | ViewGeometry::NormalFlag | ViewGeometry::PCBTraceFlag | ViewGeometry::SchematicTraceFlag) ^ m_sketchWidget->getTraceFlag()); @@ -687,7 +701,7 @@ void MazeRouter::start() qSort(netList.nets.begin(), netList.nets.end(), byPinsWithin); NetOrdering initialOrdering; - int ix = 0; + auto ix = 0; foreach (Net * net, netList.nets) { // id is the same as the order in netList initialOrdering.order << ix; @@ -708,8 +722,8 @@ void MazeRouter::start() QSizeF gridSize(m_maxRect.width() / m_gridPixels, m_maxRect.height() / m_gridPixels); QSize boardImageSize(qCeil(gridSize.width()), qCeil(gridSize.height())); m_grid = new Grid(boardImageSize.width(), boardImageSize.height(), m_bothSidesNow ? 2 : 1); - if (m_grid->data == NULL) { - QMessageBox::information(NULL, QObject::tr("Fritzing"), "Out of memory--unable to proceed"); + if (!m_grid->data) { + QMessageBox::information(nullptr, QObject::tr("Fritzing"), "Out of memory--unable to proceed"); restoreOriginalState(parentCommand); cleanUpNets(netList); return; @@ -733,14 +747,14 @@ void MazeRouter::start() cleanUpNets(netList); return; } - + /// @todo perfect candidate for std::unique_ptr m_displayImage[0] = new QImage(boardImageSize, QImage::Format_ARGB32); m_displayImage[0]->fill(0); m_displayImage[1] = new QImage(boardImageSize, QImage::Format_ARGB32); m_displayImage[1]->fill(0); QString message; - bool gotMasters = makeMasters(message); + auto gotMasters = makeMasters(message); if (m_cancelled || m_stopTracing || !gotMasters) { restoreOriginalState(parentCommand); cleanUpNets(netList); @@ -751,7 +765,7 @@ void MazeRouter::start() allOrderings << initialOrdering; Score bestScore; Score currentScore; - int run = 0; + auto run = 0; for (; run < m_maxCycles && run < allOrderings.count(); run++) { QString msg= tr("best so far: %1 of %2 routed").arg(bestScore.totalRoutedCount).arg(totalToRoute); if (m_pcbType) { @@ -817,15 +831,15 @@ void MazeRouter::start() if (m_grid) { delete m_grid; - m_grid = NULL; + m_grid = nullptr; } if (m_boardImage) { delete m_boardImage; - m_boardImage = NULL; + m_boardImage = nullptr; } if (m_spareImage) { delete m_spareImage; - m_spareImage = NULL; + m_spareImage = nullptr; } m_boardImage = new QImage(m_maxRect.width() * OptimizeFactor, m_maxRect.height() * OptimizeFactor, QImage::Format_Mono); @@ -845,6 +859,7 @@ void MazeRouter::start() createTraces(netList, bestScore, parentCommand); cleanUpNets(netList); + /// @todo leaks can occur if not careful new CleanUpRatsnestsCommand(m_sketchWidget, CleanUpWiresCommand::RedoOnly, parentCommand); new CleanUpWiresCommand(m_sketchWidget, CleanUpWiresCommand::RedoOnly, parentCommand); @@ -868,15 +883,15 @@ void MazeRouter::start() } int MazeRouter::findPinsWithin(QList * net) { - int count = 0; + auto count = 0; QRectF r; foreach (ConnectorItem * connectorItem, *net) { r |= connectorItem->sceneBoundingRect(); } foreach (QGraphicsItem * item, m_sketchWidget->scene()->items(r)) { - ConnectorItem * connectorItem = dynamic_cast(item); - if (connectorItem == NULL) continue; + auto connectorItem = dynamic_cast(item); + if (!connectorItem) continue; if (net->contains(connectorItem)) continue; @@ -937,13 +952,13 @@ bool MazeRouter::makeMasters(QString & message) { if (m_bothSidesNow) layerSpecs << ViewLayer::NewTop; foreach (ViewLayer::ViewLayerPlacement viewLayerPlacement, layerSpecs) { - LayerList viewLayerIDs = m_sketchWidget->routingLayers(viewLayerPlacement); + auto viewLayerIDs = m_sketchWidget->routingLayers(viewLayerPlacement); RenderThing renderThing; renderThing.printerScale = GraphicsUtils::SVGDPI; renderThing.blackOnly = true; renderThing.dpi = GraphicsUtils::StandardFritzingDPI; renderThing.hideTerminalPoints = renderThing.selectedItems = renderThing.renderBlocker = false; - QString master = m_sketchWidget->renderToSVG(renderThing, m_board, viewLayerIDs); + auto master = m_sketchWidget->renderToSVG(renderThing, m_board, viewLayerIDs); if (master.isEmpty()) { continue; } @@ -952,8 +967,8 @@ bool MazeRouter::makeMasters(QString & message) { m_masterDocs.insert(viewLayerPlacement, masterDoc); QString errorStr; - int errorLine; - int errorColumn; + int errorLine = 0; + int errorColumn = 0; if (!masterDoc->setContent(master, &errorStr, &errorLine, &errorColumn)) { message = tr("Unexpected SVG rendering failure--contact fritzing.org"); return false; @@ -984,16 +999,16 @@ bool MazeRouter::routeNets(NetList & netList, bool makeJumper, Score & currentSc routeThing.layerSpecs << ViewLayer::NewBottom; if (m_bothSidesNow) routeThing.layerSpecs << ViewLayer::NewTop; - bool result = true; + auto result = true; initTraceDisplay(); - bool previousTraces = false; + auto previousTraces = false; foreach (int netIndex, currentScore.ordering.order) { if (m_cancelled || m_stopTracing) { return false; } - Net * net = netList.nets.at(netIndex); + auto net = netList.nets.at(netIndex); /* DebugDialog::debug(QString("routing net %1, subnets %2, traces %3, routed %4") .arg(netIndex) @@ -1044,9 +1059,9 @@ bool MazeRouter::routeNets(NetList & netList, bool makeJumper, Score & currentSc //DebugDialog::debug("find nearest pair"); findNearestPair(subnets, routeThing.nearest); - QPointF ip = routeThing.nearest.ic->sceneAdjustedTerminalPoint(NULL) - m_maxRect.topLeft(); + auto ip = routeThing.nearest.ic->sceneAdjustedTerminalPoint(nullptr) - m_maxRect.topLeft(); routeThing.gridSourcePoint = QPoint(ip.x() / m_gridPixels, ip.y() / m_gridPixels); - QPointF jp = routeThing.nearest.jc->sceneAdjustedTerminalPoint(NULL) - m_maxRect.topLeft(); + auto jp = routeThing.nearest.jc->sceneAdjustedTerminalPoint(nullptr) - m_maxRect.topLeft(); routeThing.gridTargetPoint = QPoint(jp.x() / m_gridPixels, jp.y() / m_gridPixels); m_grid->clear(); @@ -1132,7 +1147,7 @@ bool MazeRouter::routeNets(NetList & netList, bool makeJumper, Score & currentSc routeThing.sourceQ = std::priority_queue(); routeThing.targetQ = std::priority_queue(); - if (result == false) break; + if (!result) break; } return result; @@ -1142,7 +1157,7 @@ bool MazeRouter::routeOne(bool makeJumper, Score & currentScore, int netIndex, R //DebugDialog::debug("start route()"); Trace newTrace; - int viaCount; + auto viaCount = 0; routeThing.bestDistanceToSource = routeThing.bestDistanceToTarget = std::numeric_limits::max(); //DebugDialog::debug(QString("jumper d %1, %2").arg(routeThing.bestDistanceToSource).arg(routeThing.bestDistanceToTarget)); @@ -1193,7 +1208,7 @@ bool MazeRouter::routeOne(bool makeJumper, Score & currentScore, int netIndex, R bool MazeRouter::routeNext(bool makeJumper, RouteThing & routeThing, QList< QList > & subnets, Score & currentScore, int netIndex, QList & allOrderings) { - bool result = true; + auto result = true; QList combined; if (routeThing.unrouted) { @@ -1223,9 +1238,9 @@ bool MazeRouter::routeNext(bool makeJumper, RouteThing & routeThing, QList< QLis routeThing.nearest.j = -1; routeThing.nearest.distance = std::numeric_limits::max(); findNearestPair(subnets, 0, combined, routeThing.nearest); - QPointF ip = routeThing.nearest.ic->sceneAdjustedTerminalPoint(NULL) - m_maxRect.topLeft(); + auto ip = routeThing.nearest.ic->sceneAdjustedTerminalPoint(nullptr) - m_maxRect.topLeft(); routeThing.gridSourcePoint = QPoint(ip.x() / m_gridPixels, ip.y() / m_gridPixels); - QPointF jp = routeThing.nearest.jc->sceneAdjustedTerminalPoint(NULL) - m_maxRect.topLeft(); + auto jp = routeThing.nearest.jc->sceneAdjustedTerminalPoint(nullptr) - m_maxRect.topLeft(); routeThing.gridTargetPoint = QPoint(jp.x() / m_gridPixels, jp.y() / m_gridPixels); routeThing.sourceQ = std::priority_queue(); @@ -1377,7 +1392,7 @@ void MazeRouter::prepSourceAndTarget(QDomDocument * masterDoc, RouteThing & rout void MazeRouter::findNearestPair(QList< QList > & subnets, Nearest & nearest) { nearest.distance = std::numeric_limits::max(); nearest.i = nearest.j = -1; - nearest.ic = nearest.jc = NULL; + nearest.ic = nearest.jc = nullptr; for (int i = 0; i < subnets.count() - 1; i++) { QList inet = subnets.at(i); findNearestPair(subnets, i, inet, nearest); @@ -1388,16 +1403,16 @@ void MazeRouter::findNearestPair(QList< QList > & subnets, int for (int j = inetix + 1; j < subnets.count(); j++) { QList jnet = subnets.at(j); foreach (ConnectorItem * ic, inet) { - QPointF ip = ic->sceneAdjustedTerminalPoint(NULL); + QPointF ip = ic->sceneAdjustedTerminalPoint(nullptr); ConnectorItem * icc = ic->getCrossLayerConnectorItem(); foreach (ConnectorItem * jc, jnet) { ConnectorItem * jcc = jc->getCrossLayerConnectorItem(); if (jc == ic || jcc == ic) continue; - QPointF jp = jc->sceneAdjustedTerminalPoint(NULL); + QPointF jp = jc->sceneAdjustedTerminalPoint(nullptr); double d = qSqrt(GraphicsUtils::distanceSqd(ip, jp)) / m_gridPixels; if (ic->attachedToViewLayerID() != jc->attachedToViewLayerID()) { - if (jcc != NULL || icc != NULL) { + if (jcc != nullptr || icc != nullptr) { // may not need a via d += CrossLayerCost; } @@ -1407,7 +1422,7 @@ void MazeRouter::findNearestPair(QList< QList > & subnets, int } } else { - if (jcc != NULL && icc != NULL && ic->attachedToViewLayerID() == ViewLayer::Copper1) { + if (jcc != nullptr && icc != nullptr && ic->attachedToViewLayerID() == ViewLayer::Copper1) { // route on the bottom when possible d += Layer1Cost; } @@ -1480,7 +1495,7 @@ QList MazeRouter::renderSource(QDomDocument * masterDoc, int z, ViewLaye continue; } - QPointF p = connectorItem->sceneAdjustedTerminalPoint(NULL); + QPointF p = connectorItem->sceneAdjustedTerminalPoint(nullptr); QRectF r = connectorItem->attachedTo()->sceneBoundingRect().adjusted(-m_keepoutPixels, -m_keepoutPixels, m_keepoutPixels, m_keepoutPixels); QPointF closest(p.x(), r.top()); double d = qAbs(p.y() - r.top()); @@ -1927,7 +1942,7 @@ bool MazeRouter::viaWillFit(GridPoint & gridPoint, Grid * grid) { void MazeRouter::updateDisplay(int iz) { QPixmap pixmap = QPixmap::fromImage(*m_displayImage[iz]); - if (m_displayItem[iz] == NULL) { + if (m_displayItem[iz] == nullptr) { m_displayItem[iz] = new QGraphicsPixmapItem(pixmap); m_displayItem[iz]->setFlag(QGraphicsItem::ItemIsSelectable, false); m_displayItem[iz]->setFlag(QGraphicsItem::ItemIsMovable, false); @@ -2138,8 +2153,8 @@ void MazeRouter::createTraces(NetList & netList, Score & bestScore, QUndoCommand qSort(traces.begin(), traces.end(), byOrder); TraceThing traceThing; - traceThing.jumperItem = NULL; - traceThing.netLabel = NULL; + traceThing.jumperItem = nullptr; + traceThing.netLabel = nullptr; traceThing.topLeft = m_maxRect.topLeft(); int newTraceIndex = 0; @@ -2238,7 +2253,7 @@ void MazeRouter::createTraces(NetList & netList, Score & bestScore, QUndoCommand delete netLabel; } foreach (ModelPart * modelPart, modelParts) { - modelPart->setParent(NULL); + modelPart->setParent(nullptr); delete modelPart; } @@ -2253,7 +2268,7 @@ void MazeRouter::createTrace(Trace & trace, QList & gridPoints, Trace long newID = ItemBase::getNextID(); ViewGeometry viewGeometry; ItemBase * itemBase = m_sketchWidget->addItem(m_sketchWidget->referenceModel()->retrieveModelPart(ModuleIDNames::JumperModuleIDName), - ViewLayer::NewTop, BaseCommand::SingleView, viewGeometry, newID, -1, NULL); + ViewLayer::NewTop, BaseCommand::SingleView, viewGeometry, newID, -1, nullptr); traceThing.jumperItem = dynamic_cast(itemBase); traceThing.jumperItem->setAutoroutable(true); @@ -2264,7 +2279,7 @@ void MazeRouter::createTrace(Trace & trace, QList & gridPoints, Trace traceThing.newJumperItems << traceThing.jumperItem; } else { - traceThing.netLabel = makeNetLabel(trace.gridPoints.first(), NULL, trace.flags); + traceThing.netLabel = makeNetLabel(trace.gridPoints.first(), nullptr, trace.flags); traceThing.newNetLabels << traceThing.netLabel; } } @@ -2277,11 +2292,11 @@ void MazeRouter::createTrace(Trace & trace, QList & gridPoints, Trace traceThing.newNetLabels << traceThing.netLabel; } } - else traceThing.jumperItem = NULL; + else traceThing.jumperItem = nullptr; bool onTraceS, onTraceD; QPointF traceAnchorS, traceAnchorD; - ConnectorItem * sourceConnectorItem = NULL; + ConnectorItem * sourceConnectorItem = nullptr; if (traceThing.jumperItem) { onTraceS = onTraceD = false; sourceConnectorItem = (trace.flags & JumperStart) ? traceThing.jumperItem->connector0() : traceThing.jumperItem->connector1(); @@ -2290,15 +2305,15 @@ void MazeRouter::createTrace(Trace & trace, QList & gridPoints, Trace sourceConnectorItem = traceThing.netLabel->connector0(); } else { - sourceConnectorItem = findAnchor(gridPoints.first(), traceThing, net, traceAnchorS, onTraceS, NULL); + sourceConnectorItem = findAnchor(gridPoints.first(), traceThing, net, traceAnchorS, onTraceS, nullptr); } - if (sourceConnectorItem == NULL) { + if (sourceConnectorItem == nullptr) { DebugDialog::debug("missing source connector"); return; } ConnectorItem * destConnectorItem = findAnchor(gridPoints.last(), traceThing, net, traceAnchorD, onTraceD, sourceConnectorItem); - if (destConnectorItem == NULL) { + if (destConnectorItem == nullptr) { /* GridPoint gp = gridPoints.last(); @@ -2320,8 +2335,8 @@ void MazeRouter::createTrace(Trace & trace, QList & gridPoints, Trace // destConnectorItem->debugInfo("dest"); //} - QPointF sourcePoint = sourceConnectorItem->sceneAdjustedTerminalPoint(NULL); - QPointF destPoint = destConnectorItem->sceneAdjustedTerminalPoint(NULL); + QPointF sourcePoint = sourceConnectorItem->sceneAdjustedTerminalPoint(nullptr); + QPointF destPoint = destConnectorItem->sceneAdjustedTerminalPoint(nullptr); bool skipFirst = false; bool skipLast = false; @@ -2373,7 +2388,7 @@ void MazeRouter::createTrace(Trace & trace, QList & gridPoints, Trace } int lastz = point.z; - ConnectorItem * nextSource = NULL; + ConnectorItem * nextSource = nullptr; if (onTraceS) { if (!atLeast(sourcePoint, traceAnchorS)) { onTraceS = false; @@ -2415,7 +2430,7 @@ void MazeRouter::createTrace(Trace & trace, QList & gridPoints, Trace viewGeometry.setLoc(QPointF(newPoint.p.x() - halfVia - Hole::OffsetPixels, newPoint.p.y() - halfVia - Hole::OffsetPixels)); ItemBase * itemBase = m_sketchWidget->addItem(m_sketchWidget->referenceModel()->retrieveModelPart(ModuleIDNames::ViaModuleIDName), - ViewLayer::NewTop, BaseCommand::SingleView, viewGeometry, newID, -1, NULL); + ViewLayer::NewTop, BaseCommand::SingleView, viewGeometry, newID, -1, nullptr); //DebugDialog::debug(QString("back from adding via %1").arg((long) itemBase, 0, 16)); Via * via = qobject_cast(itemBase); @@ -2460,7 +2475,7 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, TraceThing & traceThing, Ne QRectF gridRect(gp.x * m_gridPixels + traceThing.topLeft.x(), gp.y * m_gridPixels + traceThing.topLeft.y(), m_gridPixels, m_gridPixels); ConnectorItem * connectorItem = findAnchor(gp, gridRect, traceThing, net, p, onTrace, already); - if (connectorItem != NULL) { + if (connectorItem != nullptr) { //if (connectorItem->attachedToID() == 9781620) { // connectorItem->debugInfo("9781620"); //} @@ -2478,8 +2493,8 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, TraceThing & traceThing, Ne ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, TraceThing & traceThing, Net * net, QPointF & p, bool & onTrace, ConnectorItem * already) { - ConnectorItem * alreadyCross = NULL; - if (already != NULL) alreadyCross = already->getCrossLayerConnectorItem(); + ConnectorItem * alreadyCross = nullptr; + if (already != nullptr) alreadyCross = already->getCrossLayerConnectorItem(); QList traceWires; QList traceConnectorItems; foreach (QGraphicsItem * item, m_sketchWidget->scene()->items(gridRect)) { @@ -2489,9 +2504,9 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, Tr if (connectorItem == already) continue; if (connectorItem == alreadyCross) continue; - if (already != NULL && connectorItem->attachedTo() == already->attachedTo()) { + if (already != nullptr && connectorItem->attachedTo() == already->attachedTo()) { ConnectorItem * cross = connectorItem->getCrossLayerConnectorItem(); - if (cross != NULL) { + if (cross != nullptr) { if (cross == already) continue; if (cross == alreadyCross) continue; } @@ -2509,9 +2524,9 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, Tr if (net->net->contains(connectorItem)) ; else { TraceWire * traceWire = qobject_cast(connectorItem->attachedTo()); - if (traceWire == NULL) { + if (traceWire == nullptr) { Via * via = qobject_cast(connectorItem->attachedTo()->layerKinChief()); - if (via == NULL) isCandidate = false; + if (via == nullptr) isCandidate = false; else isCandidate = traceThing.newVias.contains(via); } else { @@ -2529,13 +2544,13 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, Tr // connectorItem->debugInfo("chose not trace"); //} onTrace = false; - p = connectorItem->sceneAdjustedTerminalPoint(NULL); + p = connectorItem->sceneAdjustedTerminalPoint(nullptr); return connectorItem; } } TraceWire * traceWire = dynamic_cast(item); - if (traceWire == NULL) continue; + if (traceWire == nullptr) continue; if (!traceWire->isEverVisible()) continue; // only do traces if no connectorItem is found @@ -2550,7 +2565,7 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, Tr //} onTrace = false; ConnectorItem * connectorItem = traceConnectorItems.takeLast(); - p = connectorItem->sceneAdjustedTerminalPoint(NULL); + p = connectorItem->sceneAdjustedTerminalPoint(nullptr); return connectorItem; } @@ -2566,8 +2581,8 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, Tr onTrace = true; QPointF center = gridRect.center(); - QPointF p0 = traceWire->connector0()->sceneAdjustedTerminalPoint(NULL); - QPointF p1 = traceWire->connector1()->sceneAdjustedTerminalPoint(NULL); + QPointF p0 = traceWire->connector0()->sceneAdjustedTerminalPoint(nullptr); + QPointF p1 = traceWire->connector1()->sceneAdjustedTerminalPoint(nullptr); double d0 = GraphicsUtils::distanceSqd(p0, center); double d1 = GraphicsUtils::distanceSqd(p1, center); double dx, dy, distanceSegment; @@ -2587,7 +2602,7 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, Tr } DebugDialog::debug("overlap not found"); - return NULL; + return nullptr; } void MazeRouter::removeColinear(QList & gridPoints) { @@ -2687,7 +2702,7 @@ void MazeRouter::removeStep(int ix, QList & gridPoints) { void MazeRouter::addConnectionToUndo(ConnectorItem * from, ConnectorItem * to, QUndoCommand * parentCommand) { - if (from == NULL || to == NULL) return; + if (from == nullptr || to == nullptr) return; ChangeConnectionCommand * ccc = new ChangeConnectionCommand(m_sketchWidget, BaseCommand::CrossView, from->attachedToID(), from->connectorSharedID(), @@ -2764,7 +2779,7 @@ SymbolPaletteItem * MazeRouter::makeNetLabel(GridPoint & center, SymbolPaletteIt m_netLabelIndex = 0; foreach (QGraphicsItem * item, m_sketchWidget->scene()->items()) { SymbolPaletteItem * netLabel = dynamic_cast(item); - if (netLabel == NULL || !netLabel->isOnlyNetLabel()) continue; + if (netLabel == nullptr || !netLabel->isOnlyNetLabel()) continue; bool ok; int ix = netLabel->getLabel().toInt(&ok); @@ -2772,14 +2787,14 @@ SymbolPaletteItem * MazeRouter::makeNetLabel(GridPoint & center, SymbolPaletteIt } } - if (pairedNetLabel == NULL) { + if (pairedNetLabel == nullptr) { m_netLabelIndex++; } long newID = ItemBase::getNextID(); ViewGeometry viewGeometry; ItemBase * itemBase = m_sketchWidget->addItem(m_sketchWidget->referenceModel()->retrieveModelPart(traceFlags & JumperLeft ? ModuleIDNames::NetLabelModuleIDName : ModuleIDNames::LeftNetLabelModuleIDName), - ViewLayer::NewBottom, BaseCommand::SingleView, viewGeometry, newID, -1, NULL); + ViewLayer::NewBottom, BaseCommand::SingleView, viewGeometry, newID, -1, nullptr); SymbolPaletteItem * netLabel = dynamic_cast(itemBase); netLabel->setAutoroutable(true); @@ -3054,10 +3069,10 @@ void MazeRouter::optimizeTraces(QList & order, QMultiHashwidth() + m_keepoutPixels + m_keepoutPixels) * OptimizeFactor); painter.setPen(pen); foreach (TraceWire * traceWire, bundle) { - if (traceWire == NULL) continue; + if (traceWire == nullptr) continue; - QPointF p1 = (traceWire->connector0()->sceneAdjustedTerminalPoint(NULL) - topLeft) * OptimizeFactor; - QPointF p2 = (traceWire->connector1()->sceneAdjustedTerminalPoint(NULL) - topLeft) * OptimizeFactor; + QPointF p1 = (traceWire->connector0()->sceneAdjustedTerminalPoint(nullptr) - topLeft) * OptimizeFactor; + QPointF p2 = (traceWire->connector1()->sceneAdjustedTerminalPoint(nullptr) - topLeft) * OptimizeFactor; painter.drawLine(p1, p2); } } @@ -3065,15 +3080,15 @@ void MazeRouter::optimizeTraces(QList & order, QMultiHashconnectorItem()->sceneAdjustedTerminalPoint(NULL) - topLeft) * OptimizeFactor; + QPointF p = (via->connectorItem()->sceneAdjustedTerminalPoint(nullptr) - topLeft) * OptimizeFactor; double rad = ((via->connectorItem()->sceneBoundingRect().width() / 2) + m_keepoutPixels) * OptimizeFactor; painter.drawEllipse(p, rad, rad); } foreach (JumperItem * jumperItem, jumperItems.values(otherIndex)) { - QPointF p = (jumperItem->connector0()->sceneAdjustedTerminalPoint(NULL) - topLeft) * OptimizeFactor; + QPointF p = (jumperItem->connector0()->sceneAdjustedTerminalPoint(nullptr) - topLeft) * OptimizeFactor; double rad = ((jumperItem->connector0()->sceneBoundingRect().width() / 2) + m_keepoutPixels) * OptimizeFactor; painter.drawEllipse(p, rad, rad); - p = (jumperItem->connector1()->sceneAdjustedTerminalPoint(NULL) - topLeft) * OptimizeFactor; + p = (jumperItem->connector1()->sceneAdjustedTerminalPoint(nullptr) - topLeft) * OptimizeFactor; painter.drawEllipse(p, rad, rad); } foreach (SymbolPaletteItem * netLabel, netLabels.values(otherIndex)) { @@ -3109,7 +3124,7 @@ void MazeRouter::optimizeTraces(QList & order, QMultiHash= 0; i--) { TraceWire * traceWire = bundle.at(i); - if (traceWire == NULL) bundle.removeAt(i); + if (traceWire == nullptr) bundle.removeAt(i); } if (ViewLayer::specFromID(bundle.at(0)->viewLayerID()) != layerSpec) { @@ -3137,10 +3152,10 @@ void MazeRouter::optimizeTraces(QList & order, QMultiHashconnector0())) splits.replace(index, true); - points.replace(index, traceWire->connector0()->sceneAdjustedTerminalPoint(NULL)); + points.replace(index, traceWire->connector0()->sceneAdjustedTerminalPoint(nullptr)); index++; if (connectionThing.multi(traceWire->connector1())) splits.replace(index, true); - points.replace(index, traceWire->connector1()->sceneAdjustedTerminalPoint(NULL)); + points.replace(index, traceWire->connector1()->sceneAdjustedTerminalPoint(nullptr)); } splits.replace(0, false); @@ -3262,7 +3277,7 @@ void MazeRouter::reducePoints(QList & points, QPointF topLeft, QListconnector1()); ModelPart * modelPart = tw->modelPart(); delete tw; - modelPart->setParent(NULL); + modelPart->setParent(nullptr); delete modelPart; points.removeAt(ix + 2); } @@ -3277,12 +3292,12 @@ void MazeRouter::reducePoints(QList & points, QPointF topLeft, QListconnector1(), next->connector0()); for (int i = 0; i < separation - 1; i++) { - TraceWire * tw = bundle.takeAt(ix + 1); + auto tw = bundle.takeAt(ix + 1); connectionThing.remove(tw->connector0()); connectionThing.remove(tw->connector1()); - ModelPart * modelPart = tw->modelPart(); + auto modelPart = tw->modelPart(); delete tw; - modelPart->setParent(NULL); + modelPart->setParent(nullptr); delete modelPart; points.removeAt(ix + 1); } diff --git a/src/autoroute/mazerouter/mazerouter.h b/src/autoroute/mazerouter/mazerouter.h index e090cada6..876da44d5 100644 --- a/src/autoroute/mazerouter/mazerouter.h +++ b/src/autoroute/mazerouter/mazerouter.h @@ -183,7 +183,7 @@ class MazeRouter : public Autorouter public: MazeRouter(class PCBSketchWidget *, QGraphicsItem * board, bool adjustIf); - ~MazeRouter(void); + ~MazeRouter(); void start(); @@ -249,15 +249,15 @@ public slots: int m_halfGridJumperSize; double m_gridPixels; double m_standardWireWidth; - QImage * m_displayImage[2]; + QImage * m_displayImage[2] = { nullptr, nullptr }; QImage * m_boardImage; QImage * m_spareImage; QImage * m_spareImage2; - QGraphicsPixmapItem * m_displayItem[2]; + QGraphicsPixmapItem * m_displayItem[2] = { nullptr, nullptr }; bool m_temporaryBoard; CostFunction m_costFunction; JumperWillFitFunction m_jumperWillFitFunction; - uint m_traceColors[2]; + uint m_traceColors[2] = { 0 }; Grid * m_grid; int m_cleanupCount; int m_netLabelIndex; From 927165bb48ccac623a53234619f26f31c26178d2 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 21:39:39 -0800 Subject: [PATCH 17/61] Fix sev 1 violations in fapplication --- src/fapplication.cpp | 10 ---------- src/fapplication.h | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 843c79b27..47f01e138 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -338,16 +338,6 @@ void RegenerateDatabaseThread::run() { FApplication::FApplication( int & argc, char ** argv) : QApplication(argc, argv) { - m_fServer = NULL; - m_spaceBarIsPressed = false; - m_mousePressed = false; - m_referenceModel = NULL; - m_started = false; - m_updateDialog = NULL; - m_lastTopmostWindow = NULL; - m_serviceType = NoService; - m_splash = NULL; - m_arguments = arguments(); } diff --git a/src/fapplication.h b/src/fapplication.h index f5aa80bca..78d13f359 100644 --- a/src/fapplication.h +++ b/src/fapplication.h @@ -96,8 +96,8 @@ class RegenerateDatabaseThread : public QThread protected: QString m_dbFileName; QString m_error; - QDialog * m_progressDialog; - ReferenceModel * m_referenceModel; + QDialog * m_progressDialog = nullptr; + ReferenceModel * m_referenceModel = nullptr; }; //////////////////////////////////////////////////// @@ -203,15 +203,15 @@ public slots: }; protected: - bool m_spaceBarIsPressed; - bool m_mousePressed; + bool m_spaceBarIsPressed = false; + bool m_mousePressed = false; QTranslator m_translator; - ReferenceModel * m_referenceModel; - bool m_started; + ReferenceModel * m_referenceModel = nullptr; + bool m_started = false; QStringList m_filesToLoad; QString m_libPath; QString m_translationPath; - class UpdateDialog * m_updateDialog; + class UpdateDialog * m_updateDialog = nullptr; QTimer m_activationTimer; QPointer m_lastTopmostWindow; QList m_orderedTopLevelWidgets; @@ -219,16 +219,16 @@ public slots: QStringList m_externalProcessArgs; QString m_externalProcessName; QString m_externalProcessPath; - ServiceType m_serviceType; - int m_progressIndex; - class FSplashScreen * m_splash; + ServiceType m_serviceType = NoService; + int m_progressIndex = 0; + class FSplashScreen * m_splash = nullptr; QString m_outputFolder; QString m_portRootFolder; QString m_panelFilename; QHash m_lockedFiles; - bool m_panelizerCustom; - int m_portNumber; - FServer * m_fServer; + bool m_panelizerCustom = false; + int m_portNumber = 0; + FServer * m_fServer = nullptr; QString m_buildType; }; From d5a12078fd21b584e874f1705a13ad888cd0a847 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 10 Nov 2019 21:43:51 -0800 Subject: [PATCH 18/61] fix violations in welcomeview --- src/sketch/welcomeview.cpp | 98 ++++++++++++++++++-------------------- src/sketch/welcomeview.h | 30 ++++++------ 2 files changed, 62 insertions(+), 66 deletions(-) diff --git a/src/sketch/welcomeview.cpp b/src/sketch/welcomeview.cpp index 64717024c..6d0dbf6fe 100644 --- a/src/sketch/welcomeview.cpp +++ b/src/sketch/welcomeview.cpp @@ -44,14 +44,14 @@ along with Fritzing. If not, see . //////////////////////////////////////////////////////////// -static const int TitleRole = Qt::UserRole; -static const int IntroRole = Qt::UserRole + 1; -static const int DateRole = Qt::UserRole + 2; -static const int AuthorRole = Qt::UserRole + 3; -static const int IconRole = Qt::UserRole + 4; -static const int RefRole = Qt::UserRole + 5; -static const int ImageSpace = 65; -static const int TopSpace = 5; +constexpr auto TitleRole = Qt::UserRole; +constexpr auto IntroRole = Qt::UserRole + 1; +constexpr auto DateRole = Qt::UserRole + 2; +constexpr auto AuthorRole = Qt::UserRole + 3; +constexpr auto IconRole = Qt::UserRole + 4; +constexpr auto RefRole = Qt::UserRole + 5; +constexpr auto ImageSpace = 65; +constexpr auto TopSpace = 5; QString WelcomeView::m_activeHeaderLabelColor = "#333"; QString WelcomeView::m_inactiveHeaderLabelColor = "#b1b1b1"; @@ -239,11 +239,11 @@ BlogListDelegate::~BlogListDelegate() void BlogListDelegate::paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const { - BlogListWidget * listWidget = qobject_cast(this->parent()); - if (listWidget == NULL) return; + auto listWidget = qobject_cast(this->parent()); + if (!listWidget) return; - QStyle * style = listWidget->style(); - if (style == NULL) return; + auto style = listWidget->style(); + if (!style) return; painter->save(); @@ -311,7 +311,6 @@ WelcomeView::WelcomeView(QWidget * parent) : QFrame(parent) { this->setObjectName("welcomeView"); - m_tip = NULL; setAcceptDrops(true); initLayout(); @@ -332,9 +331,6 @@ WelcomeView::WelcomeView(QWidget * parent) : QFrame(parent) nextTip(); } -WelcomeView::~WelcomeView() { -} - void WelcomeView::initLayout() { QGridLayout * mainLayout = new QGridLayout(); @@ -390,10 +386,10 @@ QWidget * WelcomeView::initRecent() { names << "recentSpace" << "recentNewSketch" << "recentOpenSketch"; foreach (QString name, names) { - QWidget * widget = NULL; + QWidget * widget = nullptr; QLayout * whichLayout = frameLayout; - QLabel * icon = NULL; - QLabel * text = NULL; + QLabel * icon = nullptr; + QLabel * text = nullptr; if (name == "recentSpace") { widget = new QLabel(); } @@ -682,13 +678,13 @@ void WelcomeView::showEvent(QShowEvent * event) { } void WelcomeView::updateRecent() { - if (m_recentListWidget == NULL) return; + if (!m_recentListWidget) return; QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); + auto files = settings.value("recentFileList").toStringList(); m_recentListWidget->clear(); - bool gotOne = false; + auto gotOne = false; QIcon icon(":/resources/images/icons/WS-fzz-icon.png"); for (int i = 0; i < files.size(); ++i) { @@ -696,7 +692,7 @@ void WelcomeView::updateRecent() { if (!finfo.exists()) continue; gotOne = true; - QListWidgetItem * item = new QListWidgetItem(icon, finfo.fileName()); + auto item = new QListWidgetItem(icon, finfo.fileName()); item->setData(Qt::UserRole, finfo.absoluteFilePath()); item->setToolTip(finfo.absoluteFilePath()); m_recentListWidget->addItem(item); @@ -704,7 +700,7 @@ void WelcomeView::updateRecent() { if (!gotOne) { // put in a placeholder if there are no recent files - QListWidgetItem * item = new QListWidgetItem(icon, tr("No recent sketches found")); + auto item = new QListWidgetItem(icon, tr("No recent sketches found")); item->setData(Qt::UserRole, ""); m_recentListWidget->addItem(item); } @@ -722,16 +718,16 @@ void WelcomeView::clickRecent(const QString & url) { } void WelcomeView::gotBlogSnippet(QNetworkReply * networkReply) { - bool blog = networkReply->url().toString().contains("blog"); - QString prefix = networkReply->url().scheme() + "://" + networkReply->url().authority(); - QNetworkAccessManager * manager = networkReply->manager(); - int responseCode = networkReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + auto blog = networkReply->url().toString().contains("blog"); + auto prefix = networkReply->url().scheme() + "://" + networkReply->url().authority(); + auto manager = networkReply->manager(); + auto responseCode = networkReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - bool goodBlog = false; + auto goodBlog = false; QDomDocument doc; QString errorStr; - int errorLine; - int errorColumn; + auto errorLine = 0; + auto errorColumn = 0; if (responseCode == 200) { QString data(networkReply->readAll()); //DebugDialog::debug("response data " + data); @@ -840,7 +836,7 @@ void WelcomeView::clickBlog(const QString & url) { void WelcomeView::readBlog(const QDomDocument & doc, bool doEmit, bool blog, const QString & prefix) { - BlogListWidget * listWidget = (blog) ? m_blogListWidget : m_projectListWidget; + auto listWidget = (blog) ? m_blogListWidget : m_projectListWidget; listWidget->clear(); listWidget->imageRequestList().clear(); @@ -879,7 +875,7 @@ void WelcomeView::readBlog(const QDomDocument & doc, bool doEmit, bool blog, con if (stuff.value("title", "").isEmpty()) continue; if (stuff.value("href", "").isEmpty()) continue; - QListWidgetItem * item = new QListWidgetItem(); + auto item = new QListWidgetItem(); item->setData(TitleRole, stuff.value("title")); item->setData(RefRole, stuff.value("href")); QString text = stuff.value("intro", ""); @@ -907,7 +903,7 @@ void WelcomeView::readBlog(const QDomDocument & doc, bool doEmit, bool blog, con getNextBlogImage(0, blog); foreach (QWidget *widget, QApplication::topLevelWidgets()) { WelcomeView * other = widget->findChild(); - if (other == NULL) continue; + if (!other) continue; if (other == this) continue; other->readBlog(doc, false, blog, prefix); @@ -930,22 +926,22 @@ void WelcomeView::getNextBlogImage(int ix, bool blog) { } void WelcomeView::gotBlogImage(QNetworkReply * networkReply) { - QNetworkAccessManager * manager = networkReply->manager(); - if (manager == NULL) return; + auto manager = networkReply->manager(); + if (!manager) return; - int index = manager->property("index").toInt(); - bool blog = manager->property("blog").toBool(); + auto index = manager->property("index").toInt(); + auto blog = manager->property("blog").toBool(); - int responseCode = networkReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + auto responseCode = networkReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if (responseCode == 200) { QByteArray data(networkReply->readAll()); QPixmap pixmap; if (pixmap.loadFromData(data)) { - QPixmap scaled = pixmap.scaled(QSize(ImageSpace, ImageSpace), Qt::KeepAspectRatio); + auto scaled = pixmap.scaled(QSize(ImageSpace, ImageSpace), Qt::KeepAspectRatio); setBlogItemImage(scaled, index, blog); foreach (QWidget *widget, QApplication::topLevelWidgets()) { - WelcomeView * other = widget->findChild(); - if (other == NULL) continue; + auto other = widget->findChild(); + if (!other) continue; if (other == this) continue; other->setBlogItemImage(scaled, index, blog); @@ -959,16 +955,16 @@ void WelcomeView::gotBlogImage(QNetworkReply * networkReply) { } QWidget * WelcomeView::initTip() { - QFrame * tipFrame = new QFrame(); + auto tipFrame = new QFrame(); tipFrame->setObjectName("tipFrame"); - QVBoxLayout * tipLayout = new QVBoxLayout(); + auto tipLayout = new QVBoxLayout(); zeroMargin(tipLayout); - QLabel * tipTitle = new QLabel(tr("Tip of the Day:")); + auto tipTitle = new QLabel(tr("Tip of the Day:")); tipTitle->setObjectName("tipTitle"); tipLayout->addWidget(tipTitle); - QScrollArea * scrollArea = new QScrollArea; + auto scrollArea = new QScrollArea; scrollArea->setObjectName("tipScrollArea"); scrollArea->setWidgetResizable(true); // scrollArea->setAlignment(Qt::AlignTop | Qt::AlignLeft); @@ -987,11 +983,11 @@ QWidget * WelcomeView::initTip() { QFrame * footerFrame = new QFrame(); footerFrame->setObjectName("tipFooterFrame"); - QHBoxLayout * footerFrameLayout = new QHBoxLayout; + auto footerFrameLayout = new QHBoxLayout; zeroMargin(footerFrameLayout); - QLabel * footerLabel = new QLabel(QString("%1").arg(tr("All Tips"))); + auto footerLabel = new QLabel(QString("%1").arg(tr("All Tips"))); footerLabel->setObjectName("allTips"); footerFrameLayout->addWidget(footerLabel); connect(footerLabel, SIGNAL(linkActivated(const QString &)), this->window(), SLOT(tipsAndTricks())); @@ -1021,7 +1017,7 @@ void WelcomeView::dragEnterEvent(QDragEnterEvent *event) } void WelcomeView::nextTip() { - if (m_tip == NULL) return; + if (!m_tip) return; m_tip->setText(QString("%1").arg(TipsAndTricks::randomTip())); } @@ -1044,8 +1040,8 @@ void WelcomeView::blogItemClicked(QListWidgetItem * item) { void WelcomeView::setBlogItemImage(QPixmap & pixmap, int index, bool blog) { // TODO: this is not totally thread-safe if there are multiple sketch widgets opened within a very short time - BlogListWidget * listWidget = (blog) ? m_blogListWidget : m_projectListWidget; - QListWidgetItem * item = listWidget->item(index); + auto listWidget = (blog) ? m_blogListWidget : m_projectListWidget; + auto item = listWidget->item(index); if (item) { item->setData(IconRole, pixmap); } diff --git a/src/sketch/welcomeview.h b/src/sketch/welcomeview.h index 43ee2622a..980cb9231 100644 --- a/src/sketch/welcomeview.h +++ b/src/sketch/welcomeview.h @@ -109,7 +109,7 @@ class WelcomeView : public QFrame public: WelcomeView(QWidget * parent = 0); - ~WelcomeView(); + ~WelcomeView() = default; void showEvent(QShowEvent * event); void dragEnterEvent(QDragEnterEvent *event); @@ -147,20 +147,20 @@ protected slots: void nextTip(); protected: - BlogListWidget * m_blogListWidget; - BlogListWidget * m_projectListWidget; - QWidget * m_blogUberFrame; - QWidget * m_projectsUberFrame; - QLabel * m_tip; - QListWidget * m_recentListWidget; - QWidget * m_fabUberFrame; - QWidget * m_shopUberFrame; - QWidget * m_donateUberFrame; - QLabel * m_projectsLabel; - QLabel * m_blogLabel; - QLabel * m_fabLabel; - QLabel * m_shopLabel; - QLabel * m_donateLabel; + BlogListWidget * m_blogListWidget = nullptr; + BlogListWidget * m_projectListWidget = nullptr; + QWidget * m_blogUberFrame = nullptr; + QWidget * m_projectsUberFrame = nullptr; + QLabel * m_tip = nullptr; + QListWidget * m_recentListWidget = nullptr; + QWidget * m_fabUberFrame = nullptr; + QWidget * m_shopUberFrame = nullptr; + QWidget * m_donateUberFrame = nullptr; + QLabel * m_projectsLabel = nullptr; + QLabel * m_blogLabel = nullptr; + QLabel * m_fabLabel = nullptr; + QLabel * m_shopLabel = nullptr; + QLabel * m_donateLabel = nullptr; static QString m_activeHeaderLabelColor; static QString m_inactiveHeaderLabelColor; From 9c0337dad9f9b72747b19650e472472687f0f0b3 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 15:18:11 -0800 Subject: [PATCH 19/61] Fix more SA violations --- src/autoroute/drc.cpp | 47 ++++++++++++++++++++++--------------------- src/autoroute/drc.h | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/autoroute/drc.cpp b/src/autoroute/drc.cpp index ff8a31801..866c9255a 100644 --- a/src/autoroute/drc.cpp +++ b/src/autoroute/drc.cpp @@ -173,10 +173,10 @@ DRCResultsDialog::DRCResultsDialog(const QString & message, const QStringList & } DRCResultsDialog::~DRCResultsDialog() { - if (m_displayItem != nullptr && m_sketchWidget != nullptr) { + if (m_displayItem && m_sketchWidget) { delete m_displayItem; } - if (m_displayImage != nullptr) { + if (m_displayImage) { delete m_displayImage; } foreach (CollidingThing * collidingThing, m_collidingThings) { @@ -186,7 +186,7 @@ DRCResultsDialog::~DRCResultsDialog() { } void DRCResultsDialog::pressedSlot(QListWidgetItem * item) { - if (item == nullptr) return; + if (!item) return; int ix = item->data(Qt::UserRole).toInt(); CollidingThing * collidingThing = m_collidingThings.at(ix); @@ -201,7 +201,7 @@ void DRCResultsDialog::pressedSlot(QListWidgetItem * item) { } void DRCResultsDialog::releasedSlot(QListWidgetItem * item) { - if (item == nullptr) return; + if (!item) return; int ix = item->data(Qt::UserRole).toInt(); CollidingThing * collidingThing = m_collidingThings.at(ix); @@ -223,17 +223,18 @@ static QString CancelledMessage; /////////////////////////////////////////// -DRC::DRC(PCBSketchWidget * sketchWidget, ItemBase * board) +DRC::DRC(PCBSketchWidget * sketchWidget, ItemBase * board) : + m_sketchWidget(widget), + m_board(board), + m_keepout(0.0), + m_plusImage(nullptr), + m_minusImage(nullptr), + m_displayImage(nullptr), + m_displayItem(nullptr), + m_cancelled(false), + m_maxProgress(0) { CancelledMessage = tr("DRC was cancelled."); - - m_cancelled = false; - m_sketchWidget = sketchWidget; - m_board = board; - m_displayItem = nullptr; - m_displayImage = nullptr; - m_plusImage = nullptr; - m_minusImage = nullptr; } DRC::~DRC(void) @@ -305,7 +306,7 @@ bool DRC::startAux(QString & message, QStringList & messages, QList > singletons; foreach (QGraphicsItem * item, m_sketchWidget->scene()->items()) { ConnectorItem * connectorItem = dynamic_cast(item); - if (connectorItem == nullptr) continue; + if (!connectorItem) continue; if (!connectorItem->attachedTo()->isEverVisible()) continue; if (connectorItem->attachedTo()->getRatsnest()) continue; if (visited.contains(connectorItem)) continue; @@ -673,13 +674,13 @@ void DRC::splitNetPrep(QDomDocument * masterDoc, QList & equi, QSet wireIDs; foreach (ConnectorItem * equ, equi) { ItemBase * itemBase = equ->attachedTo(); - if (itemBase == nullptr) continue; + if (!itemBase) continue; if (itemBase->itemType() == ModelPart::Wire) { wireIDs.insert(QString::number(itemBase->id())); } - if (equ->connector() == nullptr) { + if (!equ->connector()) { // this shouldn't happen itemBase->debugInfo("!!!!!!!!!!!!!!!!!!!!!!!!!!!!! missing connector !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); equ->debugInfo("missing connector"); @@ -909,7 +910,7 @@ void DRC::splitSubs(QDomDocument * doc, QDomElement & root, const QString & part void DRC::updateDisplay() { QPixmap pixmap = QPixmap::fromImage(*m_displayImage); - if (m_displayItem == nullptr) { + if (!m_displayItem) { m_displayItem = new QGraphicsPixmapItem(pixmap); m_displayItem->setPos(m_board->sceneBoundingRect().topLeft()); m_sketchWidget->scene()->addItem(m_displayItem); @@ -961,7 +962,7 @@ void DRC::extendBorder(const double keepout, QImage * image) { const int x1 = std::max(x - ikeepout, 0); const int x2 = std::min(x + ikeepout, w); // extend border by keepout - int dx; + auto dx = 0; for (int dy = y1; dy < y2; ++dy) { uchar * r = image->scanLine(dy); // This section is often the hotspot for creating copper layers, @@ -986,7 +987,7 @@ void DRC::checkHoles(QStringList & messages, QList & colliding QRectF boardRect = m_board->sceneBoundingRect(); foreach (QGraphicsItem * item, m_sketchWidget->scene()->collidingItems(m_board)) { NonConnectorItem * nci = dynamic_cast(item); - if (nci == nullptr) continue; + if (!nci) continue; QRectF ncibr = nci->sceneBoundingRect(); if (boardRect.contains(ncibr)) continue; @@ -1032,7 +1033,7 @@ void DRC::checkCopperBoth(QStringList & messages, QList & coll QList visited; foreach (QGraphicsItem * item, m_sketchWidget->scene()->items()) { ItemBase * itemBase = dynamic_cast(item); - if (itemBase == nullptr) continue; + if (!itemBase) continue; if (!itemBase->isEverVisible()) continue; if (itemBase->modelPart()->isCore()) continue; @@ -1070,8 +1071,8 @@ void DRC::checkCopperBoth(QStringList & messages, QList & coll QDomDocument doc; QString errorStr; - int errorLine; - int errorColumn; + auto errorLine = 0; + auto errorColumn = 0; if (!doc.setContent(svg, &errorStr, &errorLine, &errorColumn)) { DebugDialog::debug(QString("itembase svg xml failure %1 %2 %3 %4").arg(itemBase->id()).arg(errorStr).arg(errorLine).arg(errorColumn)); continue; @@ -1134,7 +1135,7 @@ QList DRC::missingCopper(const QString & layerName, ViewLayer:: foreach (ConnectorItem * connectorItem, itemBase->cachedConnectorItems()) { SvgIdLayer * svgIdLayer = connectorItem->connector()->fullPinInfo(itemBase->viewID(), viewLayerID); - if (svgIdLayer == nullptr) { + if (!svgIdLayer) { DebugDialog::debug(QString("missing pin info for %1").arg(itemBase->id())); missing << connectorItem; continue; diff --git a/src/autoroute/drc.h b/src/autoroute/drc.h index b9c9f0d27..634ee343b 100644 --- a/src/autoroute/drc.h +++ b/src/autoroute/drc.h @@ -54,7 +54,7 @@ class DRC : public QObject public: DRC(class PCBSketchWidget *, class ItemBase * board); - virtual ~DRC(void); + virtual ~DRC(); QStringList start(bool showOkMessage, double keepoutMils); From 604a89da712d2c135dcb4ab1314c160f3d0cfce6 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 15:19:07 -0800 Subject: [PATCH 20/61] Fix compilation errors --- src/autoroute/drc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autoroute/drc.cpp b/src/autoroute/drc.cpp index 866c9255a..2a0e2292c 100644 --- a/src/autoroute/drc.cpp +++ b/src/autoroute/drc.cpp @@ -224,7 +224,7 @@ static QString CancelledMessage; /////////////////////////////////////////// DRC::DRC(PCBSketchWidget * sketchWidget, ItemBase * board) : - m_sketchWidget(widget), + m_sketchWidget(sketchWidget), m_board(board), m_keepout(0.0), m_plusImage(nullptr), From 972ee1b7a48696e954aa7c5264d63dd628481d1b Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 15:21:05 -0800 Subject: [PATCH 21/61] Forward declare classes --- src/autoroute/drc.cpp | 2 +- src/autoroute/drc.h | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/autoroute/drc.cpp b/src/autoroute/drc.cpp index 2a0e2292c..683516c02 100644 --- a/src/autoroute/drc.cpp +++ b/src/autoroute/drc.cpp @@ -237,7 +237,7 @@ DRC::DRC(PCBSketchWidget * sketchWidget, ItemBase * board) : CancelledMessage = tr("DRC was cancelled."); } -DRC::~DRC(void) +DRC::~DRC() { if (m_displayItem) { delete m_displayItem; diff --git a/src/autoroute/drc.h b/src/autoroute/drc.h index 634ee343b..63b7e598b 100644 --- a/src/autoroute/drc.h +++ b/src/autoroute/drc.h @@ -48,18 +48,21 @@ struct Markers { QString outID; }; +class PCBSketchWidget; +class ItemBase; +class ConnectorItem; class DRC : public QObject { Q_OBJECT public: - DRC(class PCBSketchWidget *, class ItemBase * board); + DRC(PCBSketchWidget *, ItemBase * board); virtual ~DRC(); QStringList start(bool showOkMessage, double keepoutMils); public: - static void splitNetPrep(QDomDocument * masterDoc, QList & equi, const Markers &, QList & net, QList & alsoNet, QList & notNet, bool checkIntersection); + static void splitNetPrep(QDomDocument * masterDoc, QList & equi, const Markers &, QList & net, QList & alsoNet, QList & notNet, bool checkIntersection); static void extendBorder(double keepoutImagePixels, QImage * image); public slots: @@ -97,8 +100,8 @@ public slots: static void splitSubs(QDomDocument *, QDomElement & root, const QString & partID, const Markers &, const QStringList & svgIDs, const QStringList & terminalIDs, const QList &, QHash & both, bool checkIntersection); protected: - class PCBSketchWidget * m_sketchWidget; - class ItemBase * m_board; + PCBSketchWidget * m_sketchWidget; + ItemBase * m_board; double m_keepout; QImage * m_plusImage; QImage * m_minusImage; From 2b97574de73533076160d5b0d7922d920836db35 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 15:33:50 -0800 Subject: [PATCH 22/61] More severity 1 violation fixes --- src/autoroute/mazerouter/mazerouter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/autoroute/mazerouter/mazerouter.cpp b/src/autoroute/mazerouter/mazerouter.cpp index 06484e0ac..8a06804e3 100644 --- a/src/autoroute/mazerouter/mazerouter.cpp +++ b/src/autoroute/mazerouter/mazerouter.cpp @@ -511,6 +511,8 @@ MazeRouter::MazeRouter(PCBSketchWidget * sketchWidget, QGraphicsItem * board, bo m_spareImage(nullptr), m_spareImage2(nullptr), m_temporaryBoard(false), + m_costFunction(nullptr), + m_jumperWillFitFunction(nullptr), m_grid(nullptr), m_cleanupCount(0), m_netLabelIndex(-1), @@ -2586,7 +2588,7 @@ ConnectorItem * MazeRouter::findAnchor(GridPoint gp, const QRectF & gridRect, Tr double d0 = GraphicsUtils::distanceSqd(p0, center); double d1 = GraphicsUtils::distanceSqd(p1, center); double dx, dy, distanceSegment; - bool atEndpoint; + bool atEndpoint = false; GraphicsUtils::distanceFromLine(center.x(), center.y(), p0.x(), p0.y(), p1.x(), p1.y(), dx, dy, distanceSegment, atEndpoint); if (atEndpoint) { DebugDialog::debug("at endpoint shouldn't happen"); From 6203c5797530a57b8903f8b137e4e32e13b992fa Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 15:44:31 -0800 Subject: [PATCH 23/61] Cleanup connectoritem to use nullptr and intialize everything --- src/connectors/connectoritem.cpp | 273 +++++++++++++++---------------- src/connectors/connectoritem.h | 36 ++-- 2 files changed, 152 insertions(+), 157 deletions(-) diff --git a/src/connectors/connectoritem.cpp b/src/connectors/connectoritem.cpp index 90e82678a..427278c6e 100644 --- a/src/connectors/connectoritem.cpp +++ b/src/connectors/connectoritem.cpp @@ -229,7 +229,7 @@ parts editor support ///////////////////////////////////////////////////////// static Bezier UndoBezier; -static BezierDisplay * TheBezierDisplay = NULL; +static BezierDisplay * TheBezierDisplay = nullptr; static const double StandardLegConnectorDrawEnabledLength = 5; // pixels static const double StandardLegConnectorDetectLength = 9; // pixels @@ -287,14 +287,14 @@ QColor addColor(QColor & color, int offset) ///////////////////////////////////////////////////////////// ConnectorItemAction::ConnectorItemAction(QAction * action) : QAction(action) { - m_connectorItem = NULL; + m_connectorItem = nullptr; this->setText(action->text()); this->setStatusTip(action->statusTip()); this->setCheckable(action->isCheckable()); } ConnectorItemAction::ConnectorItemAction(const QString & title, QObject * parent) : QAction(title, parent) { - m_connectorItem = NULL; + m_connectorItem = nullptr; } void ConnectorItemAction::setConnectorItem(ConnectorItem * c) { @@ -308,18 +308,13 @@ ConnectorItem * ConnectorItemAction::connectorItem() { ///////////////////////////////////////////////////////// ConnectorItem::ConnectorItem( Connector * connector, ItemBase * attachedTo ) - : NonConnectorItem(attachedTo) + : NonConnectorItem(attachedTo), + m_connector(connector), + m_overConnectorItem(nullptr) { // initialize m_connectorT, otherwise will trigger qWarning("QLine::unitVector: New line does not have unit length"); // TODO: figure out why paint is being called with m_connectorT not initialized - m_groundFillSeed = false; - m_connectorDetectT = m_connectorDrawT = 0; - m_draggingCurve = m_draggingLeg = m_rubberBandLeg = m_bigDot = m_hybrid = false; - m_hoverEnterSpaceBarWasPressed = m_spaceBarWasPressed = false; - m_overConnectorItem = NULL; - m_connectorHovering = false; - m_connector = connector; - if (connector != NULL) { + if (connector) { connector->addViewItem(this); } setAcceptHoverEvents(true); @@ -334,12 +329,12 @@ ConnectorItem::~ConnectorItem() { m_equalPotentialDisplayItems.removeOne(this); //DebugDialog::debug(QString("deleting connectorItem %1").arg((long) this, 0, 16)); foreach (ConnectorItem * connectorItem, m_connectedTo) { - if (connectorItem != NULL) { + if (connectorItem) { //DebugDialog::debug(QString("temp remove %1 %2").arg(this->attachedToID()).arg(connectorItem->attachedToID())); connectorItem->tempRemove(this, this->attachedToID() != connectorItem->attachedToID()); } } - if (this->connector() != NULL) { + if (this->connector()) { this->connector()->removeViewItem(this); } clearCurves(); @@ -364,7 +359,7 @@ void ConnectorItem::hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) { */ InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL && infoGraphicsView->spaceBarIsPressed()) { + if (infoGraphicsView && infoGraphicsView->spaceBarIsPressed()) { m_hoverEnterSpaceBarWasPressed = true; event->ignore(); return; @@ -375,14 +370,14 @@ void ConnectorItem::hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) { bool setDefaultCursor = true; m_hoverEnterSpaceBarWasPressed = false; setHoverColor(); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->hoverEnterConnectorItem(event, this); if (m_rubberBandLeg) { updateLegCursor(event->pos(), event->modifiers()); setDefaultCursor = false; } } - if (this->m_attachedTo != NULL) { + if (this->m_attachedTo) { if (this->attachedToItemType() == ModelPart::Wire) { updateWireCursor(event->modifiers()); setDefaultCursor = false; @@ -402,13 +397,13 @@ void ConnectorItem::hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) { QList visited; restoreColor(visited); InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->hoverLeaveConnectorItem(event, this); } CursorMaster::instance()->removeCursor(this); - if (this->m_attachedTo != NULL) { + if (this->m_attachedTo) { m_attachedTo->hoverLeaveConnectorItem(event, this); } @@ -422,7 +417,7 @@ void ConnectorItem::hoverMoveEvent ( QGraphicsSceneHoverEvent * event ) { return; } - if (this->m_attachedTo != NULL) { + if (this->m_attachedTo) { m_attachedTo->hoverMoveConnectorItem(event, this); } @@ -448,7 +443,7 @@ void ConnectorItem::connectorHover(ItemBase * itemBase, bool hovering) { QList visited; restoreColor(visited); } - if (this->m_attachedTo != NULL) { + if (this->m_attachedTo) { m_attachedTo->connectorHover(this, itemBase, hovering); } } @@ -464,7 +459,7 @@ void ConnectorItem::connectTo(ConnectorItem * connected) { //DebugDialog::debug(QString("connect to cc:%4 this:%1 to:%2 %3").arg((long) this, 0, 16).arg((long) connected, 0, 16).arg(connected->attachedTo()->modelPartShared()->title()).arg(m_connectedTo.count()) ); QList visited; restoreColor(visited); - if (m_attachedTo != NULL) { + if (m_attachedTo) { m_attachedTo->connectionChange(this, connected, true); } } @@ -475,7 +470,7 @@ ConnectorItem * ConnectorItem::removeConnection(ItemBase * itemBase) { if (m_connectedTo[i]->attachedTo() == itemBase) { ConnectorItem * removed = m_connectedTo[i]; m_connectedTo.removeAt(i); - if (m_attachedTo != NULL) { + if (m_attachedTo) { m_attachedTo->connectionChange(this, removed, false); } restoreColor(visited); @@ -487,11 +482,11 @@ ConnectorItem * ConnectorItem::removeConnection(ItemBase * itemBase) { } } - return NULL; + return nullptr; } void ConnectorItem::removeConnection(ConnectorItem * connectedItem, bool emitChange) { - if (connectedItem == NULL) return; + if (!connectedItem) return; m_connectedTo.removeOne(connectedItem); QList visited; @@ -579,7 +574,7 @@ void ConnectorItem::restoreColor(QList & visited) } void ConnectorItem::setConnectedColor() { - if (m_attachedTo == NULL) return; + if (!m_attachedTo) return; QBrush brush; QPen pen; @@ -589,7 +584,7 @@ void ConnectorItem::setConnectedColor() { } void ConnectorItem::setNormalColor() { - if (m_attachedTo == NULL) return; + if (!m_attachedTo) return; QBrush brush; QPen pen; @@ -599,7 +594,7 @@ void ConnectorItem::setNormalColor() { } void ConnectorItem::setUnconnectedColor() { - if (m_attachedTo == NULL) return; + if (!m_attachedTo) return; QBrush brush; QPen pen; @@ -609,7 +604,7 @@ void ConnectorItem::setUnconnectedColor() { } void ConnectorItem::setHoverColor() { - if (m_attachedTo == NULL) return; + if (!m_attachedTo) return; QBrush brush; QPen pen; @@ -655,10 +650,10 @@ void ConnectorItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { m_draggingCurve = false; if (TheBezierDisplay) { delete TheBezierDisplay; - TheBezierDisplay = NULL; + TheBezierDisplay = nullptr; } - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->prepLegCurveChange(this, m_draggingLegIndex, &UndoBezier, m_legCurves.at(m_draggingLegIndex), false); } @@ -668,7 +663,7 @@ void ConnectorItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (m_oldPolygon.count() < m_legPolygon.count()) { // we inserted a bendpoint InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->prepLegBendpointChange( this, m_oldPolygon.count(), @@ -685,17 +680,17 @@ void ConnectorItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { } bool changeConnections = m_draggingLegIndex == m_legPolygon.count() - 1; - if (to != NULL && changeConnections) { + if (to && changeConnections) { // center endpoint in the target connectorItem - reposition(to->sceneAdjustedTerminalPoint(NULL), m_draggingLegIndex); + reposition(to->sceneAdjustedTerminalPoint(nullptr), m_draggingLegIndex); } - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->prepLegBendpointMove(this, m_draggingLegIndex, mapToScene(m_oldPolygon.at(m_draggingLegIndex)), mapToScene(m_legPolygon.at(m_draggingLegIndex)), to, changeConnections); } return; } - if (this->m_attachedTo != NULL && m_attachedTo->acceptsMouseReleaseConnectorEvent(this, event)) { + if (this->m_attachedTo && m_attachedTo->acceptsMouseReleaseConnectorEvent(this, event)) { m_attachedTo->mouseReleaseConnectorEvent(this, event); return; } @@ -723,7 +718,7 @@ void ConnectorItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { return; } - if (this->m_attachedTo != NULL && m_attachedTo->acceptsMouseDoubleClickConnectorEvent(this, event)) { + if (this->m_attachedTo && m_attachedTo->acceptsMouseDoubleClickConnectorEvent(this, event)) { m_attachedTo->mouseDoubleClickConnectorEvent(this); return; } @@ -736,7 +731,7 @@ void ConnectorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { if (m_rubberBandLeg && m_draggingLeg) { if (m_draggingCurve) { Bezier * bezier = m_legCurves.at(m_draggingLegIndex); - if (bezier != NULL && !bezier->isEmpty()) { + if (bezier && !bezier->isEmpty()) { prepareGeometryChange(); bezier->recalc(event->pos()); calcConnectorEnd(); @@ -792,7 +787,7 @@ void ConnectorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { return; } - if (this->m_attachedTo != NULL && m_attachedTo->acceptsMouseMoveConnectorEvent(this, event)) { + if (this->m_attachedTo && m_attachedTo->acceptsMouseMoveConnectorEvent(this, event)) { m_attachedTo->mouseMoveConnectorEvent(this, event); return; } @@ -817,7 +812,7 @@ void ConnectorItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { clearEqualPotentialDisplay(); InfoGraphicsView *infographics = InfoGraphicsView::getInfoGraphicsView(this); - if (infographics != NULL && infographics->spaceBarIsPressed()) { + if (infographics && infographics->spaceBarIsPressed()) { event->ignore(); return; } @@ -832,11 +827,11 @@ void ConnectorItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { //connectorItem->debugInfo("display eqp"); } - if (m_rubberBandLeg && this->m_attachedTo != NULL && m_attachedTo->acceptsMousePressLegEvent(this, event)) { + if (m_rubberBandLeg && this->m_attachedTo && m_attachedTo->acceptsMousePressLegEvent(this, event)) { if (legMousePressEvent(event)) return; } - if (this->m_attachedTo != NULL && m_attachedTo->acceptsMousePressConnectorEvent(this, event)) { + if (this->m_attachedTo && m_attachedTo->acceptsMousePressConnectorEvent(this, event)) { m_attachedTo->mousePressConnectorEvent(this, event); return; } @@ -863,7 +858,7 @@ void ConnectorItem::attachedMoved(bool includeRatsnest, QList & allTo.remove(this); foreach (ConnectorItem * toConnectorItem, allTo) { ItemBase * itemBase = toConnectorItem->attachedTo(); - if (itemBase == NULL) continue; + if (!itemBase) continue; if (!itemBase->isVisible()) { //this->debugInfo("continue"); //itemBase->debugInfo(" "); @@ -878,7 +873,7 @@ void ConnectorItem::attachedMoved(bool includeRatsnest, QList & } ConnectorItem * ConnectorItem::firstConnectedToIsh() { - if (m_connectedTo.count() <= 0) return NULL; + if (m_connectedTo.count() <= 0) return nullptr; foreach (ConnectorItem * connectorItem, m_connectedTo) { if (connectorItem->attachedTo()->getRatsnest()) continue; @@ -896,7 +891,7 @@ ConnectorItem * ConnectorItem::firstConnectedToIsh() { return connectorItem; } - return NULL; + return nullptr; } void ConnectorItem::setTerminalPoint(QPointF p) { @@ -917,10 +912,10 @@ QPointF ConnectorItem::adjustedTerminalPoint() { QPointF ConnectorItem::sceneAdjustedTerminalPoint(ConnectorItem * connectee) { - if ((connectee != NULL) && !m_circular && !m_shape.isEmpty() && (connectee->attachedToItemType() == ModelPart::Wire)) { + if (connectee && !m_circular && !m_shape.isEmpty() && (connectee->attachedToItemType() == ModelPart::Wire)) { Wire * wire = qobject_cast(connectee->attachedTo()); - if ((wire != NULL) && !wire->getRatsnest()) { - QPointF anchor = wire->otherConnector(connectee)->sceneAdjustedTerminalPoint(NULL); + if (wire && !wire->getRatsnest()) { + QPointF anchor = wire->otherConnector(connectee)->sceneAdjustedTerminalPoint(nullptr); double newX = 0, newY = 0, newDistance = MAX_DOUBLE; int count = m_shape.elementCount(); @@ -1019,79 +1014,79 @@ void ConnectorItem::setOverConnectorItem(ConnectorItem * connectorItem) { const QString & ConnectorItem::connectorSharedID() { - if (m_connector == NULL) return ___emptyString___; + if (!m_connector) return ___emptyString___; return m_connector->connectorSharedID(); } const QString & ConnectorItem::connectorSharedReplacedby() { - if (m_connector == NULL) return ___emptyString___; + if (!m_connector) return ___emptyString___; return m_connector->connectorSharedReplacedby(); } ErcData * ConnectorItem::connectorSharedErcData() { - if (m_connector == NULL) return NULL; + if (!m_connector) return nullptr; return m_connector->connectorSharedErcData(); } const QString & ConnectorItem::connectorSharedName() { - if (m_connector == NULL) return ___emptyString___; + if (!m_connector) return ___emptyString___; return m_connector->connectorSharedName(); } const QString & ConnectorItem::connectorSharedDescription() { - if (m_connector == NULL) return ___emptyString___; + if (!m_connector) return ___emptyString___; return m_connector->connectorSharedDescription(); } const QString & ConnectorItem::busID() { - if (m_connector == NULL) return ___emptyString___; + if (!m_connector) return ___emptyString___; return m_connector->busID(); } ModelPartShared * ConnectorItem::modelPartShared() { - if (m_attachedTo == NULL) return NULL; + if (!m_attachedTo) return nullptr; return m_attachedTo->modelPartShared(); } ModelPart * ConnectorItem::modelPart() { - if (m_attachedTo == NULL) return NULL; + if (!m_attachedTo) return nullptr; return m_attachedTo->modelPart(); } Bus * ConnectorItem::bus() { - if (m_connector == NULL) return NULL; + if (!m_connector) return nullptr; return m_connector->bus(); } ViewLayer::ViewLayerID ConnectorItem::attachedToViewLayerID() { - if (m_attachedTo == NULL) return ViewLayer::UnknownLayer; + if (!m_attachedTo) return ViewLayer::UnknownLayer; return m_attachedTo->viewLayerID(); } ViewLayer::ViewLayerPlacement ConnectorItem::attachedToViewLayerPlacement() { - if (m_attachedTo == NULL) return ViewLayer::UnknownPlacement; + if (!m_attachedTo) return ViewLayer::UnknownPlacement; return m_attachedTo->viewLayerPlacement(); } ViewLayer::ViewID ConnectorItem::attachedToViewID() { - if (m_attachedTo == NULL) return ViewLayer::UnknownView; + if (!m_attachedTo) return ViewLayer::UnknownView; return m_attachedTo->viewID(); } Connector::ConnectorType ConnectorItem::connectorType() { - if (m_connector == NULL) return Connector::Unknown; + if (!m_connector) return Connector::Unknown; return m_connector->connectorType(); } @@ -1135,7 +1130,7 @@ void ConnectorItem::saveInstance(QXmlStreamWriter & writer) { writer.writeEndElement(); Bezier * bezier = m_legCurves.at(i); - if (bezier == NULL) { + if (!bezier) { writer.writeStartElement("bezier"); writer.writeEndElement(); } @@ -1189,7 +1184,7 @@ Wire * ConnectorItem::directlyWiredTo(ConnectorItem * source, ConnectorItem * ta } Wire * ConnectorItem::directlyWiredToAux(ConnectorItem * source, ConnectorItem * target, ViewGeometry::WireFlags flags, QList & visited) { - if (visited.contains(source)) return NULL; + if (visited.contains(source)) return nullptr; QList equals; equals << source; @@ -1206,7 +1201,7 @@ Wire * ConnectorItem::directlyWiredToAux(ConnectorItem * source, ConnectorItem * foreach (ConnectorItem * fromItem, equals) { foreach (ConnectorItem * toConnectorItem, fromItem->m_connectedTo) { ItemBase * toItem = toConnectorItem->attachedTo(); - if (toItem == NULL) { + if (!toItem) { continue; // shouldn't happen } @@ -1238,7 +1233,7 @@ Wire * ConnectorItem::directlyWiredToAux(ConnectorItem * source, ConnectorItem * } } - return NULL; + return nullptr; } bool ConnectorItem::isConnectedToPart() { @@ -1249,7 +1244,7 @@ bool ConnectorItem::isConnectedToPart() { ConnectorItem * thisCrossConnectorItem = this->getCrossLayerConnectorItem(); QList busConnectedItems; Bus * b = bus(); - if (b != NULL) { + if (b) { attachedTo()->busConnectorItems(b, this, busConnectedItems); } @@ -1280,7 +1275,7 @@ bool ConnectorItem::isConnectedToPart() { } ConnectorItem * crossConnectorItem = connectorItem->getCrossLayerConnectorItem(); - if (crossConnectorItem != NULL) { + if (crossConnectorItem) { if (!tempItems.contains(crossConnectorItem)) { tempItems.append(crossConnectorItem); } @@ -1293,7 +1288,7 @@ bool ConnectorItem::isConnectedToPart() { } Bus * bus = connectorItem->bus(); - if (bus != NULL) { + if (bus) { QList busConnectedItems; connectorItem->attachedTo()->busConnectorItems(bus, connectorItem, busConnectedItems); foreach (ConnectorItem * busConnectedItem, busConnectedItems) { @@ -1320,8 +1315,8 @@ void ConnectorItem::collectEqualPotential(QList & connectorItem ConnectorItem * connectorItem = tempItems[i]; //connectorItem->debugInfo("testing eqp"); - Wire * fromWire = (connectorItem->attachedToItemType() == ModelPart::Wire) ? qobject_cast(connectorItem->attachedTo()) : NULL; - if (fromWire != NULL) { + Wire * fromWire = (connectorItem->attachedToItemType() == ModelPart::Wire) ? qobject_cast(connectorItem->attachedTo()) : nullptr; + if (fromWire) { if (fromWire->hasAnyFlag(skipFlags)) { // don't add this kind of wire continue; @@ -1330,7 +1325,7 @@ void ConnectorItem::collectEqualPotential(QList & connectorItem else { if (crossLayers) { ConnectorItem * crossConnectorItem = connectorItem->getCrossLayerConnectorItem(); - if (crossConnectorItem != NULL) { + if (crossConnectorItem) { if (!tempItems.contains(crossConnectorItem)) { tempItems.append(crossConnectorItem); } @@ -1345,7 +1340,7 @@ void ConnectorItem::collectEqualPotential(QList & connectorItem foreach (ConnectorItem * cto, connectorItem->connectedToItems()) { if (tempItems.contains(cto)) continue; - if ((skipFlags & ViewGeometry::NormalFlag) && (fromWire == NULL) && (cto->attachedToItemType() != ModelPart::Wire)) { + if ((skipFlags & ViewGeometry::NormalFlag) && (!fromWire) && (cto->attachedToItemType() != ModelPart::Wire)) { // direct (part-to-part) connections not allowed continue; } @@ -1354,7 +1349,7 @@ void ConnectorItem::collectEqualPotential(QList & connectorItem } Bus * bus = connectorItem->bus(); - if (bus != NULL) { + if (bus) { QList busConnectedItems; connectorItem->attachedTo()->busConnectorItems(bus, connectorItem, busConnectedItems); #ifndef QT_NO_DEBUG @@ -1418,7 +1413,7 @@ void ConnectorItem::collectPart(ConnectorItem * connectorItem, QListgetCrossLayerConnectorItem(); - if (crossConnectorItem != NULL) { + if (crossConnectorItem) { if (partsConnectors.contains(crossConnectorItem)) { return; } @@ -1524,7 +1519,7 @@ void ConnectorItem::updateTooltip() { } void ConnectorItem::clearConnector() { - m_connector = NULL; + m_connector = nullptr; } @@ -1569,10 +1564,10 @@ bool ConnectorItem::isEverVisible() { bool ConnectorItem::isGrounded(ConnectorItem * c1, ConnectorItem * c2) { QList connectorItems; - if (c1 != NULL) { + if (c1) { connectorItems.append(c1); } - if (c2 != NULL) { + if (c2) { connectorItems.append(c2); } collectEqualPotential(connectorItems, true, ViewGeometry::NoFlag); @@ -1595,9 +1590,9 @@ bool ConnectorItem::isGrounded() { } ConnectorItem * ConnectorItem::getCrossLayerConnectorItem() { - if (m_connector == NULL) return NULL; - if (m_attachedTo == NULL) return NULL; - if (m_attachedTo->viewID() != ViewLayer::PCBView) return NULL; + if (!m_connector) return nullptr; + if (!m_attachedTo) return nullptr; + if (m_attachedTo->viewID() != ViewLayer::PCBView) return nullptr; ViewLayer::ViewLayerID viewLayerID = attachedToViewLayerID(); if (viewLayerID == ViewLayer::Copper0) { @@ -1607,7 +1602,7 @@ ConnectorItem * ConnectorItem::getCrossLayerConnectorItem() { return m_connector->connectorItemByViewLayerID(this->attachedToViewID(), ViewLayer::Copper0); } - return NULL; + return nullptr; } bool ConnectorItem::isInLayers(ViewLayer::ViewLayerPlacement viewLayerPlacement) { @@ -1615,7 +1610,7 @@ bool ConnectorItem::isInLayers(ViewLayer::ViewLayerPlacement viewLayerPlacement) } bool ConnectorItem::isCrossLayerConnectorItem(ConnectorItem * candidate) { - if (candidate == NULL) return false; + if (!candidate) return false; ConnectorItem * cross = getCrossLayerConnectorItem(); return cross == candidate; @@ -1665,7 +1660,7 @@ void ConnectorItem::paintLeg(QPainter * painter) bool hasCurves = false; foreach (Bezier * bezier, m_legCurves) { - if (bezier != NULL && !bezier->isEmpty()) { + if (bezier && !bezier->isEmpty()) { hasCurves = true; break; } @@ -1697,7 +1692,7 @@ void ConnectorItem::paintLeg(QPainter * painter) // now draw the connector Bezier * bezier = m_legCurves.at(m_legCurves.count() - 2); - bool connectorIsCurved = (bezier != NULL && !bezier->isEmpty()); + bool connectorIsCurved = (bezier && !bezier->isEmpty()); Bezier left, right; QPainterPath path; if (connectorIsCurved) { @@ -1756,7 +1751,7 @@ void ConnectorItem::paintLeg(QPainter * painter, bool hasCurves) ConnectorItem * ConnectorItem::chooseFromSpec(ViewLayer::ViewLayerPlacement viewLayerPlacement) { ConnectorItem * crossConnectorItem = getCrossLayerConnectorItem(); - if (crossConnectorItem == NULL) return this; + if (!crossConnectorItem) return this; ViewLayer::ViewLayerID basis = ViewLayer::Copper0; switch (viewLayerPlacement) { @@ -1789,7 +1784,7 @@ bool ConnectorItem::connectedToWires() { } ConnectorItem * crossConnectorItem = getCrossLayerConnectorItem(); - if (crossConnectorItem == NULL) return false; + if (!crossConnectorItem) return false; foreach (ConnectorItem * toConnectorItem, crossConnectorItem->connectedToItems()) { if (toConnectorItem->attachedToItemType() == ModelPart::Wire) { @@ -1805,16 +1800,16 @@ void ConnectorItem::displayRatsnest(QList & partConnectorItems, bool gotFormerColor = false; QColor formerColor; - VirtualWire * vw = NULL; + VirtualWire * vw = nullptr; foreach (ConnectorItem * fromConnectorItem, partConnectorItems) { foreach (ConnectorItem * toConnectorItem, fromConnectorItem->connectedToItems()) { vw = qobject_cast(toConnectorItem->attachedTo()); - if (vw != NULL) break; + if (vw) break; } - if (vw != NULL) break; + if (vw) break; } - if (vw != NULL) { + if (vw) { formerColorWasNamed = vw->colorWasNamed(); formerColor = vw->color(); gotFormerColor = true; @@ -1822,7 +1817,7 @@ void ConnectorItem::displayRatsnest(QList & partConnectorItems, } InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView == NULL) return; + if (!infoGraphicsView) return; if (partConnectorItems.count() < 2) return; @@ -1856,11 +1851,11 @@ void ConnectorItem::clearRatsnestDisplay(QList & connectorItems QSet ratsnests; foreach (ConnectorItem * fromConnectorItem, connectorItems) { - if (fromConnectorItem == NULL) continue; + if (!fromConnectorItem) continue; foreach (ConnectorItem * toConnectorItem, fromConnectorItem->connectedToItems()) { VirtualWire * vw = qobject_cast(toConnectorItem->attachedTo()); - if (vw != NULL) { + if (vw) { ratsnests.insert(vw); } } @@ -1868,13 +1863,13 @@ void ConnectorItem::clearRatsnestDisplay(QList & connectorItems foreach (VirtualWire * vw, ratsnests.values()) { ConnectorItem * c1 = vw->connector0()->firstConnectedToIsh(); - if (c1 != NULL) { + if (c1) { vw->connector0()->tempRemove(c1, false); c1->tempRemove(vw->connector0(), false); } ConnectorItem * c2 = vw->connector1()->firstConnectedToIsh(); - if (c2 != NULL) { + if (c2) { vw->connector1()->tempRemove(c2, false); c2->tempRemove(vw->connector1(), false); } @@ -1917,7 +1912,7 @@ void ConnectorItem::debugInfo(const QString & msg) { #ifndef QT_NO_DEBUG - QPointF p = sceneAdjustedTerminalPoint(NULL); + QPointF p = sceneAdjustedTerminalPoint(nullptr); QString s = QString("%1 cid:%2 cname:%3 title:%4 id:%5 type:%6 inst:%7 vlid:%8 vid:%9 spec:%10 flg:%11 hy:%12 bus:%13 r:%14 sw:%15 pos:(%16 %17)") .arg(msg) .arg(this->connectorSharedID()) @@ -1952,14 +1947,14 @@ double ConnectorItem::minDimension() { ConnectorItem * ConnectorItem::findConnectorUnder(bool useTerminalPoint, bool allowAlready, const QList & exclude, bool displayDragTooltip, ConnectorItem * other) { QList items = useTerminalPoint - ? this->scene()->items(this->sceneAdjustedTerminalPoint(NULL)) + ? this->scene()->items(this->sceneAdjustedTerminalPoint(nullptr)) : this->scene()->items(mapToScene(this->rect())); // only wires use rect QList candidates; // for the moment, take the topmost ConnectorItem that doesn't belong to me foreach (QGraphicsItem * item, items) { ConnectorItem * connectorItemUnder = dynamic_cast(item); - if (connectorItemUnder == NULL) continue; - if (connectorItemUnder->connector() == NULL) continue; // shouldn't happen + if (!connectorItemUnder) continue; + if (!connectorItemUnder->connector()) continue; // shouldn't happen if (attachedTo()->childItems().contains(connectorItemUnder)) continue; // don't use own connectors if (!this->connectionIsAllowed(connectorItemUnder)) { continue; @@ -1975,7 +1970,7 @@ ConnectorItem * ConnectorItem::findConnectorUnder(bool useTerminalPoint, bool al candidates.append(connectorItemUnder); } - ConnectorItem * candidate = NULL; + ConnectorItem * candidate = nullptr; if (candidates.count() == 1) { candidate = candidates[0]; } @@ -1984,23 +1979,23 @@ ConnectorItem * ConnectorItem::findConnectorUnder(bool useTerminalPoint, bool al candidate = candidates[0]; } - if (m_overConnectorItem != NULL && candidate != m_overConnectorItem) { - m_overConnectorItem->connectorHover(NULL, false); + if (m_overConnectorItem&& candidate != m_overConnectorItem) { + m_overConnectorItem->connectorHover(nullptr, false); } - if (candidate != NULL && candidate != m_overConnectorItem) { - candidate->connectorHover(NULL, true); + if (candidate && candidate != m_overConnectorItem) { + candidate->connectorHover(nullptr, true); } m_overConnectorItem = candidate; - if (candidate == NULL) { + if (!candidate) { if (this->connectorHovering()) { - this->connectorHover(NULL, false); + this->connectorHover(nullptr, false); } } else { if (!this->connectorHovering()) { - this->connectorHover(NULL, true); + this->connectorHover(nullptr, true); } } @@ -2014,7 +2009,7 @@ ConnectorItem * ConnectorItem::findConnectorUnder(bool useTerminalPoint, bool al void ConnectorItem::displayTooltip(ConnectorItem * ci, ConnectorItem * other) { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView == NULL) return; + if (!infoGraphicsView) return; // Activate tooltip for destination connector. based on a patch submitted by bryant.mairs QString text; @@ -2055,11 +2050,11 @@ void ConnectorItem::displayTooltip(ConnectorItem * ci, ConnectorItem * other) ConnectorItem * ConnectorItem::releaseDrag() { ConnectorItem * result = m_overConnectorItem; - if (m_overConnectorItem != NULL) { - m_overConnectorItem->connectorHover(NULL, false); + if (m_overConnectorItem) { + m_overConnectorItem->connectorHover(nullptr, false); // clean up - setOverConnectorItem(NULL); + setOverConnectorItem(nullptr); clearConnectorHover(); QList visited; restoreColor(visited); @@ -2077,7 +2072,7 @@ void ConnectorItem::resetLeg(const QPolygonF & poly, bool relative, bool active, { if (!m_rubberBandLeg) return; - ConnectorItem * target = NULL; + ConnectorItem * target = nullptr; foreach (ConnectorItem * connectorItem, this->m_connectedTo) { if (connectorItem->connectorType() == Connector::Female) { target = connectorItem; @@ -2085,7 +2080,7 @@ void ConnectorItem::resetLeg(const QPolygonF & poly, bool relative, bool active, } } - if (target == NULL) { + if (!target) { setLeg(poly, relative, why); return; } @@ -2103,7 +2098,7 @@ void ConnectorItem::resetLeg(const QPolygonF & poly, bool relative, bool active, //DebugDialog::debug("connectorItem prepareGeometryChange 1"); prepareGeometryChange(); - QPointF sceneNewLast = target->sceneAdjustedTerminalPoint(NULL); + QPointF sceneNewLast = target->sceneAdjustedTerminalPoint(nullptr); QPointF sceneOldLast = poly.last(); for (int i = 1; i < m_legPolygon.count(); i++) { @@ -2145,7 +2140,7 @@ QString ConnectorItem::makeLegSvg(QPointF offset, double dpi, double printerScal for (int i = 1; i < m_legPolygon.count(); i++) { QPointF p = m_legPolygon.at(i); Bezier * bezier = m_legCurves.at(i - 1); - if (bezier == NULL || bezier->isEmpty()) { + if (!bezier || bezier->isEmpty()) { data += "L"; data += TextUtils::pointToSvgString(mapToScene(p), offset, dpi, printerScale); } @@ -2234,7 +2229,7 @@ QPainterPath ConnectorItem::shapeAux(double width) const path.moveTo(m_legPolygon.at(0)); for (int i = 1; i < m_legPolygon.count(); i++) { Bezier * bezier = m_legCurves.at(i - 1); - if (bezier != NULL && !bezier->isEmpty()) { + if (bezier && !bezier->isEmpty()) { path.cubicTo(bezier->cp0(), bezier->cp1(), m_legPolygon.at(i)); } else { @@ -2252,7 +2247,7 @@ void ConnectorItem::repositionTarget() // this connector is connected to another part which is being dragged foreach (ConnectorItem * connectorItem, this->m_connectedTo) { if (connectorItem->connectorType() == Connector::Female) { - reposition(connectorItem->sceneAdjustedTerminalPoint(NULL), m_legPolygon.count() - 1); + reposition(connectorItem->sceneAdjustedTerminalPoint(nullptr), m_legPolygon.count() - 1); break; } } @@ -2280,7 +2275,7 @@ void ConnectorItem::repoly(const QPolygonF & poly, bool relative) foreach (QPointF p, poly) { m_legPolygon.append(relative ? p : mapFromScene(p)); - m_legCurves.append(NULL); + m_legCurves.append(nullptr); } //foreach (QPointF p, m_legPolygon) DebugDialog::debug(QString("point a %1 %2").arg(p.x()).arg(p.y())); calcConnectorEnd(); @@ -2302,7 +2297,7 @@ void ConnectorItem::calcConnectorEnd() double detectlen = qMax(0.5, qMin(lineLen, StandardLegConnectorDetectLength)); Bezier * bezier = m_legCurves.at(m_legCurves.count() - 2); - if (bezier == NULL || bezier->isEmpty()) { + if (!bezier || bezier->isEmpty()) { m_connectorDrawEnd = QPointF(p1 - QPointF(dx * drawlen / lineLen, dy * drawlen / lineLen)); m_connectorDetectEnd = QPointF(p1 - QPointF(dx * detectlen / lineLen, dy * detectlen / lineLen)); return; @@ -2372,8 +2367,8 @@ void ConnectorItem::setRubberBandLeg(QColor color, double strokeWidth, QLineF pa setPos(parentLine.p1()); m_legPolygon.append(QPointF(0,0)); m_legPolygon.append(parentLine.p2() - parentLine.p1()); - m_legCurves.append(NULL); - m_legCurves.append(NULL); + m_legCurves.append(nullptr); + m_legCurves.append(nullptr); m_legStrokeWidth = strokeWidth; m_legColor = color; reposition(m_attachedTo->mapToScene(parentLine.p2()), 1); @@ -2414,7 +2409,7 @@ bool ConnectorItem::legMousePressEvent(QGraphicsSceneMouseEvent *event) { } InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->prepLegSelection(this->attachedTo()); } @@ -2436,7 +2431,7 @@ bool ConnectorItem::legMousePressEvent(QGraphicsSceneMouseEvent *event) { if (curvyWiresIndicated(event->modifiers())) { m_draggingLegIndex = bendpointIndex - 1; Bezier * bezier = m_legCurves.at(m_draggingLegIndex); - if (bezier == NULL) { + if (!bezier) { bezier = new Bezier(); m_legCurves.replace(m_draggingLegIndex, bezier); } @@ -2478,7 +2473,7 @@ bool ConnectorItem::legMousePressEvent(QGraphicsSceneMouseEvent *event) { ConnectorItem::CursorLocation ConnectorItem::findLocation(QPointF location, int & bendpointIndex) { QPainterPath path; Bezier * bezier = m_legCurves.at(m_legCurves.count() - 2); - if (bezier == NULL || bezier->isEmpty()) { + if (!bezier || bezier->isEmpty()) { path.moveTo(m_connectorDetectEnd); path.lineTo(m_legPolygon.last()); } @@ -2500,7 +2495,7 @@ ConnectorItem::CursorLocation ConnectorItem::findLocation(QPointF location, int QPainterPath path; path.moveTo(m_legPolygon.at(i)); Bezier * bezier = m_legCurves.at(i); - if (bezier != NULL && !bezier->isEmpty()) { + if (bezier && !bezier->isEmpty()) { path.cubicTo(bezier->cp0(), bezier->cp1(), m_legPolygon.at(i + 1)); } else { @@ -2541,7 +2536,7 @@ void ConnectorItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->setActiveConnectorItem(this); } @@ -2564,7 +2559,7 @@ void ConnectorItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) QAction * addAction = menu.addAction(tr("Add bendpoint")); addAction->setData(1); Bezier * bezier = m_legCurves.at(bendpointIndex - 1); - if (bezier != NULL && !bezier->isEmpty()) { + if (bezier && !bezier->isEmpty()) { QAction * straightenAction = menu.addAction(tr("Straighten curve")); straightenAction->setData(2); } @@ -2575,7 +2570,7 @@ void ConnectorItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } else if (selectedAction->data().toInt() == 2) { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { Bezier newBezier; infoGraphicsView->prepLegCurveChange(this, bendpointIndex - 1,bezier, &newBezier, true); } @@ -2610,7 +2605,7 @@ void ConnectorItem::insertBendpoint(QPointF p, int bendpointIndex) m_oldPolygon = m_legPolygon; insertBendpointAux(p, bendpointIndex); InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->prepLegBendpointChange(this, m_oldPolygon.count(), m_legPolygon.count(), bendpointIndex, p, &UndoBezier, m_legCurves.at(bendpointIndex - 1), m_legCurves.at(bendpointIndex), false); } @@ -2622,9 +2617,9 @@ Bezier * ConnectorItem::insertBendpointAux(QPointF p, int bendpointIndex) { UndoBezier.clear(); m_legPolygon.insert(bendpointIndex, p); - m_legCurves.insert(bendpointIndex, NULL); + m_legCurves.insert(bendpointIndex, nullptr); Bezier * bezier = m_legCurves.at(bendpointIndex - 1); - if (bezier == NULL || bezier->isEmpty()) return NULL; + if (!bezier || bezier->isEmpty()) return nullptr; QPointF p0 = m_legPolygon.at(bendpointIndex - 1); QPointF p1 = m_legPolygon.at(bendpointIndex + 1); @@ -2636,7 +2631,7 @@ Bezier * ConnectorItem::insertBendpointAux(QPointF p, int bendpointIndex) bezier->split(t, left, right); replaceBezier(bendpointIndex - 1, &left); replaceBezier(bendpointIndex, &right); - return NULL; + return nullptr; } void ConnectorItem::removeBendpoint(int bendpointIndex) @@ -2665,7 +2660,7 @@ void ConnectorItem::removeBendpoint(int bendpointIndex) if (bezier) delete bezier; InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView != NULL) { + if (infoGraphicsView) { infoGraphicsView->prepLegBendpointChange(this, m_oldPolygon.count(), m_legPolygon.count(), bendpointIndex, p, &b0, &b1, &b2, false); } @@ -2677,7 +2672,7 @@ void ConnectorItem::removeBendpoint(int bendpointIndex) void ConnectorItem::clearCurves() { foreach (Bezier * bezier, m_legCurves) { - if (bezier != NULL) delete bezier; + if (bezier) delete bezier; } m_legCurves.clear(); } @@ -2696,7 +2691,7 @@ void ConnectorItem::addLegBendpoint(int index, QPointF p, const Bezier * bezierL prepareGeometryChange(); m_legPolygon.insert(index, p); - m_legCurves.insert(index, NULL); + m_legCurves.insert(index, nullptr); replaceBezier(index - 1, bezierLeft); replaceBezier(index, bezierRight); calcConnectorEnd(); @@ -2732,7 +2727,7 @@ const QVector & ConnectorItem::beziers() void ConnectorItem::replaceBezier(int index, const Bezier * newBezier) { Bezier * bezier = m_legCurves.at(index); - if (bezier == NULL && newBezier == NULL) { + if (!bezier && !newBezier) { } else if (bezier && newBezier) { bezier->copy(newBezier); @@ -2774,7 +2769,7 @@ void ConnectorItem::updateWireCursor(Qt::KeyboardModifiers modifiers) if (modifiers & altOrMetaModifier()) { //DebugDialog::debug("uwc alt"); Wire * wire = qobject_cast(attachedTo()); - if (wire != NULL && wire->canChainMultiple()) { + if (wire && wire->canChainMultiple()) { //DebugDialog::debug("uwc make wire"); cursor = *CursorMaster::MakeWireCursor; } @@ -2812,7 +2807,7 @@ void ConnectorItem::updateLegCursor(QPointF p, Qt::KeyboardModifiers modifiers) bool ConnectorItem::curvyWiresIndicated(Qt::KeyboardModifiers modifiers) { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView == NULL) return true; + if (!infoGraphicsView) return true; return infoGraphicsView->curvyWiresIndicated(modifiers); } @@ -2851,7 +2846,7 @@ void ConnectorItem::setGroundFillSeed(bool seed) ViewGeometry::WireFlags ConnectorItem::getSkipFlags() { InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); - if (infoGraphicsView == NULL) return ViewGeometry::RatsnestFlag; + if (!infoGraphicsView) return ViewGeometry::RatsnestFlag; return (ViewGeometry::RatsnestFlag | ViewGeometry::NormalFlag | ViewGeometry::PCBTraceFlag | ViewGeometry::SchematicTraceFlag) ^ infoGraphicsView->getTraceFlag(); } diff --git a/src/connectors/connectoritem.h b/src/connectors/connectoritem.h index e676e6989..04faad5b3 100644 --- a/src/connectors/connectoritem.h +++ b/src/connectors/connectoritem.h @@ -43,7 +43,7 @@ class ConnectorItemAction : public QAction { protected: ConnectorItem * m_connectorItem; }; - +class ItemBase; class ConnectorItem : public NonConnectorItem, public CursorKeyListener { Q_OBJECT @@ -53,7 +53,7 @@ class ConnectorItem : public NonConnectorItem, public CursorKeyListener ~ConnectorItem(); Connector * connector(); - void connectorHover(class ItemBase *, bool hovering); + void connectorHover(ItemBase *, bool hovering); bool connectorHovering(); void clearConnectorHover(); void connectTo(ConnectorItem *); @@ -204,29 +204,29 @@ class ConnectorItem : public NonConnectorItem, public CursorKeyListener QList< QPointer > m_connectedTo; QPointF m_terminalPoint; QPointer m_overConnectorItem; - bool m_connectorHovering; - bool m_spaceBarWasPressed; - bool m_hoverEnterSpaceBarWasPressed; - bool m_hybrid; - bool m_bigDot; - bool m_rubberBandLeg; + bool m_connectorHovering = false; + bool m_spaceBarWasPressed = false; + bool m_hoverEnterSpaceBarWasPressed = false; + bool m_hybrid = false; + bool m_bigDot = false; + bool m_rubberBandLeg = false; QPolygonF m_oldPolygon; - bool m_draggingLeg; - bool m_draggingCurve; - int m_draggingLegIndex; - bool m_activeStretch; + bool m_draggingLeg = false; + bool m_draggingCurve = false; + int m_draggingLegIndex = 0; + bool m_activeStretch = false; QPointF m_holdPos; QPolygonF m_legPolygon; QVector m_legCurves; - double m_legStrokeWidth; + double m_legStrokeWidth = 0.0; QColor m_legColor; - bool m_insertBendpointPossible; + bool m_insertBendpointPossible = false; QPointF m_connectorDetectEnd; QPointF m_connectorDrawEnd; - double m_connectorDrawT; - double m_connectorDetectT; - bool m_groundFillSeed; - int m_moveCount; + double m_connectorDrawT = 0.0; + double m_connectorDetectT = 0.0; + bool m_groundFillSeed = false; + int m_moveCount = 0; protected: static QList m_equalPotentialDisplayItems; From 726dc73a39dea86025d203fb8e3185f22aecc88e Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 15:45:41 -0800 Subject: [PATCH 24/61] More missing variable initialization --- src/connectors/connectoritem.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/connectors/connectoritem.cpp b/src/connectors/connectoritem.cpp index 427278c6e..04562055a 100644 --- a/src/connectors/connectoritem.cpp +++ b/src/connectors/connectoritem.cpp @@ -927,8 +927,10 @@ QPointF ConnectorItem::sceneAdjustedTerminalPoint(ConnectorItem * connectee) { } else { QPointF current = this->mapToScene(QPointF(el)); - double candidateX, candidateY, candidateDistance; - bool atEndpoint; + double candidateX = 0.0; + double candidateY = 0.0; + double candidateDistance = 0.0; + bool atEndpoint = false; GraphicsUtils::distanceFromLine(anchor.x(), anchor.y(), prev.x(), prev.y(), current.x(), current.y(), candidateX, candidateY, candidateDistance, atEndpoint); if (candidateDistance < newDistance) { @@ -2781,7 +2783,7 @@ void ConnectorItem::updateWireCursor(Qt::KeyboardModifiers modifiers) void ConnectorItem::updateLegCursor(QPointF p, Qt::KeyboardModifiers modifiers) { - int bendpointIndex; + int bendpointIndex = 0; CursorLocation cursorLocation = findLocation(p, bendpointIndex); QCursor cursor; switch (cursorLocation) { From babd4b3b48d1479e9d1e2991212a9c6f5f0b187e Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 17:45:57 -0800 Subject: [PATCH 25/61] Default initialization --- src/fapplication.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fapplication.h b/src/fapplication.h index 78d13f359..c1363e466 100644 --- a/src/fapplication.h +++ b/src/fapplication.h @@ -71,8 +71,8 @@ class FServerThread : public QThread void writeResponse(QTcpSocket *, int code, const QString & codeString, const QString & mimeType, const QString & message); protected: - int m_socketDescriptor; - bool m_done; + int m_socketDescriptor = 0; + bool m_done = false; protected: static QMutex m_busy; From 18cb106f98c857f54c907b0992ca045ce0fdbb80 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 17:47:35 -0800 Subject: [PATCH 26/61] More sa violation fixes --- src/items/stripboard.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/items/stripboard.h b/src/items/stripboard.h index 7e7f14f7f..ea79ba67d 100644 --- a/src/items/stripboard.h +++ b/src/items/stripboard.h @@ -106,8 +106,8 @@ class Stripboard : public Perfboard QList m_strips; QList m_buses; QString m_beforeCut; - int m_x; - int m_y; + int m_x = 0; + int m_y = 0; QString m_layout; }; From 9a76bcbc4cad58f76fe8565122138f2c9f068d74 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 17:51:22 -0800 Subject: [PATCH 27/61] Mark stuff with constexpr and fix bezier --- src/utils/bezier.cpp | 20 ++------------------ src/utils/bezier.h | 6 +++--- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/utils/bezier.cpp b/src/utils/bezier.cpp index c3670fbb8..f4fc4342e 100644 --- a/src/utils/bezier.cpp +++ b/src/utils/bezier.cpp @@ -122,22 +122,11 @@ double Cvalues[25][24] = { ///////////////////////////////////////////// -Bezier::Bezier(QPointF cp0, QPointF cp1) +Bezier::Bezier(QPointF cp0, QPointF cp1) : m_cp0(cp0), m_cp1(cp1), m_isEmpty(false) { - m_cp0 = cp0; - m_cp1 = cp1; - m_isEmpty = false; -} - -Bezier::Bezier() -{ - m_isEmpty = true; } -bool Bezier::isEmpty() const -{ - return m_isEmpty; -} +Bezier::Bezier() : m_isEmpty(true) { } void Bezier::clear() { @@ -439,8 +428,3 @@ Bezier Bezier::join(const Bezier * other) const return bezier; } - -bool Bezier::drag0() -{ - return m_drag_cp0; -} diff --git a/src/utils/bezier.h b/src/utils/bezier.h index adf9444a1..ce31a7b1e 100644 --- a/src/utils/bezier.h +++ b/src/utils/bezier.h @@ -40,7 +40,7 @@ class Bezier void set_cp0(QPointF); void set_cp1(QPointF); void set_endpoints(QPointF, QPointF); - bool isEmpty() const; + constexpr bool isEmpty() const noexcept { return m_isEmpty; } void clear(); void write(QXmlStreamWriter &); bool operator==(const Bezier &) const; @@ -58,7 +58,7 @@ class Bezier void translateToZero(); void translate(QPointF); Bezier join(const Bezier * other) const; - bool drag0(); + constexpr bool drag0() const noexcept { return m_drag_cp0; } protected: double cubicF(double t) const; @@ -73,7 +73,7 @@ class Bezier QPointF m_cp0; QPointF m_cp1; bool m_isEmpty; - bool m_drag_cp0; + bool m_drag_cp0 = false; }; #endif From c09a4bb0f9bc4e7c3b4878861b0baaeac1021806 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 17:54:20 -0800 Subject: [PATCH 28/61] Fix cmrouter --- src/autoroute/cmrouter/cmrouter.cpp | 27 +++++++-------------------- src/autoroute/cmrouter/cmrouter.h | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/src/autoroute/cmrouter/cmrouter.cpp b/src/autoroute/cmrouter/cmrouter.cpp index ce5bee4ae..8167ec76c 100644 --- a/src/autoroute/cmrouter/cmrouter.cpp +++ b/src/autoroute/cmrouter/cmrouter.cpp @@ -279,30 +279,21 @@ int prepDeleteTile(Tile * tile, UserData userData) { //////////////////////////////////////////////////////////////////// -GridEntry::GridEntry(QRectF & r, QGraphicsItem * parent) : QGraphicsRectItem(r, parent) +GridEntry::GridEntry(QRectF & r, QGraphicsItem * parent) : QGraphicsRectItem(r, parent), + m_drawn(false) { - m_drawn = false; setAcceptedMouseButtons(Qt::NoButton); setAcceptHoverEvents(false); } -bool GridEntry::drawn() { - return m_drawn; -} - -void GridEntry::setDrawn(bool d) { - m_drawn = d; -} - //////////////////////////////////////////////////////////////////// -CMRouter::CMRouter(PCBSketchWidget * sketchWidget, ItemBase * board, bool adjustIf) : QObject() -{ - m_board = board; - m_sketchWidget = sketchWidget; - - m_unionPlane = m_union90Plane = NULL; +CMRouter::CMRouter(PCBSketchWidget * sketchWidget, ItemBase * board, bool adjustIf) : + QObject(), + m_board(board), + m_sketchWidget(sketchWidget) +{ if (m_board) { m_maxRect = m_board->sceneBoundingRect(); } @@ -322,10 +313,6 @@ CMRouter::CMRouter(PCBSketchWidget * sketchWidget, ItemBase * board, bool adjust setUpWidths(m_sketchWidget->getAutorouterTraceWidth()); } -CMRouter::~CMRouter() -{ -} - Plane * CMRouter::initPlane(bool rotate90) { Tile * bufferTile = TiAlloc(); TiSetType(bufferTile, Tile::BUFFER); diff --git a/src/autoroute/cmrouter/cmrouter.h b/src/autoroute/cmrouter/cmrouter.h index f1f5ad4fd..7a846dd44 100644 --- a/src/autoroute/cmrouter/cmrouter.h +++ b/src/autoroute/cmrouter/cmrouter.h @@ -53,22 +53,22 @@ class GridEntry : public QGraphicsRectItem { public: GridEntry(QRectF &, QGraphicsItem * parent); - bool drawn(); - void setDrawn(bool); + constexpr bool drawn() const noexcept { return m_drawn; } + void setDrawn(bool value) noexcept { m_drawn = value; } protected: bool m_drawn; }; //////////////////////////////////// - +class PCBSketchWidget; class CMRouter : public QObject { Q_OBJECT public: - CMRouter(class PCBSketchWidget *, ItemBase * board, bool adjustIf); - ~CMRouter(void); + CMRouter(PCBSketchWidget *, ItemBase * board, bool adjustIf); + ~CMRouter() = default; public: enum OverlapType { @@ -109,13 +109,13 @@ class CMRouter : public QObject QRectF m_maxRect90; TileRect m_overlappingTileRect; QList m_planes; - Plane * m_unionPlane; - Plane * m_union90Plane; - ItemBase * m_board; + Plane * m_unionPlane = nullptr; + Plane * m_union90Plane = nullptr; + ItemBase * m_board = nullptr; QRectF m_maxRect; QString m_error; - PCBSketchWidget * m_sketchWidget; - double m_keepoutPixels; + PCBSketchWidget * m_sketchWidget = nullptr; + double m_keepoutPixels = 0.0; }; #endif From c9cab3423a3df941e990fd448b31e6f828d5cd4f Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:01:15 -0800 Subject: [PATCH 29/61] Use NSDMI in some cases to get rid of the explicit constructor --- src/partseditor/pemainwindow.cpp | 252 +++++++++++++++---------------- src/partseditor/pemainwindow.h | 56 ++++--- 2 files changed, 153 insertions(+), 155 deletions(-) diff --git a/src/partseditor/pemainwindow.cpp b/src/partseditor/pemainwindow.cpp index 9ee661fb1..7b286fe58 100644 --- a/src/partseditor/pemainwindow.cpp +++ b/src/partseditor/pemainwindow.cpp @@ -288,39 +288,29 @@ void IconSketchWidget::addViewLayers() { //////////////////////////////////////////////////// -ViewThing::ViewThing() { - itemBase = NULL; - document = NULL; - svgChangeCount = 0; - everZoomed = false; - sketchWidget = NULL; - firstTime = true; - busMode = false; -} - -///////////////////////////////////////////////////// - PEMainWindow::PEMainWindow(ReferenceModel * referenceModel, QWidget * parent) - : MainWindow(referenceModel, parent) -{ + : MainWindow(referenceModel, parent), + m_useNextPick(false), + m_inPickMode(false), + m_gaveSaveWarning(false), + m_canSave(false), + m_guid(TextUtils::getRandText()), + m_prefix("prefix0000"), + m_fileIndex(0), + m_peToolView(nullptr), + m_peSvgView(nullptr), + m_connectorsView(nullptr) +{ + m_settingsPrefix = "pe/"; m_viewThings.insert(ViewLayer::BreadboardView, new ViewThing); m_viewThings.insert(ViewLayer::SchematicView, new ViewThing); m_viewThings.insert(ViewLayer::PCBView, new ViewThing); m_viewThings.insert(ViewLayer::IconView, new ViewThing); - m_useNextPick = m_inPickMode = false; m_autosaveTimer.stop(); disconnect(&m_autosaveTimer, SIGNAL(timeout()), this, SLOT(backupSketch())); - m_gaveSaveWarning = m_canSave = false; - m_settingsPrefix = "pe/"; - m_guid = TextUtils::getRandText(); - m_prefix = "prefix0000"; - m_fileIndex = 0; m_userPartsFolderPath = FolderUtils::getUserPartsPath()+"/user/"; m_userPartsFolderSvgPath = FolderUtils::getUserPartsPath()+"/svg/user/"; - m_peToolView = NULL; - m_peSvgView = NULL; - m_connectorsView = NULL; } PEMainWindow::~PEMainWindow() @@ -711,7 +701,7 @@ QMenu *PEMainWindow::breadboardWireMenu() { } QMenu *PEMainWindow::breadboardItemMenu() { - return NULL; + return nullptr; } QMenu *PEMainWindow::schematicWireMenu() { @@ -719,7 +709,7 @@ QMenu *PEMainWindow::schematicWireMenu() { } QMenu *PEMainWindow::schematicItemMenu() { - return NULL; + return nullptr; } QMenu *PEMainWindow::pcbWireMenu() { @@ -727,7 +717,7 @@ QMenu *PEMainWindow::pcbWireMenu() { } QMenu *PEMainWindow::pcbItemMenu() { - return NULL; + return nullptr; } bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) @@ -738,8 +728,8 @@ bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) m_pcbGraphicsView->setLayerActive(ViewLayer::Silkscreen1, true); m_pcbGraphicsView->setLayerActive(ViewLayer::Silkscreen0, true); - ModelPart * originalModelPart = NULL; - if (paletteItem == NULL) { + ModelPart * originalModelPart = nullptr; + if (paletteItem == nullptr) { // this shouldn't happen originalModelPart = m_referenceModel->retrieveModelPart("generic_ic_dip_8_300mil"); } @@ -832,7 +822,7 @@ bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) if (hasLegID && !RubberBandLegWarning) { RubberBandLegWarning = true; - QMessageBox::warning(NULL, tr("Parts Editor"), + QMessageBox::warning(nullptr, tr("Parts Editor"), tr("This part has bendable legs. ") + tr("This version of the Parts Editor does not yet support editing bendable legs, and the legs may not be displayed correctly in breadboard view . ") + tr("If you make changes to breadboard view, or change connector metadata, the legs may no longer work. ") + @@ -860,17 +850,17 @@ bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) } foreach (ViewThing * viewThing, m_viewThings.values()) { - if (viewThing->sketchWidget == NULL) continue; + if (viewThing->sketchWidget == nullptr) continue; ItemBase * itemBase = originalModelPart->viewItem(viewThing->sketchWidget->viewID()); - if (itemBase == NULL) continue; + if (itemBase == nullptr) continue; viewThing->referenceFile = getSvgReferenceFile(itemBase->filename()); if (!itemBase->hasCustomSVG()) { QFile file(itemBase->filename()); if (!file.open(QFile::ReadOnly)) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Unable to load '%1'. Please close the parts editor without saving and try again.").arg(itemBase->filename())); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Unable to load '%1'. Please close the parts editor without saving and try again.").arg(itemBase->filename())); continue; } @@ -880,7 +870,7 @@ bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) QString svgPath = makeSvgPath2(viewThing->sketchWidget); bool result = writeXml(m_userPartsFolderSvgPath + svgPath, removeGorn(svg), true); if (!result) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Unable to write svg to %1").arg(svgPath)); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Unable to write svg to %1").arg(svgPath)); return false; } @@ -947,14 +937,14 @@ bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) QString svgPath = makeSvgPath2(viewThing->sketchWidget); bool result = writeXml(m_userPartsFolderSvgPath + svgPath, removeGorn(svg), true); if (!result) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Unable to write svg to %1").arg(svgPath)); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Unable to write svg to %1").arg(svgPath)); return false; } QDomElement view = views.firstChildElement(ViewLayer::viewIDXmlName(viewThing->sketchWidget->viewID())); QDomElement layers = view.firstChildElement("layers"); if (layers.isNull()) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Unable to parse fzp file %1").arg(originalModelPart->path())); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Unable to parse fzp file %1").arg(originalModelPart->path())); return false; } @@ -974,11 +964,11 @@ bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) } void PEMainWindow::initZoom() { - if (m_peToolView == NULL) return; - if (m_currentGraphicsView == NULL) return; + if (m_peToolView == nullptr) return; + if (m_currentGraphicsView == nullptr) return; ViewThing * viewThing = m_viewThings.value(m_currentGraphicsView->viewID()); - if (viewThing->itemBase == NULL) return; + if (viewThing->itemBase == nullptr) return; if (!viewThing->everZoomed) { viewThing->everZoomed = true; @@ -1072,7 +1062,7 @@ void PEMainWindow::changeSpecialProperty(const QString & name, const QString & v QHash oldProperties = getOldProperties(); if (value.isEmpty()) { - QMessageBox::warning(NULL, tr("Blank not allowed"), tr("The value of '%1' can not be blank.").arg(name)); + QMessageBox::warning(nullptr, tr("Blank not allowed"), tr("The value of '%1' can not be blank.").arg(name)); m_metadataView->resetProperty(name, value); return; } @@ -1084,7 +1074,7 @@ void PEMainWindow::changeSpecialProperty(const QString & name, const QString & v QHash newProperties(oldProperties); newProperties.insert(name, value); - ChangePropertiesCommand * cpc = new ChangePropertiesCommand(this, oldProperties, newProperties, NULL); + ChangePropertiesCommand * cpc = new ChangePropertiesCommand(this, oldProperties, newProperties, nullptr); cpc->setText(tr("Change %1 to %2").arg(name).arg(value)); cpc->setSkipFirstRedo(); changeProperties(newProperties, false); @@ -1109,7 +1099,7 @@ void PEMainWindow::metadataChanged(const QString & name, const QString & value) values.removeOne(moduleID); } if (values.count() > 0) { - QMessageBox::warning(NULL, tr("Must be unique"), tr("Variant '%1' is in use. The variant name must be unique.").arg(value)); + QMessageBox::warning(nullptr, tr("Must be unique"), tr("Variant '%1' is in use. The variant name must be unique.").arg(value)); return; } @@ -1125,7 +1115,7 @@ void PEMainWindow::metadataChanged(const QString & name, const QString & value) QString oldValue = element.text(); if (oldValue == value) return; - ChangeMetadataCommand * cmc = new ChangeMetadataCommand(this, name, oldValue, value, NULL); + ChangeMetadataCommand * cmc = new ChangeMetadataCommand(this, name, oldValue, value, nullptr); cmc->setText(menuText); cmc->setSkipFirstRedo(); changeMetadata(name, value, false); @@ -1158,7 +1148,7 @@ void PEMainWindow::tagsChanged(const QStringList & newTags) tag = tag.nextSiblingElement("tag"); } - ChangeTagsCommand * ctc = new ChangeTagsCommand(this, oldTags, newTags, NULL); + ChangeTagsCommand * ctc = new ChangeTagsCommand(this, oldTags, newTags, nullptr); ctc->setText(tr("Change tags")); ctc->setSkipFirstRedo(); changeTags(newTags, false); @@ -1192,19 +1182,19 @@ void PEMainWindow::propertiesChanged(const QHash & newProperti QStringList keys = newProperties.keys(); if (keys.contains("family", Qt::CaseInsensitive)) { - QMessageBox::warning(NULL, tr("Duplicate problem"), tr("Duplicate 'family' property not allowed")); + QMessageBox::warning(nullptr, tr("Duplicate problem"), tr("Duplicate 'family' property not allowed")); return; } if (keys.contains("variant", Qt::CaseInsensitive)) { - QMessageBox::warning(NULL, tr("Duplicate problem"), tr("Duplicate 'variant' property not allowed")); + QMessageBox::warning(nullptr, tr("Duplicate problem"), tr("Duplicate 'variant' property not allowed")); return; } // called from metadataView QHash oldProperties = getOldProperties(); - ChangePropertiesCommand * cpc = new ChangePropertiesCommand(this, oldProperties, newProperties, NULL); + ChangePropertiesCommand * cpc = new ChangePropertiesCommand(this, oldProperties, newProperties, nullptr); cpc->setText(tr("Change properties")); cpc->setSkipFirstRedo(); changeProperties(newProperties, false); @@ -1268,7 +1258,7 @@ void PEMainWindow::connectorMetadataChanged(ConnectorMetadata * cmd) ConnectorMetadata oldcmd; fillInMetadata(connector, oldcmd); - ChangeConnectorMetadataCommand * ccmc = new ChangeConnectorMetadataCommand(this, &oldcmd, cmd, NULL); + ChangeConnectorMetadataCommand * ccmc = new ChangeConnectorMetadataCommand(this, &oldcmd, cmd, nullptr); ccmc->setText(tr("Change connector %1").arg(cmd->connectorName)); bool skipFirstRedo = (sender() == m_connectorsView); if (skipFirstRedo) { @@ -1347,7 +1337,7 @@ void PEMainWindow::initSvgTree(SketchWidget * sketchWidget, ItemBase * itemBase, if (parent0.attribute("id") == "copper1") ; else if (parent1.attribute("id") == "copper0") ; else { - QMessageBox::warning(NULL, tr("SVG problem"), + QMessageBox::warning(nullptr, tr("SVG problem"), tr("This version of the new Parts Editor can not deal with separate copper0 and copper1 layers in '%1'. ").arg(itemBase->filename()) + tr("So editing may produce an invalid PCB view image")); } @@ -1428,9 +1418,9 @@ void PEMainWindow::initSvgTree(SketchWidget * sketchWidget, ItemBase * itemBase, QString svgID, terminalID; bool ok = ViewLayer::getConnectorSvgIDs(connector, sketchWidget->viewID(), svgID, terminalID); if (ok) { - PEGraphicsItem * terminalItem = pegiHash.value(terminalID, NULL); + PEGraphicsItem * terminalItem = pegiHash.value(terminalID, nullptr); PEGraphicsItem * pegi = pegiHash.value(svgID); - if (pegi == NULL) { + if (pegi == nullptr) { DebugDialog::debug(QString("missing pegi for svg id %1").arg(svgID)); } else { @@ -1480,7 +1470,7 @@ void PEMainWindow::initConnectors(bool updateConnectorsView) { void PEMainWindow::switchedConnector(int ix) { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; switchedConnector(ix, m_currentGraphicsView); } @@ -1519,7 +1509,7 @@ void PEMainWindow::switchedConnector(int ix, SketchWidget * sketchWidget) void PEMainWindow::loadImage() { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; QStringList extras; extras.append(""); @@ -1563,14 +1553,14 @@ void PEMainWindow::loadImage() newReferenceFile = getSvgReferenceFile(origPath); QFile origFile(origPath); if (!origFile.open(QFile::ReadOnly)) { - QMessageBox::warning(NULL, tr("Conversion problem"), tr("Unable to load '%1'").arg(origPath)); + QMessageBox::warning(nullptr, tr("Conversion problem"), tr("Unable to load '%1'").arg(origPath)); return; } svg = origFile.readAll(); origFile.close(); if (svg.contains("coreldraw", Qt::CaseInsensitive) && svg.contains("cdata", Qt::CaseInsensitive)) { - QMessageBox::warning(NULL, tr("Conversion problem"), + QMessageBox::warning(nullptr, tr("Conversion problem"), tr("The SVG file '%1' appears to have been exported from CorelDRAW without the 'presentation attributes' setting. ").arg(origPath) + tr("Please re-export the SVG file using that setting, and try loading again.") ); @@ -1589,7 +1579,7 @@ void PEMainWindow::loadImage() bool reallyFixed = false; TextUtils::fixFonts(svg, destFont, reallyFixed); if (reallyFixed) { - QMessageBox::information(NULL, tr("Fonts"), + QMessageBox::information(nullptr, tr("Fonts"), tr("Fritzing currently only supports OCRA and Droid fonts--these have been substituted in for the fonts in '%1'").arg(origPath)); } } @@ -1602,7 +1592,7 @@ void PEMainWindow::loadImage() tr("so for Fritzing parts it is best to use PNG and JPG only as placeholders.") ; - QMessageBox::information(NULL, tr("Use of PNG and JPG discouraged"), message); + QMessageBox::information(nullptr, tr("Use of PNG and JPG discouraged"), message); } @@ -1610,13 +1600,13 @@ void PEMainWindow::loadImage() svg = createSvgFromImage(origPath); } catch (const QString & msg) { - QMessageBox::warning(NULL, tr("Conversion problem"), tr("Unable to load image file '%1': \n\n%2").arg(origPath).arg(msg)); + QMessageBox::warning(nullptr, tr("Conversion problem"), tr("Unable to load image file '%1': \n\n%2").arg(origPath).arg(msg)); return; } } if (svg.isEmpty()) { - QMessageBox::warning(NULL, tr("Conversion problem"), tr("Unable to load image file '%1'").arg(origPath)); + QMessageBox::warning(nullptr, tr("Conversion problem"), tr("Unable to load image file '%1'").arg(origPath)); return; } @@ -1626,7 +1616,7 @@ void PEMainWindow::loadImage() QDomDocument doc; bool result = doc.setContent(svg.toUtf8(), &errorStr, &errorLine, &errorColumn); if (!result) { - QMessageBox::warning(NULL, tr("SVG problem"), tr("Unable to parse '%1': %2 line:%3 column:%4").arg(origPath).arg(errorStr).arg(errorLine).arg(errorColumn)); + QMessageBox::warning(nullptr, tr("SVG problem"), tr("Unable to parse '%1': %2 line:%3 column:%4").arg(origPath).arg(errorStr).arg(errorLine).arg(errorColumn)); return; } @@ -1643,7 +1633,7 @@ void PEMainWindow::loadImage() tr("but for now please modify the file according to the instructions in the link.") ; - QMessageBox::warning(NULL, tr("SVG problem"), message); + QMessageBox::warning(nullptr, tr("SVG problem"), message); return; } } @@ -1653,7 +1643,7 @@ void PEMainWindow::loadImage() QString newPath = m_userPartsFolderSvgPath + makeSvgPath2(m_currentGraphicsView); bool success = writeXml(newPath, removeGorn(svg), true); if (!success) { - QMessageBox::warning(NULL, tr("Copy problem"), tr("Unable to make a local copy of: '%1'").arg(origPath)); + QMessageBox::warning(nullptr, tr("Copy problem"), tr("Unable to make a local copy of: '%1'").arg(origPath)); return; } @@ -1766,7 +1756,7 @@ void PEMainWindow::changeSvg(SketchWidget * sketchWidget, const QString & filena delete lk; } delete viewThing->itemBase; - viewThing->itemBase = NULL; + viewThing->itemBase = nullptr; } updateChangeCount(sketchWidget, changeDirection); @@ -1798,7 +1788,7 @@ void PEMainWindow::reload(bool firstTime) QList toDelete; foreach (ViewThing * viewThing, m_viewThings.values()) { - if (viewThing->sketchWidget == NULL) continue; + if (viewThing->sketchWidget == nullptr) continue; foreach (QGraphicsItem * item, viewThing->sketchWidget->scene()->items()) { ItemBase * itemBase = dynamic_cast(item); @@ -1820,10 +1810,10 @@ void PEMainWindow::reload(bool firstTime) viewGeometry.setLoc(QPointF(0, 0)); QList itemBases; - itemBases << m_iconGraphicsView->addItem(modelPart, m_iconGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, NULL); - itemBases << m_breadboardGraphicsView->addItem(modelPart, m_breadboardGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, NULL); - itemBases << m_schematicGraphicsView->addItem(modelPart, m_schematicGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, NULL); - itemBases << m_pcbGraphicsView->addItem(modelPart, m_pcbGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, NULL); + itemBases << m_iconGraphicsView->addItem(modelPart, m_iconGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, nullptr); + itemBases << m_breadboardGraphicsView->addItem(modelPart, m_breadboardGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, nullptr); + itemBases << m_schematicGraphicsView->addItem(modelPart, m_schematicGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, nullptr); + itemBases << m_pcbGraphicsView->addItem(modelPart, m_pcbGraphicsView->defaultViewLayerPlacement(modelPart), BaseCommand::SingleView, viewGeometry, newID, -1, nullptr); foreach (ItemBase * itemBase, itemBases) { ViewThing * viewThing = m_viewThings.value(itemBase->viewID()); @@ -1877,7 +1867,7 @@ void PEMainWindow::reload(bool firstTime) } void PEMainWindow::busModeChanged(bool state) { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; if (!state) { foreach (ViewThing * viewThing, m_viewThings.values()) { @@ -1932,7 +1922,7 @@ void PEMainWindow::busModeChanged(bool state) { } void PEMainWindow::pickModeChanged(bool state) { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; // never actually get state == false; m_inPickMode = state; @@ -2034,7 +2024,7 @@ void PEMainWindow::relocateConnector(PEGraphicsItem * pegi) return; } - RelocateConnectorSvgCommand * rcsc = new RelocateConnectorSvgCommand(this, m_currentGraphicsView, svgID, terminalID, oldGorn, oldGornTerminal, newGorn, "", NULL); + RelocateConnectorSvgCommand * rcsc = new RelocateConnectorSvgCommand(this, m_currentGraphicsView, svgID, terminalID, oldGorn, oldGornTerminal, newGorn, "", nullptr); rcsc->setText(tr("Relocate connector %1").arg(currentConnectorElement.attribute("name"))); m_undoStack->waitPush(rcsc, SketchWidget::PropChangeDelay); } @@ -2104,7 +2094,7 @@ void PEMainWindow::relocateConnectorSvg(SketchWidget * sketchWidget, const QStri foreach (QGraphicsItem * item, sketchWidget->scene()->items()) { PEGraphicsItem * pegi = dynamic_cast(item); - if (pegi == NULL) continue; + if (pegi == nullptr) continue; QDomElement element = pegi->element(); if (element.attribute("gorn").compare(newGorn) == 0) { @@ -2163,9 +2153,9 @@ bool PEMainWindow::saveAs(bool overWrite) if (overWrite) { foreach (QWidget *widget, QApplication::topLevelWidgets()) { MainWindow *mainWindow = qobject_cast(widget); - if (mainWindow == NULL) continue; + if (mainWindow == nullptr) continue; - if (qobject_cast(mainWindow) != NULL) continue; + if (qobject_cast(mainWindow) != nullptr) continue; allWindows.append(mainWindow); if (mainWindow->usesPart(m_originalModuleID)) { @@ -2230,7 +2220,7 @@ bool PEMainWindow::saveAs(bool overWrite) QHash svgHash; foreach (QGraphicsItem * item, viewThing->sketchWidget->scene()->items()) { ItemBase * itemBase = dynamic_cast(item); - if (itemBase == NULL) continue; + if (itemBase == nullptr) continue; if (itemBase->layerKinChief() == viewThing->itemBase) continue; @@ -2348,7 +2338,7 @@ bool PEMainWindow::saveAs(bool overWrite) } ModelPart * modelPart = m_referenceModel->retrieveModelPart(m_originalModuleID); - if (modelPart == NULL) { + if (modelPart == nullptr) { modelPart = m_referenceModel->loadPart(fzpPath, true); modelPart->setAlien(true); emit addToMyPartsSignal(modelPart, peAlienFiles); @@ -2380,26 +2370,26 @@ void PEMainWindow::updateChangeCount(SketchWidget * sketchWidget, int changeDire PEGraphicsItem * PEMainWindow::findConnectorItem() { - if (m_currentGraphicsView == NULL) return NULL; + if (m_currentGraphicsView == nullptr) return nullptr; QDomElement connector = m_connectorList.at(m_peToolView->currentConnectorIndex()); - if (connector.isNull()) return NULL; + if (connector.isNull()) return nullptr; QString svgID, terminalID; bool ok = ViewLayer::getConnectorSvgIDs(connector, m_currentGraphicsView->viewID(), svgID, terminalID); - if (!ok) return NULL; + if (!ok) return nullptr; QList pegiList = getPegiList(m_currentGraphicsView); foreach (PEGraphicsItem * pegi, pegiList) { if (pegi->element().attribute("id") == svgID) return pegi; } - return NULL; + return nullptr; } void PEMainWindow::terminalPointChanged(const QString & how) { PEGraphicsItem * pegi = findConnectorItem(); - if (pegi == NULL) return; + if (pegi == nullptr) return; QRectF r = pegi->rect(); QPointF p = r.center(); @@ -2425,7 +2415,7 @@ void PEMainWindow::terminalPointChanged(const QString & how) { void PEMainWindow::terminalPointChanged(const QString & coord, double value) { PEGraphicsItem * pegi = findConnectorItem(); - if (pegi == NULL) return; + if (pegi == nullptr) return; QPointF p = pegi->terminalPoint(); if (coord == "x") { @@ -2448,7 +2438,7 @@ void PEMainWindow::terminalPointChangedAux(PEGraphicsItem * pegi, QPointF before QDomElement currentConnectorElement = m_connectorList.at(m_peToolView->currentConnectorIndex()); - MoveTerminalPointCommand * mtpc = new MoveTerminalPointCommand(this, this->m_currentGraphicsView, currentConnectorElement.attribute("id"), pegi->rect().size(), before, after, NULL); + MoveTerminalPointCommand * mtpc = new MoveTerminalPointCommand(this, this->m_currentGraphicsView, currentConnectorElement.attribute("id"), pegi->rect().size(), before, after, nullptr); mtpc->setText(tr("Move terminal point")); m_undoStack->waitPush(mtpc, SketchWidget::PropChangeDelay); } @@ -2487,7 +2477,7 @@ void PEMainWindow::moveTerminalPoint(SketchWidget * sketchWidget, const QString return; } - PEGraphicsItem * connectorPegi = NULL; + PEGraphicsItem * connectorPegi = nullptr; QList pegiList = getPegiList(sketchWidget); foreach (PEGraphicsItem * pegi, pegiList) { QDomElement pegiElement = pegi->element(); @@ -2495,7 +2485,7 @@ void PEMainWindow::moveTerminalPoint(SketchWidget * sketchWidget, const QString connectorPegi = pegi; } } - if (connectorPegi == NULL) return; + if (connectorPegi == nullptr) return; if (centered) { pElement.removeAttribute("terminalId"); @@ -2594,13 +2584,13 @@ void PEMainWindow::showInOS(QWidget *parent, const QString &pathIn) Q_UNUSED(parent); FolderUtils::showInFolder(pathIn); QClipboard *clipboard = QApplication::clipboard(); - if (clipboard != NULL) { + if (clipboard != nullptr) { clipboard->setText(pathIn); } } void PEMainWindow::showInOS() { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; ViewThing * viewThing = m_viewThings.value(m_currentGraphicsView->viewID()); showInOS(this, viewThing->itemBase->filename()); @@ -2652,7 +2642,7 @@ bool PEMainWindow::canSave() { void PEMainWindow::tabWidget_currentChanged(int index) { MainWindow::tabWidget_currentChanged(index); - if (m_peToolView == NULL) return; + if (m_peToolView == nullptr) return; switchedConnector(m_peToolView->currentConnectorIndex()); @@ -2660,7 +2650,7 @@ void PEMainWindow::tabWidget_currentChanged(int index) { m_peSvgView->setChildrenVisible(enabled); m_peToolView->setChildrenVisible(enabled); - if (m_currentGraphicsView == NULL) { + if (m_currentGraphicsView == nullptr) { // update title when switching to connector and metadata view setTitle(); } @@ -2712,7 +2702,7 @@ void PEMainWindow::removedConnectorsAux(QList & connectors) QString newPath = saveFzp(); - ChangeFzpCommand * cfc = new ChangeFzpCommand(this, originalPath, newPath, NULL); + ChangeFzpCommand * cfc = new ChangeFzpCommand(this, originalPath, newPath, nullptr); QString message; if (connectors.count() == 1) { message = tr("Remove connector"); @@ -2761,7 +2751,7 @@ QString PEMainWindow::getPartTitle() { void PEMainWindow::killPegi() { foreach (ViewThing * viewThing, m_viewThings.values()) { - if (viewThing->sketchWidget == NULL) continue; + if (viewThing->sketchWidget == nullptr) continue; foreach (QGraphicsItem * item, viewThing->sketchWidget->scene()->items()) { PEGraphicsItem * pegi = dynamic_cast(item); @@ -2777,7 +2767,7 @@ bool PEMainWindow::loadFzp(const QString & path) { int errorColumn; bool result = m_fzpDocument.setContent(&file, &errorStr, &errorLine, &errorColumn); if (!result) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Unable to load fzp from %1").arg(path)); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Unable to load fzp from %1").arg(path)); return false; } @@ -2832,7 +2822,7 @@ void PEMainWindow::connectorCountChanged(int newCount) { tempDoc.setContent(m_removedConnector); connectorModel = tempDoc.documentElement(); if (connectorModel.isNull()) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Unable to create new connector--you may have to start over.")); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Unable to create new connector--you may have to start over.")); return; } } @@ -2862,7 +2852,7 @@ void PEMainWindow::connectorCountChanged(int newCount) { QString newPath = saveFzp(); - ChangeFzpCommand * cfc = new ChangeFzpCommand(this, originalPath, newPath, NULL); + ChangeFzpCommand * cfc = new ChangeFzpCommand(this, originalPath, newPath, nullptr); QString message; if (newCount - connectorList.count() == 1) { message = tr("Add connector"); @@ -3001,7 +2991,7 @@ void PEMainWindow::updateWireMenu() { // and that wire is cached by the menu in Wire::mousePressEvent Wire * wire = m_activeWire; - m_activeWire = NULL; + m_activeWire = nullptr; m_deleteBusConnectionAct->setWire(wire); m_deleteBusConnectionAct->setEnabled(true); @@ -3009,10 +2999,10 @@ void PEMainWindow::updateWireMenu() { void PEMainWindow::deleteBusConnection() { WireAction * wireAction = qobject_cast(sender()); - if (wireAction == NULL) return; + if (wireAction == nullptr) return; Wire * wire = wireAction->wire(); - if (wire == NULL) return; + if (wire == nullptr) return; QList wires; QList ends; @@ -3038,7 +3028,7 @@ void PEMainWindow::deleteBusConnection() { QString busID = bus.attribute("id"); if (nodeMember0.isNull() || nodeMember1.isNull()) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Internal connections are very messed up.")); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Internal connections are very messed up.")); return; } @@ -3072,10 +3062,10 @@ void PEMainWindow::newWireSlot(Wire * wire) { void PEMainWindow::wireChangedSlot(Wire* wire, const QLineF &, const QLineF &, QPointF, QPointF, ConnectorItem * fromOnWire, ConnectorItem * to) { wire->deleteLater(); - if (to == NULL) return; + if (to == nullptr) return; ConnectorItem * from = wire->otherConnector(fromOnWire)->firstConnectedToIsh(); - if (from == NULL) return; + if (from == nullptr) return; QDomElement root = m_fzpDocument.documentElement(); QDomElement buses = root.firstChildElement("buses"); @@ -3296,7 +3286,7 @@ bool PEMainWindow::eventFilter(QObject *object, QEvent *event) //qDebug() << "event" << event->type(); if (event->type() == QEvent::FocusIn) { QLineEdit * lineEdit = qobject_cast(object); - if (lineEdit != NULL) { + if (lineEdit != nullptr) { if (lineEdit->window() == this) { qDebug() << "inc focus"; m_inFocusWidgets << lineEdit; @@ -3304,7 +3294,7 @@ bool PEMainWindow::eventFilter(QObject *object, QEvent *event) } else { QTextEdit * textEdit = qobject_cast(object); - if (textEdit != NULL && textEdit->window() == this) { + if (textEdit != nullptr && textEdit->window() == this) { qDebug() << "inc focus"; m_inFocusWidgets << textEdit; } @@ -3312,7 +3302,7 @@ bool PEMainWindow::eventFilter(QObject *object, QEvent *event) } if (event->type() == QEvent::FocusOut) { QLineEdit * lineEdit = qobject_cast(object); - if (lineEdit != NULL) { + if (lineEdit != nullptr) { if (lineEdit->window() == this) { qDebug() << "dec focus"; m_inFocusWidgets.removeOne(lineEdit); @@ -3320,7 +3310,7 @@ bool PEMainWindow::eventFilter(QObject *object, QEvent *event) } else { QTextEdit * textEdit = qobject_cast(object); - if (textEdit != NULL && textEdit->window() == this) { + if (textEdit != nullptr && textEdit->window() == this) { qDebug() << "inc focus"; m_inFocusWidgets.removeOne(textEdit); } @@ -3356,7 +3346,7 @@ QList PEMainWindow::getPegiList(SketchWidget * sketchWidget) { QList pegiList; foreach (QGraphicsItem * item, sketchWidget->scene()->items()) { PEGraphicsItem * pegi = dynamic_cast(item); - if (pegi == NULL) continue; + if (pegi == nullptr) continue; pegiList.append(pegi); /* @@ -3379,7 +3369,7 @@ void PEMainWindow::deleteBuses() { foreach (ViewThing * viewThing, m_viewThings.values()) { foreach (QGraphicsItem * item, viewThing->sketchWidget->scene()->items()) { Wire * wire = dynamic_cast(item); - if (wire == NULL) continue; + if (wire == nullptr) continue; toDelete << wire; } @@ -3392,7 +3382,7 @@ void PEMainWindow::deleteBuses() { void PEMainWindow::connectorsTypeChanged(Connector::ConnectorType ct) { - QUndoCommand * parentCommand = NULL; + QUndoCommand * parentCommand = nullptr; QDomElement root = m_fzpDocument.documentElement(); QDomElement connectors = root.firstChildElement("connectors"); @@ -3401,7 +3391,7 @@ void PEMainWindow::connectorsTypeChanged(Connector::ConnectorType ct) ConnectorMetadata oldCmd; fillInMetadata(connector, oldCmd); if (oldCmd.connectorType != ct) { - if (parentCommand == NULL) { + if (parentCommand == nullptr) { parentCommand = new QUndoCommand(tr("Change all connectors to %1").arg(Connector::connectorNameFromType(ct))); } ConnectorMetadata cmd = oldCmd; @@ -3436,7 +3426,7 @@ void PEMainWindow::smdChanged(const QString & after) { ViewThing * viewThing = m_viewThings.value(ViewLayer::PCBView); ItemBase * itemBase = viewThing->itemBase; - if (itemBase == NULL) return; + if (itemBase == nullptr) return; QFile file(itemBase->filename()); QDomDocument svgDoc; @@ -3445,7 +3435,7 @@ void PEMainWindow::smdChanged(const QString & after) { QDomElement svgCopper0 = TextUtils::findElementWithAttribute(svgRoot, "id", "copper0"); QDomElement svgCopper1 = TextUtils::findElementWithAttribute(svgRoot, "id", "copper1"); if (svgCopper0.isNull() && svgCopper1.isNull()) { - QMessageBox::critical(NULL, tr("Parts Editor"), tr("Unable to parse '%1'").arg(itemBase->filename())); + QMessageBox::critical(nullptr, tr("Parts Editor"), tr("Unable to parse '%1'").arg(itemBase->filename())); return; } @@ -3495,7 +3485,7 @@ void PEMainWindow::smdChanged(const QString & after) { QString svg = TextUtils::svgNSOnly(svgDoc.toString()); writeXml(newPath, removeGorn(svg), true); - ChangeSMDCommand * csc = new ChangeSMDCommand(this, before, after, itemBase->filename(), newPath, NULL); + ChangeSMDCommand * csc = new ChangeSMDCommand(this, before, after, itemBase->filename(), newPath, nullptr); csc->setText(tr("Change to %1").arg(after)); m_undoStack->waitPush(csc, SketchWidget::PropChangeDelay); } @@ -3598,16 +3588,16 @@ void PEMainWindow::reusePCB() } void PEMainWindow::reuseImage(ViewLayer::ViewID viewID) { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; ViewThing * afterViewThing = m_viewThings.value(viewID); - if (afterViewThing->itemBase == NULL) return; + if (afterViewThing->itemBase == nullptr) return; QString afterFilename = afterViewThing->itemBase->filename(); ViewThing * beforeViewThing = m_viewThings.value(m_currentGraphicsView->viewID()); - ChangeSvgCommand * csc = new ChangeSvgCommand(this, m_currentGraphicsView, beforeViewThing->itemBase->filename(), afterFilename, NULL); + ChangeSvgCommand * csc = new ChangeSvgCommand(this, m_currentGraphicsView, beforeViewThing->itemBase->filename(), afterFilename, nullptr); QFileInfo info(afterFilename); csc->setText(QString("Load '%1'").arg(info.fileName())); m_undoStack->waitPush(csc, SketchWidget::PropChangeDelay); @@ -3624,7 +3614,7 @@ void PEMainWindow::updateFileMenu() { enabled.insert(ViewLayer::SchematicView, true); enabled.insert(ViewLayer::PCBView, true); bool enableAll = true; - if (m_currentGraphicsView == NULL) { + if (m_currentGraphicsView == nullptr) { enableAll = false; } else { @@ -3637,7 +3627,7 @@ void PEMainWindow::updateFileMenu() { m_reusePCBAct->setEnabled(enableAll && enabled.value(ViewLayer::PCBView)); */ - bool enabled = m_currentGraphicsView != NULL && m_currentGraphicsView->viewID() == ViewLayer::IconView; + bool enabled = m_currentGraphicsView != nullptr && m_currentGraphicsView->viewID() == ViewLayer::IconView; m_reuseBreadboardAct->setEnabled(enabled); m_reuseSchematicAct->setEnabled(enabled); m_reusePCBAct->setEnabled(enabled); @@ -3669,7 +3659,7 @@ void PEMainWindow::updateLayerMenu(bool resetLayout) { MainWindow::updateLayerMenu(resetLayout); bool enabled = false; - if (m_currentGraphicsView != NULL) { + if (m_currentGraphicsView != nullptr) { switch (m_currentGraphicsView->viewID()) { case ViewLayer::BreadboardView: case ViewLayer::SchematicView: @@ -3684,11 +3674,11 @@ void PEMainWindow::updateLayerMenu(bool resetLayout) { } void PEMainWindow::hideOtherViews() { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; ViewLayer::ViewID afterViewID = m_currentGraphicsView->viewID(); ItemBase * afterItemBase = m_viewThings.value(afterViewID)->itemBase; - if (afterItemBase == NULL) return; + if (afterItemBase == nullptr) return; QString afterFilename = afterItemBase->filename(); QList viewIDList; @@ -3736,7 +3726,7 @@ void PEMainWindow::hideOtherViews() { } QString newPath = saveFzp(); - ChangeFzpCommand * cfc = new ChangeFzpCommand(this, originalPath, newPath, NULL); + ChangeFzpCommand * cfc = new ChangeFzpCommand(this, originalPath, newPath, nullptr); cfc->setText(tr("Make only %1 view visible").arg(m_currentGraphicsView->viewName())); m_undoStack->waitPush(cfc, SketchWidget::PropChangeDelay); } @@ -3755,7 +3745,7 @@ QString PEMainWindow::makeNewVariant(const QString & family) } void PEMainWindow::updateAssignedConnectors() { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; QDomDocument * doc = m_viewThings.value(m_currentGraphicsView->viewID())->document; if (doc) m_peToolView->showAssignedConnectors(doc, m_currentGraphicsView->viewID()); @@ -3799,7 +3789,7 @@ void PEMainWindow::connectorWarning() { foreach (ViewLayer::ViewID viewID, unassigned.keys()) { if (unassigned.value(viewID) > 0) viewCount++; } - QMessageBox::warning(NULL, tr("Parts Editor"), + QMessageBox::warning(nullptr, tr("Parts Editor"), tr("This part has %n unassigned connectors ", "", unassignedTotal) + tr("across %n views. ", "", viewCount) + tr("Until all connectors are assigned to SVG elements, the part will not work correctly. ") + @@ -3825,7 +3815,7 @@ void PEMainWindow::showing(SketchWidget * sketchWidget) { } bool PEMainWindow::anyMarquee() { - if (m_currentGraphicsView == NULL) return false; + if (m_currentGraphicsView == nullptr) return false; QList pegiList = getPegiList(m_currentGraphicsView); foreach (PEGraphicsItem * pegi, pegiList) { @@ -3838,11 +3828,11 @@ bool PEMainWindow::anyMarquee() { } bool PEMainWindow::anyVisible() { - if (m_currentGraphicsView == NULL) return false; + if (m_currentGraphicsView == nullptr) return false; foreach (QGraphicsItem * item, m_currentGraphicsView->scene()->items()) { PEGraphicsItem * pegi = dynamic_cast(item); - if (pegi == NULL) continue; + if (pegi == nullptr) continue; return pegi->isVisible(); } @@ -3853,7 +3843,7 @@ bool PEMainWindow::anyVisible() { void PEMainWindow::changeReferenceFile(ViewLayer::ViewID viewID, const QString referenceFile) { ViewThing * viewThing = m_viewThings.value(viewID); - if (viewThing == NULL) { + if (viewThing == nullptr) { // shouldn't happen DebugDialog::debug(QString("missing view thing for %1").arg(viewID)); return; @@ -3877,7 +3867,7 @@ void PEMainWindow::insertDesc(const QString & referenceFile, QString & svg) { void PEMainWindow::itemAddedSlot(ModelPart *, ItemBase * itemBase, ViewLayer::ViewLayerPlacement, const ViewGeometry &, long id, SketchWidget *) { Q_UNUSED(id); - if (itemBase == NULL) return; + if (itemBase == nullptr) return; if (itemBase->viewID() != m_currentGraphicsView->viewID()) return; QDomElement element; @@ -3891,7 +3881,7 @@ void PEMainWindow::itemAddedSlot(ModelPart *, ItemBase * itemBase, ViewLayer::Vi } void PEMainWindow::itemMovedSlot(ItemBase * itemBase) { - if (itemBase == NULL) return; + if (itemBase == nullptr) return; if (itemBase->viewID() != m_currentGraphicsView->viewID()) return; foreach (PEGraphicsItem * pegi, getPegiList(m_currentGraphicsView)) { @@ -3903,7 +3893,7 @@ void PEMainWindow::itemMovedSlot(ItemBase * itemBase) { } void PEMainWindow::resizedSlot(ItemBase * itemBase) { - if (itemBase == NULL) return; + if (itemBase == nullptr) return; if (itemBase->viewID() != m_currentGraphicsView->viewID()) return; foreach (PEGraphicsItem * pegi, getPegiList(m_currentGraphicsView)) { @@ -3917,7 +3907,7 @@ void PEMainWindow::resizedSlot(ItemBase * itemBase) { void PEMainWindow::clickedItemCandidateSlot(QGraphicsItem * item, bool & ok) { PEGraphicsItem * pegi = dynamic_cast(item); - if (pegi == NULL) { + if (pegi == nullptr) { ok = true; return; } @@ -3945,7 +3935,7 @@ void PEMainWindow::updateExportMenu() { } void PEMainWindow::convertToTenth() { - if (m_currentGraphicsView == NULL) return; + if (m_currentGraphicsView == nullptr) return; if (m_currentGraphicsView->viewID() != ViewLayer::SchematicView) return; QString originalFzpPath = saveFzp(); @@ -3974,5 +3964,5 @@ void PEMainWindow::s2sMessageSlot(const QString & message) { void PEMainWindow::updateEditMenu() { MainWindow::updateEditMenu(); - m_convertToTenthAct->setEnabled(m_currentGraphicsView != NULL && m_currentGraphicsView->viewID() == ViewLayer::SchematicView); + m_convertToTenthAct->setEnabled(m_currentGraphicsView != nullptr && m_currentGraphicsView->viewID() == ViewLayer::SchematicView); } diff --git a/src/partseditor/pemainwindow.h b/src/partseditor/pemainwindow.h index ac572c384..5731e042d 100644 --- a/src/partseditor/pemainwindow.h +++ b/src/partseditor/pemainwindow.h @@ -39,28 +39,36 @@ class IconSketchWidget : public SketchWidget }; struct ViewThing { - ItemBase * itemBase; - QDomDocument * document; - int svgChangeCount; - bool everZoomed; - SketchWidget * sketchWidget; + ItemBase * itemBase = nullptr; + QDomDocument * document = nullptr; + int svgChangeCount = 0; + bool everZoomed = false; + SketchWidget * sketchWidget = nullptr; QString referenceFile; QString originalSvgPath; - bool firstTime; - bool busMode; - - ViewThing(); + bool firstTime = false; + bool busMode = false; }; +class ReferenceModel; +class PaletteItem; +class PEMetadataView; +class PEConnectorsView; +class PEToolView; +class PESvgView; +class PEGraphicsItem; +class Wire; +class WireAction; +class IconSketchWidget; class PEMainWindow : public MainWindow { Q_OBJECT public: - PEMainWindow(class ReferenceModel * referenceModel, QWidget * parent); + PEMainWindow(ReferenceModel * referenceModel, QWidget * parent); ~PEMainWindow(); - bool setInitialItem(class PaletteItem *); + bool setInitialItem(PaletteItem *); void changeTags(const QStringList &, bool updateDisplay); void changeProperties(const QHash &, bool updateDisplay); void changeMetadata(const QString & name, const QString & value, bool updateDisplay); @@ -85,11 +93,11 @@ public slots: void tagsChanged(const QStringList &); void connectorMetadataChanged(struct ConnectorMetadata *); void removedConnectors(QList &); - void highlightSlot(class PEGraphicsItem *); - void pegiMousePressed(class PEGraphicsItem *, bool & ignore); - void pegiMouseReleased(class PEGraphicsItem *); - void pegiTerminalPointMoved(class PEGraphicsItem *, QPointF); - void pegiTerminalPointChanged(class PEGraphicsItem *, QPointF before, QPointF after); + void highlightSlot(PEGraphicsItem *); + void pegiMousePressed(PEGraphicsItem *, bool & ignore); + void pegiMouseReleased(PEGraphicsItem *); + void pegiTerminalPointMoved(PEGraphicsItem *, QPointF); + void pegiTerminalPointChanged(PEGraphicsItem *, QPointF before, QPointF after); void switchedConnector(int); void removedConnector(const QDomElement &); void terminalPointChanged(const QString & how); @@ -100,7 +108,7 @@ public slots: void connectorCountChanged(int); void deleteBusConnection(); void newWireSlot(Wire *); - void wireChangedSlot(class Wire*, const QLineF & oldLine, const QLineF & newLine, QPointF oldPos, QPointF newPos, ConnectorItem * from, ConnectorItem * to); + void wireChangedSlot(Wire*, const QLineF & oldLine, const QLineF & newLine, QPointF oldPos, QPointF newPos, ConnectorItem * from, ConnectorItem * to); void connectorsTypeChanged(Connector::ConnectorType); void smdChanged(const QString &); void showing(SketchWidget *); @@ -144,7 +152,7 @@ public slots: void reload(bool firstTime); void createFileMenu(); void updateChangeCount(SketchWidget * sketchWidget, int changeDirection); - class PEGraphicsItem * findConnectorItem(); + PEGraphicsItem * findConnectorItem(); void terminalPointChangedAux(PEGraphicsItem * pegi, QPointF before, QPointF after); void showInOS(QWidget *parent, const QString &pathIn); void switchedConnector(int, SketchWidget *); @@ -231,7 +239,7 @@ protected slots: QAction * m_showConnectorsViewAct; QAction * m_showIconAct; QAction * m_showInOSAct; - class WireAction * m_deleteBusConnectionAct; + WireAction * m_deleteBusConnectionAct; QAction * m_reuseBreadboardAct; QAction * m_reuseSchematicAct; QAction * m_reusePCBAct; @@ -239,11 +247,11 @@ protected slots: QAction * m_convertToTenthAct; QPointer m_iconWidget; - QPointer m_iconGraphicsView; - class PEMetadataView * m_metadataView; - class PEConnectorsView * m_connectorsView; - class PEToolView * m_peToolView; - class PESvgView * m_peSvgView; + QPointer m_iconGraphicsView; + PEMetadataView * m_metadataView; + PEConnectorsView * m_connectorsView; + PEToolView * m_peToolView; + PESvgView * m_peSvgView; QString m_guid; QString m_prefix; int m_fileIndex; From 2801253aaf9ba222a710f0741be75af46e58415d Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:03:21 -0800 Subject: [PATCH 30/61] Fix more aspects of pemainwindow --- src/partseditor/pemainwindow.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/partseditor/pemainwindow.h b/src/partseditor/pemainwindow.h index 5731e042d..a2d884817 100644 --- a/src/partseditor/pemainwindow.h +++ b/src/partseditor/pemainwindow.h @@ -235,23 +235,23 @@ protected slots: QDomDocument m_schematicDocument; QDomDocument m_pcbDocument; - QAction * m_showMetadataViewAct; - QAction * m_showConnectorsViewAct; - QAction * m_showIconAct; - QAction * m_showInOSAct; - WireAction * m_deleteBusConnectionAct; - QAction * m_reuseBreadboardAct; - QAction * m_reuseSchematicAct; - QAction * m_reusePCBAct; - QAction * m_hideOtherViewsAct; - QAction * m_convertToTenthAct; + QAction * m_showMetadataViewAct = nullptr; + QAction * m_showConnectorsViewAct = nullptr; + QAction * m_showIconAct = nullptr; + QAction * m_showInOSAct = nullptr; + WireAction * m_deleteBusConnectionAct = nullptr; + QAction * m_reuseBreadboardAct = nullptr; + QAction * m_reuseSchematicAct = nullptr; + QAction * m_reusePCBAct = nullptr; + QAction * m_hideOtherViewsAct = nullptr; + QAction * m_convertToTenthAct = nullptr; QPointer m_iconWidget; QPointer m_iconGraphicsView; - PEMetadataView * m_metadataView; - PEConnectorsView * m_connectorsView; - PEToolView * m_peToolView; - PESvgView * m_peSvgView; + PEMetadataView * m_metadataView = nullptr; + PEConnectorsView * m_connectorsView = nullptr; + PEToolView * m_peToolView = nullptr; + PESvgView * m_peSvgView = nullptr; QString m_guid; QString m_prefix; int m_fileIndex; From d2536e58e9b0db12826281c61f2942a84baba466 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:05:24 -0800 Subject: [PATCH 31/61] Fix s2s --- src/utils/s2s.cpp | 6 +++--- src/utils/s2s.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/s2s.cpp b/src/utils/s2s.cpp index e3eddd75e..de30a1376 100644 --- a/src/utils/s2s.cpp +++ b/src/utils/s2s.cpp @@ -214,10 +214,10 @@ QString makeTerminal(const ConnectorLocation * connectorLocation, double x, doub /////////////////////////////////////////////////////// -S2S::S2S(bool fzpzStyle) : QObject() +S2S::S2S(bool fzpzStyle) : QObject(), + m_image(new QImage(50 * ImageFactor, 5 * ImageFactor, QImage::Format_Mono)), + m_fzpzStyle(fzpzStyle) { - m_image = new QImage(50 * ImageFactor, 5 * ImageFactor, QImage::Format_Mono); - m_fzpzStyle = fzpzStyle; } void S2S::message(const QString & msg) { diff --git a/src/utils/s2s.h b/src/utils/s2s.h index 4444e4747..bd275a27f 100644 --- a/src/utils/s2s.h +++ b/src/utils/s2s.h @@ -55,15 +55,15 @@ class S2S : public QObject protected: bool m_fzpzStyle; QString m_andPath; - double m_minLeft; - double m_minTop; - double m_maxRight; - double m_maxBottom; + double m_minLeft = 0.0; + double m_minTop = 0.0; + double m_maxRight = 0.0; + double m_maxBottom = 0.0; QList m_lefts; QList m_tops; QList m_rights; QList m_bottoms; - double m_fudge; + double m_fudge = 0.0; QDir m_oldSvgDir; QDir m_newSvgDir; QImage * m_image; From a534ff2c1670ecd01c6ae5c7d26e877a93b5ca3c Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:08:15 -0800 Subject: [PATCH 32/61] default init pointers in mainwindow --- src/mainwindow/mainwindow.h | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index 261238949..51f3a6880 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -795,25 +795,25 @@ protected slots: // View Menu - QMenu *m_viewMenu; - QAction *m_zoomInAct; - QAction *m_zoomInShortcut; - QAction *m_zoomOutAct; - QAction *m_fitInWindowAct; - QAction *m_actualSizeAct; - QAction *m_100PercentSizeAct; - QAction *m_alignToGridAct; - QAction *m_showGridAct; - QAction *m_setGridSizeAct; - QAction *m_setBackgroundColorAct; - QAction *m_colorWiresByLengthAct; - QAction *m_showWelcomeAct; - QAction *m_showBreadboardAct; - QAction *m_showSchematicAct; - QAction *m_showProgramAct; - QAction *m_showPCBAct; - QAction *m_showPartsBinIconViewAct; - QAction *m_showPartsBinListViewAct; + QMenu *m_viewMenu = nullptr; + QAction *m_zoomInAct = nullptr; + QAction *m_zoomInShortcut = nullptr; + QAction *m_zoomOutAct = nullptr; + QAction *m_fitInWindowAct = nullptr; + QAction *m_actualSizeAct = nullptr; + QAction *m_100PercentSizeAct = nullptr; + QAction *m_alignToGridAct = nullptr; + QAction *m_showGridAct = nullptr; + QAction *m_setGridSizeAct = nullptr; + QAction *m_setBackgroundColorAct = nullptr; + QAction *m_colorWiresByLengthAct = nullptr; + QAction *m_showWelcomeAct = nullptr; + QAction *m_showBreadboardAct = nullptr; + QAction *m_showSchematicAct = nullptr; + QAction *m_showProgramAct = nullptr; + QAction *m_showPCBAct = nullptr; + QAction *m_showPartsBinIconViewAct = nullptr; + QAction *m_showPartsBinListViewAct = nullptr; //QAction *m_toggleToolbarAct; int m_numFixedActionsInViewMenu; From d4177bcba3481d632c90adaad1f429007960e3dd Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:10:50 -0800 Subject: [PATCH 33/61] default init more fields of mainwindow --- src/mainwindow/mainwindow.h | 334 ++++++++++++++++++------------------ 1 file changed, 167 insertions(+), 167 deletions(-) diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index 51f3a6880..b92a44a19 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -674,124 +674,124 @@ protected slots: //QToolBar *m_fileToolBar; //QToolBar *m_editToolBar; - QAction *m_raiseWindowAct; + QAction *m_raiseWindowAct = nullptr; // Fritzing Menu - QMenu *m_fritzingMenu; - QAction *m_aboutAct; - QAction *m_preferencesAct; - QAction *m_quitAct; - QAction *m_exceptionAct; + QMenu *m_fritzingMenu = nullptr; + QAction *m_aboutAct = nullptr; + QAction *m_preferencesAct = nullptr; + QAction *m_quitAct = nullptr; + QAction *m_exceptionAct = nullptr; // File Menu enum { MaxRecentFiles = 10 }; - QMenu *m_fileMenu; - QAction *m_newAct; - QAction *m_openAct; - QAction *m_revertAct; - QMenu *m_openRecentFileMenu; - QAction *m_openRecentFileActs[MaxRecentFiles]; - QMenu *m_openExampleMenu; - QAction *m_saveAct; - QAction *m_saveAsAct; - QAction *m_pageSetupAct; - QAction *m_printAct; - QAction *m_shareOnlineAct; - - QAction * m_launchExternalProcessAct; - - QMenu *m_zOrderMenu; - QMenu *m_zOrderWireMenu; - QAction *m_bringToFrontAct; - QAction *m_bringForwardAct; - QAction *m_sendBackwardAct; - QAction *m_sendToBackAct; - class WireAction *m_bringToFrontWireAct; - class WireAction *m_bringForwardWireAct; - class WireAction *m_sendBackwardWireAct; - class WireAction *m_sendToBackWireAct; - - QMenu *m_alignMenu; - QAction * m_alignVerticalCenterAct; - QAction * m_alignHorizontalCenterAct; - QAction * m_alignTopAct; - QAction * m_alignLeftAct; - QAction * m_alignBottomAct; - QAction * m_alignRightAct; + QMenu *m_fileMenu = nullptr; + QAction *m_newAct = nullptr; + QAction *m_openAct = nullptr; + QAction *m_revertAct = nullptr; + QMenu *m_openRecentFileMenu = nullptr; + QAction *m_openRecentFileActs[MaxRecentFiles] = { nullptr }; + QMenu *m_openExampleMenu = nullptr; + QAction *m_saveAct = nullptr; + QAction *m_saveAsAct = nullptr; + QAction *m_pageSetupAct = nullptr; + QAction *m_printAct = nullptr; + QAction *m_shareOnlineAct = nullptr; + + QAction * m_launchExternalProcessAct = nullptr; + + QMenu *m_zOrderMenu = nullptr; + QMenu *m_zOrderWireMenu = nullptr; + QAction *m_bringToFrontAct = nullptr; + QAction *m_bringForwardAct = nullptr; + QAction *m_sendBackwardAct = nullptr; + QAction *m_sendToBackAct = nullptr; + class WireAction *m_bringToFrontWireAct = nullptr; + class WireAction *m_bringForwardWireAct = nullptr; + class WireAction *m_sendBackwardWireAct = nullptr; + class WireAction *m_sendToBackWireAct = nullptr; + + QMenu *m_alignMenu = nullptr; + QAction * m_alignVerticalCenterAct = nullptr; + QAction * m_alignHorizontalCenterAct = nullptr; + QAction * m_alignTopAct = nullptr; + QAction * m_alignLeftAct = nullptr; + QAction * m_alignBottomAct = nullptr; + QAction * m_alignRightAct = nullptr; // Export Menu - QMenu *m_exportMenu; - QAction *m_exportJpgAct; - QAction *m_exportPngAct; - QAction *m_exportPdfAct; - QAction *m_exportEagleAct; - QAction *m_exportGerberAct; - QAction *m_exportEtchablePdfAct; - QAction *m_exportEtchableSvgAct; - QAction *m_exportBomAct; - QAction *m_exportNetlistAct; - QAction *m_exportSpiceNetlistAct; - QAction *m_exportSvgAct; + QMenu *m_exportMenu = nullptr; + QAction *m_exportJpgAct = nullptr; + QAction *m_exportPngAct = nullptr; + QAction *m_exportPdfAct = nullptr; + QAction *m_exportEagleAct = nullptr; + QAction *m_exportGerberAct = nullptr; + QAction *m_exportEtchablePdfAct = nullptr; + QAction *m_exportEtchableSvgAct = nullptr; + QAction *m_exportBomAct = nullptr; + QAction *m_exportNetlistAct = nullptr; + QAction *m_exportSpiceNetlistAct = nullptr; + QAction *m_exportSvgAct = nullptr; // Edit Menu - QMenu *m_editMenu; - QAction *m_undoAct; - QAction *m_redoAct; - QAction *m_cutAct; - QAction *m_copyAct; - QAction *m_pasteAct; - QAction *m_pasteInPlaceAct; - QAction *m_duplicateAct; - QAction *m_deleteAct; - QAction *m_deleteMinusAct; - class WireAction *m_deleteWireAct; - class WireAction *m_deleteWireMinusAct; - QAction *m_selectAllAct; - QAction *m_deselectAct; - QAction *m_addNoteAct; + QMenu *m_editMenu = nullptr; + QAction *m_undoAct = nullptr; + QAction *m_redoAct = nullptr; + QAction *m_cutAct = nullptr; + QAction *m_copyAct = nullptr; + QAction *m_pasteAct = nullptr; + QAction *m_pasteInPlaceAct = nullptr; + QAction *m_duplicateAct = nullptr; + QAction *m_deleteAct = nullptr; + QAction *m_deleteMinusAct = nullptr; + class WireAction *m_deleteWireAct = nullptr; + class WireAction *m_deleteWireMinusAct = nullptr; + QAction *m_selectAllAct = nullptr; + QAction *m_deselectAct = nullptr; + QAction *m_addNoteAct = nullptr; // Part Menu - QMenu *m_partMenu; - QAction *m_infoViewOnHoverAction; - QAction *m_exportNormalizedSvgAction; - QAction *m_exportNormalizedFlattenedSvgAction; - QAction *m_dumpAllPartsAction; - QAction *m_testConnectorsAction; - QAction *m_openInPartsEditorNewAct; - QMenu *m_addToBinMenu; - - - QMenu *m_rotateMenu; - QAction *m_rotate90cwAct; - QAction *m_rotate180Act; - QAction *m_rotate90ccwAct; - QAction *m_rotate45ccwAct; - QAction *m_rotate45cwAct; - - QAction *m_moveLockAct; - QAction *m_stickyAct; - QAction *m_selectMoveLockAct; - QAction *m_flipHorizontalAct; - QAction *m_flipVerticalAct; - QAction *m_showPartLabelAct; - QAction *m_saveBundledPart; - QAction *m_disconnectAllAct; - QAction *m_selectAllObsoleteAct; - QAction *m_swapObsoleteAct; - QAction *m_findPartInSketchAct; - QAction * m_openProgramWindowAct; - - QAction *m_addBendpointAct; - QAction *m_convertToViaAct; - QAction *m_convertToBendpointAct; - QAction * m_convertToBendpointSeparator; - QAction *m_flattenCurveAct; - QAction *m_showAllLayersAct; - QAction *m_hideAllLayersAct; - - QAction *m_hidePartSilkscreenAct; - QAction *m_regeneratePartsDatabaseAct; + QMenu *m_partMenu = nullptr; + QAction *m_infoViewOnHoverAction = nullptr; + QAction *m_exportNormalizedSvgAction = nullptr; + QAction *m_exportNormalizedFlattenedSvgAction = nullptr; + QAction *m_dumpAllPartsAction = nullptr; + QAction *m_testConnectorsAction = nullptr; + QAction *m_openInPartsEditorNewAct = nullptr; + QMenu *m_addToBinMenu = nullptr; + + + QMenu *m_rotateMenu = nullptr; + QAction *m_rotate90cwAct = nullptr; + QAction *m_rotate180Act = nullptr; + QAction *m_rotate90ccwAct = nullptr; + QAction *m_rotate45ccwAct = nullptr; + QAction *m_rotate45cwAct = nullptr; + + QAction *m_moveLockAct = nullptr; + QAction *m_stickyAct = nullptr; + QAction *m_selectMoveLockAct = nullptr; + QAction *m_flipHorizontalAct = nullptr; + QAction *m_flipVerticalAct = nullptr; + QAction *m_showPartLabelAct = nullptr; + QAction *m_saveBundledPart = nullptr; + QAction *m_disconnectAllAct = nullptr; + QAction *m_selectAllObsoleteAct = nullptr; + QAction *m_swapObsoleteAct = nullptr; + QAction *m_findPartInSketchAct = nullptr; + QAction * m_openProgramWindowAct = nullptr; + + QAction *m_addBendpointAct = nullptr; + QAction *m_convertToViaAct = nullptr; + QAction *m_convertToBendpointAct = nullptr; + QAction * m_convertToBendpointSeparator = nullptr; + QAction *m_flattenCurveAct = nullptr; + QAction *m_showAllLayersAct = nullptr; + QAction *m_hideAllLayersAct = nullptr; + + QAction *m_hidePartSilkscreenAct = nullptr; + QAction *m_regeneratePartsDatabaseAct = nullptr; // View Menu @@ -818,73 +818,73 @@ protected slots: int m_numFixedActionsInViewMenu; // Window Menu - QMenu *m_windowMenu; - QAction *m_minimizeAct; - QAction *m_togglePartLibraryAct; - QAction *m_toggleInfoAct; - QAction *m_toggleUndoHistoryAct; - QAction *m_toggleDebuggerOutputAct; - QAction *m_windowMenuSeparator; + QMenu *m_windowMenu = nullptr; + QAction *m_minimizeAct = nullptr; + QAction *m_togglePartLibraryAct = nullptr; + QAction *m_toggleInfoAct = nullptr; + QAction *m_toggleUndoHistoryAct = nullptr; + QAction *m_toggleDebuggerOutputAct = nullptr; + QAction *m_windowMenuSeparator = nullptr; // Trace Menu - QMenu *m_pcbTraceMenu; - QMenu *m_schematicTraceMenu; - QMenu *m_breadboardTraceMenu; - QAction *m_newAutorouteAct; - QAction *m_orderFabAct; - QAction *m_activeLayerTopAct; - QAction *m_activeLayerBottomAct; - QAction *m_activeLayerBothAct; - QAction *m_viewFromBelowToggleAct; - QAction *m_viewFromBelowAct; - QAction *m_viewFromAboveAct; - class WireAction *m_createTraceWireAct; - class WireAction *m_createWireWireAct; - QAction *m_createJumperAct; - QAction *m_changeTraceLayerAct; - class WireAction *m_changeTraceLayerWireAct; - QAction *m_excludeFromAutorouteAct; - class WireAction *m_excludeFromAutorouteWireAct; - QAction * m_showUnroutedAct; - QAction *m_selectAllTracesAct; - QAction *m_selectAllWiresAct; - QAction *m_selectAllCopperFillAct; - QAction *m_updateRoutingStatusAct; - QAction *m_selectAllExcludedTracesAct; - QAction *m_selectAllIncludedTracesAct; - QAction *m_selectAllJumperItemsAct; - QAction *m_selectAllViasAct; - QAction *m_groundFillAct; - QAction *m_removeGroundFillAct; - QAction *m_copperFillAct; - class ConnectorItemAction *m_setOneGroundFillSeedAct; - QAction *m_setGroundFillSeedsAct; - QAction *m_clearGroundFillSeedsAct; - QAction *m_setGroundFillKeepoutAct; - QAction *m_newDesignRulesCheckAct; - QAction *m_autorouterSettingsAct; - QAction *m_fabQuoteAct; - QAction *m_tidyWiresAct; - QAction *m_checkLoadedTracesAct; + QMenu *m_pcbTraceMenu = nullptr; + QMenu *m_schematicTraceMenu = nullptr; + QMenu *m_breadboardTraceMenu = nullptr; + QAction *m_newAutorouteAct = nullptr; + QAction *m_orderFabAct = nullptr; + QAction *m_activeLayerTopAct = nullptr; + QAction *m_activeLayerBottomAct = nullptr; + QAction *m_activeLayerBothAct = nullptr; + QAction *m_viewFromBelowToggleAct = nullptr; + QAction *m_viewFromBelowAct = nullptr; + QAction *m_viewFromAboveAct = nullptr; + class WireAction *m_createTraceWireAct = nullptr; + class WireAction *m_createWireWireAct = nullptr; + QAction *m_createJumperAct = nullptr; + QAction *m_changeTraceLayerAct = nullptr; + class WireAction *m_changeTraceLayerWireAct = nullptr; + QAction *m_excludeFromAutorouteAct = nullptr; + class WireAction *m_excludeFromAutorouteWireAct = nullptr; + QAction * m_showUnroutedAct = nullptr; + QAction *m_selectAllTracesAct = nullptr; + QAction *m_selectAllWiresAct = nullptr; + QAction *m_selectAllCopperFillAct = nullptr; + QAction *m_updateRoutingStatusAct = nullptr; + QAction *m_selectAllExcludedTracesAct = nullptr; + QAction *m_selectAllIncludedTracesAct = nullptr; + QAction *m_selectAllJumperItemsAct = nullptr; + QAction *m_selectAllViasAct = nullptr; + QAction *m_groundFillAct = nullptr; + QAction *m_removeGroundFillAct = nullptr; + QAction *m_copperFillAct = nullptr; + class ConnectorItemAction *m_setOneGroundFillSeedAct = nullptr; + QAction *m_setGroundFillSeedsAct = nullptr; + QAction *m_clearGroundFillSeedsAct = nullptr; + QAction *m_setGroundFillKeepoutAct = nullptr; + QAction *m_newDesignRulesCheckAct = nullptr; + QAction *m_autorouterSettingsAct = nullptr; + QAction *m_fabQuoteAct = nullptr; + QAction *m_tidyWiresAct = nullptr; + QAction *m_checkLoadedTracesAct = nullptr; // Help Menu - QMenu *m_helpMenu; - QAction *m_openHelpAct; - QAction *m_openDonateAct; - QAction *m_examplesAct; - QAction *m_partsRefAct; - QAction *m_visitFritzingDotOrgAct; - QAction *m_checkForUpdatesAct; - QAction *m_aboutQtAct; - QAction *m_reportBugAct; - QAction *m_enableDebugAct; - QAction *m_partsEditorHelpAct; - QAction *m_tipsAndTricksAct; - QAction *m_firstTimeHelpAct; + QMenu *m_helpMenu = nullptr; + QAction *m_openHelpAct = nullptr; + QAction *m_openDonateAct = nullptr; + QAction *m_examplesAct = nullptr; + QAction *m_partsRefAct = nullptr; + QAction *m_visitFritzingDotOrgAct = nullptr; + QAction *m_checkForUpdatesAct = nullptr; + QAction *m_aboutQtAct = nullptr; + QAction *m_reportBugAct = nullptr; + QAction *m_enableDebugAct = nullptr; + QAction *m_partsEditorHelpAct = nullptr; + QAction *m_tipsAndTricksAct = nullptr; + QAction *m_firstTimeHelpAct = nullptr; // Wire Color Menu - QMenu * m_breadboardWireColorMenu; - QMenu * m_schematicWireColorMenu; + QMenu * m_breadboardWireColorMenu = nullptr; + QMenu * m_schematicWireColorMenu = nullptr; // Dot icons QIcon m_dotIcon; From 1b430ea31496368f8b2078993c539a707aec51a5 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:13:15 -0800 Subject: [PATCH 34/61] More NSDMI --- src/mainwindow/mainwindow.h | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index b92a44a19..69bcf8ebb 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -892,11 +892,11 @@ protected slots: QList m_rotateButtons; QList m_flipButtons; - QStackedWidget * m_activeLayerButtonWidget; - QStackedWidget * m_viewFromButtonWidget; + QStackedWidget * m_activeLayerButtonWidget = nullptr; + QStackedWidget * m_viewFromButtonWidget = nullptr; - bool m_comboboxChanged; - bool m_restarting; + bool m_comboboxChanged = false; + bool m_restarting = false; QStringList m_alienFiles; QString m_alienPartsMsg; @@ -921,35 +921,35 @@ protected slots: QString m_backupFileNameAndPath; QTimer m_autosaveTimer; QTimer m_fireQuoteTimer; - bool m_autosaveNeeded; - bool m_backingUp; + bool m_autosaveNeeded = false; + bool m_backingUp = false; QString m_bundledSketchName; RoutingStatus m_routingStatus; - bool m_orderFabEnabled; - bool m_closeSilently; + bool m_orderFabEnabled = false; + bool m_closeSilently = false; QString m_fzzFolder; QHash m_fzzFiles; SwapTimer m_swapTimer; QPointer m_activeWire; QPointer m_activeConnectorItem; - bool m_addedToTemp; + bool m_addedToTemp = false; QString m_settingsPrefix; - bool m_convertedSchematic; - bool m_useOldSchematic; - bool m_noSchematicConversion; - int m_initialTab; + bool m_convertedSchematic = false; + bool m_useOldSchematic = false; + bool m_noSchematicConversion = false; + int m_initialTab = 0; // dock management QList m_docks; - FDockWidget* m_topDock; - FDockWidget* m_bottomDock; + FDockWidget* m_topDock = nullptr; + FDockWidget* m_bottomDock = nullptr; QString m_oldTopDockStyle; QString m_oldBottomDockStyle; - bool m_dontKeepMargins; + bool m_dontKeepMargins = false; QPointer m_rolloverQuoteDialog; - bool m_obsoleteSMDOrientation; - QWidget * m_orderFabButton; - int m_fireQuoteDelay; + bool m_obsoleteSMDOrientation = false; + QWidget * m_orderFabButton = nullptr; + int m_fireQuoteDelay = 0; public: static int AutosaveTimeoutMinutes; From e45b80c6f489ee7c9318ab6ee2b3607cb107da96 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:21:54 -0800 Subject: [PATCH 35/61] More static analysis violation fixes in panelizer and mainwindow --- src/autoroute/panelizer.cpp | 33 +++++++-------------- src/autoroute/panelizer.h | 59 ++++++++++++++++++------------------- src/mainwindow/mainwindow.h | 14 ++++----- 3 files changed, 46 insertions(+), 60 deletions(-) diff --git a/src/autoroute/panelizer.cpp b/src/autoroute/panelizer.cpp index 39bf42dde..308355fc9 100644 --- a/src/autoroute/panelizer.cpp +++ b/src/autoroute/panelizer.cpp @@ -106,8 +106,6 @@ int allObstacles(Tile * tile, UserData userData) { static int PlanePairIndex = 0; -static double Worst = std::numeric_limits::max() / 4; - int roomOn(Tile * tile, TileRect & tileRect, BestPlace * bestPlace) { int w = tileRect.xmaxi - tileRect.xmini; @@ -196,27 +194,18 @@ int roomOnRight(Tile * tile, UserData userData) } -BestPlace::BestPlace() { - bestTile = NULL; - bestArea = Worst; -} - -PanelItem::PanelItem() { - produced = 0; - boardID = 0; - refPanelItem = NULL; -} +PanelItem::PanelItem(const PanelItem& from) : + boardName(from.boardName), + path(from.path), + required(from.required), + maxOptional(from.maxOptional), + optionalPriority(from.optionalPriority), + produced(from.produced), + boardSizeInches(from.boardSizeInches), + boardID(from.boardID), + refPanelItem(from.refPanelItem) +{ -PanelItem::PanelItem(PanelItem * from) { - this->produced = from->produced; - this->boardName = from->boardName; - this->path = from->path; - this->required = from->required; - this->maxOptional = from->maxOptional; - this->optionalPriority = from->optionalPriority; - this->boardSizeInches = from->boardSizeInches; - this->boardID = from->boardID; - this->refPanelItem = from; } ///////////////////////////////////////////////////////////////////////////////// diff --git a/src/autoroute/panelizer.h b/src/autoroute/panelizer.h index fe6bf7077..fd977435c 100644 --- a/src/autoroute/panelizer.h +++ b/src/autoroute/panelizer.h @@ -28,7 +28,7 @@ along with Fritzing. If not, see . #include "../items/itembase.h" #include "cmrouter/tile.h" - +constexpr double Worst = std::numeric_limits::max() / 4; struct PlanePair { Plane * thePlane; @@ -46,51 +46,50 @@ struct PanelItem { // per window QString boardName; QString path; - int required; - int maxOptional; - int optionalPriority; - int produced; + int required = 0; + int maxOptional = 0; + int optionalPriority = 0; + int produced = 0; QSizeF boardSizeInches; - long boardID; - PanelItem * refPanelItem; + long boardID = 0; + PanelItem * refPanelItem = nullptr; // per instance - double x, y; - bool rotate90; - PlanePair * planePair; + double x = 0.0, y = 0.0; + bool rotate90 = false; + PlanePair * planePair = nullptr; - PanelItem(); + PanelItem() = default; + PanelItem(const PanelItem& item); - PanelItem(PanelItem * from); + PanelItem(PanelItem * from) : PanelItem(*from) { } }; struct BestPlace { - Tile * bestTile; + Tile * bestTile = nullptr; TileRect bestTileRect; TileRect maxRect; - int width; - int height; - double bestArea; - bool rotate90; - Plane* plane; - - BestPlace(); + int width = 0; + int height = 0; + double bestArea = Worst; + bool rotate90 = false; + Plane* plane = nullptr; }; struct PanelType { - double width; - double height; - double c1; - double c2; + double width = 0.0; + double height = 0.0; + double c1 = 0.0; + double c2 = 0.0; QString name; }; struct PanelParams { QList panelTypes; - double panelSpacing; - double panelBorder; + double panelSpacing = 0.0; + double panelBorder = 0.0; QString prefix; }; @@ -100,11 +99,9 @@ struct LayerThing { SVG2gerber::ForWhy forWhy; QString suffix; - LayerThing(const QString & n, LayerList ll, SVG2gerber::ForWhy fw, const QString & s) { - layerList = ll; - name = n; - forWhy = fw; - suffix = s; + LayerThing(const QString & n, LayerList ll, SVG2gerber::ForWhy fw, const QString & s) + : layerList(ll), name(n), forWhy(fw), suffix(s) + { } }; diff --git a/src/mainwindow/mainwindow.h b/src/mainwindow/mainwindow.h index 69bcf8ebb..84a1870d9 100644 --- a/src/mainwindow/mainwindow.h +++ b/src/mainwindow/mainwindow.h @@ -642,8 +642,8 @@ protected slots: protected: - QUndoGroup *m_undoGroup; - QUndoView *m_undoView; + QUndoGroup *m_undoGroup = nullptr; + QUndoView *m_undoView = nullptr; QPointer m_breadboardWidget; QPointer m_breadboardGraphicsView; @@ -655,7 +655,7 @@ protected slots: QPointer m_pcbGraphicsView; QPointer m_welcomeWidget; - class WelcomeView * m_welcomeView; + class WelcomeView * m_welcomeView = nullptr; QPointer m_binManager; QPointer m_tabWidget; @@ -664,9 +664,9 @@ protected slots: QPointer m_infoView; QPointer m_toolbar; - bool m_closing; - bool m_dontClose; - bool m_firstOpen; + bool m_closing = false; + bool m_dontClose = false; + bool m_firstOpen = false; QPointer m_currentWidget; QPointer m_currentGraphicsView; @@ -815,7 +815,7 @@ protected slots: QAction *m_showPartsBinIconViewAct = nullptr; QAction *m_showPartsBinListViewAct = nullptr; //QAction *m_toggleToolbarAct; - int m_numFixedActionsInViewMenu; + int m_numFixedActionsInViewMenu = 0; // Window Menu QMenu *m_windowMenu = nullptr; From f3d014c5a9de8521eb97db3b006c70c12b94b2bb Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:23:33 -0800 Subject: [PATCH 36/61] Fixes for fritzingwindow via NSDMI --- src/mainwindow/fritzingwindow.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mainwindow/fritzingwindow.h b/src/mainwindow/fritzingwindow.h index 5dca772fb..f5a28e9c8 100644 --- a/src/mainwindow/fritzingwindow.h +++ b/src/mainwindow/fritzingwindow.h @@ -74,12 +74,12 @@ protected slots: virtual bool anyModified(); protected: - class WaitPushUndoStack * m_undoStack; + class WaitPushUndoStack * m_undoStack = nullptr; QString m_fwFilename; - bool m_readOnly; - QAction *m_closeAct; + bool m_readOnly = false; + QAction *m_closeAct = nullptr; QDir m_tempDir; - QStatusBar *m_statusBar; + QStatusBar *m_statusBar = nullptr; protected: static QStringList OtherKnownExtensions; From 2155c2af270445b324db3dffc1a759dd1d0a22b0 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:26:32 -0800 Subject: [PATCH 37/61] NSDMI and init fixes --- src/mainwindow/fritzingwindow.cpp | 1 - src/svg/gedaelement2svg.h | 2 +- src/viewgeometry.cpp | 6 +----- src/viewgeometry.h | 6 +++--- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/mainwindow/fritzingwindow.cpp b/src/mainwindow/fritzingwindow.cpp index 0f9b31c1e..979ad10ac 100644 --- a/src/mainwindow/fritzingwindow.cpp +++ b/src/mainwindow/fritzingwindow.cpp @@ -42,7 +42,6 @@ FritzingWindow::FritzingWindow(const QString &untitledFileName, int &untitledFil : QMainWindow(parent, f) { ___fritzingTitle___ = QObject::tr("Fritzing"); - m_readOnly = false; // Let's set the icon this->setWindowIcon(QIcon(QPixmap(":resources/images/fritzing_icon.png"))); diff --git a/src/svg/gedaelement2svg.h b/src/svg/gedaelement2svg.h index 3f7d6c205..c2e9b6334 100644 --- a/src/svg/gedaelement2svg.h +++ b/src/svg/gedaelement2svg.h @@ -45,7 +45,7 @@ class GedaElement2Svg : public X2Svg QString makeCopper(QStringList ids, QHash &, const QString & filename); protected: - int m_nonConnectorNumber; + int m_nonConnectorNumber = 0; }; diff --git a/src/viewgeometry.cpp b/src/viewgeometry.cpp index a0063d3b0..7b0776fdc 100644 --- a/src/viewgeometry.cpp +++ b/src/viewgeometry.cpp @@ -22,11 +22,8 @@ along with Fritzing. If not, see . #include "utils/graphicsutils.h" ViewGeometry::ViewGeometry( ) - : m_z(-1), - m_loc(-1, -1), + : m_loc(-1, -1), m_line(-1, -1, -1, -1), - m_rect(), - m_selected(false), m_wireFlags(WireFlag::NoFlag) { } @@ -36,7 +33,6 @@ ViewGeometry::ViewGeometry(const ViewGeometry& that) m_loc(that.m_loc), m_line(that.m_line), m_rect(that.m_rect), - m_selected(false), m_wireFlags(that.m_wireFlags), m_transform(that.m_transform) { } diff --git a/src/viewgeometry.h b/src/viewgeometry.h index 3614e2ff8..eaca997e1 100644 --- a/src/viewgeometry.h +++ b/src/viewgeometry.h @@ -61,7 +61,7 @@ class ViewGeometry void setLine(QLineF); constexpr QLineF line() const noexcept { return m_line; } void offset(double x, double y); - bool selected() const noexcept { return m_selected; } + constexpr bool selected() const noexcept { return m_selected; } void setSelected(bool); constexpr QRectF rect() const noexcept { return m_rect; } void setRect(double x, double y, double width, double height); @@ -89,11 +89,11 @@ class ViewGeometry ViewGeometry::WireFlags wireFlags() const; protected: - double m_z; + double m_z = -1; QPointF m_loc; QLineF m_line; QRectF m_rect; - bool m_selected; + bool m_selected = false; WireFlags m_wireFlags; QTransform m_transform; }; From c98425c13c0ebce7935026499c75e9e7e95ad920 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:30:08 -0800 Subject: [PATCH 38/61] NSDMI for updatedialog --- src/version/updatedialog.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/version/updatedialog.h b/src/version/updatedialog.h index 0fd9d1b0a..bc9c1a62e 100644 --- a/src/version/updatedialog.h +++ b/src/version/updatedialog.h @@ -67,17 +67,17 @@ protected slots: void closeEvent(QCloseEvent *); protected: - class VersionChecker * m_versionChecker; - bool m_atUserRequest; + class VersionChecker * m_versionChecker = nullptr; + bool m_atUserRequest = false; QString m_repoPath; QString m_shaFromDataBase; QString m_remoteSha; - QLabel * m_feedbackLabel; - QDialogButtonBox * m_buttonBox; - QProgressBar * m_progressBar; + QLabel * m_feedbackLabel = nullptr; + QDialogButtonBox * m_buttonBox = nullptr; + QProgressBar * m_progressBar = nullptr; PartsCheckerResult m_partsCheckerResult; - bool m_doQuit; - bool m_doClose; + bool m_doQuit = false; + bool m_doClose = false; }; From 2f8b4ff3eab8c6b5c7bd79ea2d1272b3d416b508 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Mon, 11 Nov 2019 18:33:18 -0800 Subject: [PATCH 39/61] More NSDMI for prefsdialog, pegraphicsitem, svg2gerber --- src/dialogs/prefsdialog.h | 6 +++--- src/partseditor/pegraphicsitem.h | 20 ++++++++++---------- src/svg/svg2gerber.cpp | 6 +----- src/svg/svg2gerber.h | 6 +++--- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/dialogs/prefsdialog.h b/src/dialogs/prefsdialog.h index 1d14a9f9c..8dd8ce762 100644 --- a/src/dialogs/prefsdialog.h +++ b/src/dialogs/prefsdialog.h @@ -96,9 +96,9 @@ protected slots: QHash m_settings; QHash m_tempSettings; QString m_name; - class TranslatorListModel * m_translatorListModel; - bool m_cleared; - int m_wheelMapping; + class TranslatorListModel * m_translatorListModel = nullptr; + bool m_cleared = false; + int m_wheelMapping = 0; ViewInfoThing m_viewInfoThings[3]; }; diff --git a/src/partseditor/pegraphicsitem.h b/src/partseditor/pegraphicsitem.h index 0c32eb1e1..1dd44b045 100644 --- a/src/partseditor/pegraphicsitem.h +++ b/src/partseditor/pegraphicsitem.h @@ -74,22 +74,22 @@ protected slots: void restoreColor(); protected: - bool m_highlighted; - bool m_flash; + bool m_highlighted = false; + bool m_flash = false; QDomElement m_element; QPointF m_offset; - bool m_showTerminalPoint; - bool m_showMarquee; + bool m_showTerminalPoint = false; + bool m_showMarquee = false; QPointF m_terminalPoint; QPointF m_pendingTerminalPoint; - bool m_dragTerminalPoint; + bool m_dragTerminalPoint = false; QPointF m_dragTerminalOrigin; QPointF m_terminalPointOrigin; - bool m_drawHighlight; - int m_wheelAccum; - qreal m_savedOpacity; - bool m_pick; - class ItemBase * m_itemBase; + bool m_drawHighlight = false; + int m_wheelAccum = 0; + qreal m_savedOpacity = 0; + bool m_pick = false; + class ItemBase * m_itemBase = nullptr; }; #endif /* PEGRAPHICSITEM_H_ */ diff --git a/src/svg/svg2gerber.cpp b/src/svg/svg2gerber.cpp index 982c83ccc..fdaebc9a7 100644 --- a/src/svg/svg2gerber.cpp +++ b/src/svg/svg2gerber.cpp @@ -25,7 +25,7 @@ along with Fritzing. If not, see . #include #include -static const double MaskClearance = 0.005; // 5 mils clearance +constexpr double MaskClearance = 0.005; // 5 mils clearance bool fillNotStroke(QDomElement & element, SVG2gerber::ForWhy forWhy) { if (forWhy == SVG2gerber::ForOutline) return false; @@ -47,10 +47,6 @@ bool fillNotStroke(QDomElement & element, SVG2gerber::ForWhy forWhy) { //TODO: currently only supports one board per sketch (i.e. multiple board outlines will mess you up) -SVG2gerber::SVG2gerber() -{ -} - int SVG2gerber::convert(const QString & svgStr, bool doubleSided, const QString & mainLayerName, ForWhy forWhy, QSizeF boardSize) { m_boardSize = boardSize; diff --git a/src/svg/svg2gerber.h b/src/svg/svg2gerber.h index 848a4ab51..0a7e503fe 100644 --- a/src/svg/svg2gerber.h +++ b/src/svg/svg2gerber.h @@ -32,7 +32,7 @@ class SVG2gerber : public QObject Q_OBJECT public: - SVG2gerber(); + SVG2gerber() = default; public: enum ForWhy { @@ -56,8 +56,8 @@ class SVG2gerber : public QObject QMultiHash m_platedApertures; QMultiHash m_holeApertures; - double m_pathstart_x; - double m_pathstart_y; + double m_pathstart_x = 0.0; + double m_pathstart_y = 0.0; protected: From e011225950378f9176b516a27d27b44f92a9ca30 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Thu, 14 Nov 2019 17:49:11 -0800 Subject: [PATCH 40/61] Make some fixes as described by Kjell Morgenstern in my pull request - Fixed indentation (spaces -> tabs) - Fixed missing NULL -> nullptr conversions --- src/autoroute/autorouter.cpp | 12 ++++++------ src/partseditor/pemainwindow.cpp | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/autoroute/autorouter.cpp b/src/autoroute/autorouter.cpp index c647e9975..e088ca193 100644 --- a/src/autoroute/autorouter.cpp +++ b/src/autoroute/autorouter.cpp @@ -182,7 +182,7 @@ void Autorouter::initUndo(QUndoCommand * parentCommand) collidingItems = m_sketchWidget->scene()->items(); foreach (QGraphicsItem * item, collidingItems) { auto netLabel = dynamic_cast(item); - if (netLabel == NULL) continue; + if (!netLabel) continue; if (!netLabel->isOnlyNetLabel()) continue; if (netLabel->getAutoroutable()) { @@ -271,11 +271,11 @@ void Autorouter::addUndoConnection(bool connect, ConnectorItem * connectorItem, auto vw = qobject_cast(toConnectorItem->attachedTo()); if (vw) continue; - auto ccc = new ChangeConnectionCommand(m_sketchWidget, crossView, - toConnectorItem->attachedToID(), toConnectorItem->connectorSharedID(), - connectorItem->attachedToID(), connectorItem->connectorSharedID(), - ViewLayer::specFromID(toConnectorItem->attachedToViewLayerID()), - connect, parentCommand); + auto ccc = new ChangeConnectionCommand(m_sketchWidget, crossView, + toConnectorItem->attachedToID(), toConnectorItem->connectorSharedID(), + connectorItem->attachedToID(), connectorItem->connectorSharedID(), + ViewLayer::specFromID(toConnectorItem->attachedToViewLayerID()), + connect, parentCommand); ccc->setUpdateConnections(false); } } diff --git a/src/partseditor/pemainwindow.cpp b/src/partseditor/pemainwindow.cpp index 7b286fe58..e0f7064a5 100644 --- a/src/partseditor/pemainwindow.cpp +++ b/src/partseditor/pemainwindow.cpp @@ -290,16 +290,16 @@ void IconSketchWidget::addViewLayers() { PEMainWindow::PEMainWindow(ReferenceModel * referenceModel, QWidget * parent) : MainWindow(referenceModel, parent), - m_useNextPick(false), - m_inPickMode(false), - m_gaveSaveWarning(false), - m_canSave(false), - m_guid(TextUtils::getRandText()), - m_prefix("prefix0000"), - m_fileIndex(0), - m_peToolView(nullptr), - m_peSvgView(nullptr), - m_connectorsView(nullptr) + m_useNextPick(false), + m_inPickMode(false), + m_gaveSaveWarning(false), + m_canSave(false), + m_guid(TextUtils::getRandText()), + m_prefix("prefix0000"), + m_fileIndex(0), + m_peToolView(nullptr), + m_peSvgView(nullptr), + m_connectorsView(nullptr) { m_settingsPrefix = "pe/"; m_viewThings.insert(ViewLayer::BreadboardView, new ViewThing); @@ -729,7 +729,7 @@ bool PEMainWindow::setInitialItem(PaletteItem * paletteItem) m_pcbGraphicsView->setLayerActive(ViewLayer::Silkscreen0, true); ModelPart * originalModelPart = nullptr; - if (paletteItem == nullptr) { + if (!paletteItem) { // this shouldn't happen originalModelPart = m_referenceModel->retrieveModelPart("generic_ic_dip_8_300mil"); } From f46ec56f8948463f95bbea8c3e424f051a26a579 Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Thu, 14 Nov 2019 17:54:07 -0800 Subject: [PATCH 41/61] Fix overuse of auto in welcomeview.cpp --- src/sketch/welcomeview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sketch/welcomeview.cpp b/src/sketch/welcomeview.cpp index 6d0dbf6fe..d51ea9617 100644 --- a/src/sketch/welcomeview.cpp +++ b/src/sketch/welcomeview.cpp @@ -718,10 +718,10 @@ void WelcomeView::clickRecent(const QString & url) { } void WelcomeView::gotBlogSnippet(QNetworkReply * networkReply) { - auto blog = networkReply->url().toString().contains("blog"); - auto prefix = networkReply->url().scheme() + "://" + networkReply->url().authority(); - auto manager = networkReply->manager(); - auto responseCode = networkReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + bool blog = networkReply->url().toString().contains("blog"); + QString prefix = networkReply->url().scheme() + "://" + networkReply->url().authority(); + QNetworkAccessManager * manager = networkReply->manager(); + int responseCode = networkReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); auto goodBlog = false; QDomDocument doc; @@ -937,7 +937,7 @@ void WelcomeView::gotBlogImage(QNetworkReply * networkReply) { QByteArray data(networkReply->readAll()); QPixmap pixmap; if (pixmap.loadFromData(data)) { - auto scaled = pixmap.scaled(QSize(ImageSpace, ImageSpace), Qt::KeepAspectRatio); + QPixmap scaled = pixmap.scaled(QSize(ImageSpace, ImageSpace), Qt::KeepAspectRatio); setBlogItemImage(scaled, index, blog); foreach (QWidget *widget, QApplication::topLevelWidgets()) { auto other = widget->findChild(); From dc6248cecb362b34f4949e525d82e9057f06e08c Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Tue, 19 Nov 2019 09:36:18 +0100 Subject: [PATCH 42/61] Factor out regex, fix minus sign in MFinder --- pri/boostdetect.pri | 55 +++++++++++++++++----------- src/items/resizableboard.cpp | 3 +- src/svg/gerbergenerator.cpp | 9 +---- src/svg/gerbergenerator.h | 2 - src/svg/svgpathregex.h | 10 +++++ tests/auto/auto.pro | 4 ++ tests/auto/test_svg/test_mfinder.cpp | 27 ++++++++++++++ tests/auto/test_svg/test_svg.pro | 23 ++++++++++++ tests/tests.pro | 4 ++ 9 files changed, 105 insertions(+), 32 deletions(-) create mode 100644 src/svg/svgpathregex.h create mode 100644 tests/auto/auto.pro create mode 100644 tests/auto/test_svg/test_mfinder.cpp create mode 100644 tests/auto/test_svg/test_svg.pro create mode 100644 tests/tests.pro diff --git a/pri/boostdetect.pri b/pri/boostdetect.pri index a8bc7058d..279d80660 100644 --- a/pri/boostdetect.pri +++ b/pri/boostdetect.pri @@ -13,30 +13,41 @@ # along with Fritzing. If not, see . # ********************************************************************/ -# boost_1_54_0 is buggy -BOOSTS = 43 44 45 46 47 48 49 50 51 52 53 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 -LATESTBOOST = 0 -for(boost, BOOSTS) { - exists(../../boost_1_$${boost}_0) { - LATESTBOOST = $$boost - } - exists(../src/lib/boost_1_$${boost}_0) { - LATESTBOOST = $$boost +exists($$boost_root) { + INCLUDEPATH += $$absolute_path($$boost_root) + message("using boost $$absolute_path($$boost_root)") +} else { +# exists($$BOOST_ROOT) { +# INCLUDEPATH += $$BOOST_ROOT +# message("using BOOST_ROOT environment") +# } else { + # message("Boost auto detect is deprecated, please set boost root variable.") + message("Using fritzing boost detect script.") + + # boost_1_54_0 is buggy + BOOSTS = 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 + LATESTBOOST = 0 + + for(boost, BOOSTS) { + exists($$absolute_path(../../boost_1_$${boost}_0)) { + LATESTBOOST = $$boost + } } -} -contains(LATESTBOOST, 0) { - qtCompileTest(boost) - config_boost { - LATESTBOOST = installed - !build_pass:message("using installed Boost library") - } else { - message("Boost 1.54 has a bug in a function that Fritzing uses, so download or install some other version") - error("Easiest to copy the Boost library to ..., so that you have .../boost_1_xx_0") + contains(LATESTBOOST, 0) { + qtCompileTest(boost) + config_boost { + LATESTBOOST = installed + !build_pass:message("using installed Boost library") + } else { + message("Boost 1.54 has a bug in a function that Fritzing uses, so download or install some other version") + error("Easiest to copy the Boost library to ..., so that you have .../boost_1_xx_0") + } } -} -!contains(LATESTBOOST, installed) { - message("using boost_1_$${LATESTBOOST}_0") - INCLUDEPATH += src/lib/boost_1_$${LATESTBOOST}_0 ../boost_1_$${LATESTBOOST}_0 + + !contains(LATESTBOOST, installed) { + message("using boost_1_$${LATESTBOOST}_0") + INCLUDEPATH += $$absolute_path(../../boost_1_$${LATESTBOOST}_0) + } } diff --git a/src/items/resizableboard.cpp b/src/items/resizableboard.cpp index f9357e8e3..bdcb8d362 100644 --- a/src/items/resizableboard.cpp +++ b/src/items/resizableboard.cpp @@ -27,6 +27,7 @@ along with Fritzing. If not, see . #include "../sketch/infographicsview.h" #include "../svg/svgfilesplitter.h" #include "../commands.h" +#include "../svg/svgpathregex.h" #include "moduleidnames.h" #include "../layerattributes.h" #include "../debugdialog.h" @@ -420,7 +421,7 @@ void Board::moreCheckImage(const QString & filename) { int mCount = 0; if (element.tagName() == "path") { QString originalPath = element.attribute("d", "").trimmed(); - if (GerberGenerator::MultipleZs.indexIn(originalPath) >= 0) { + if (MultipleZs.indexIn(originalPath) >= 0) { QStringList ds = element.attribute("d").split("z", QString::SkipEmptyParts); subpaths = ds.count(); foreach (QString d, ds) { diff --git a/src/svg/gerbergenerator.cpp b/src/svg/gerbergenerator.cpp index 9d1f7ccc3..28ec8c94d 100644 --- a/src/svg/gerbergenerator.cpp +++ b/src/svg/gerbergenerator.cpp @@ -25,6 +25,7 @@ along with Fritzing. If not, see . #include "gerbergenerator.h" #include "../debugdialog.h" +#include "svgpathregex.h" #include "../fsvgrenderer.h" #include "../sketch/pcbsketchwidget.h" #include "../connectors/connectoritem.h" @@ -36,11 +37,6 @@ along with Fritzing. If not, see . #include "../utils/folderutils.h" #include "../version/version.h" -static const QRegExp AaCc("[aAcCqQtTsS]"); -//static const QRegExp MFinder("([mM])\\s*([0-9.]*)[\\s,]*([0-9.]*)"); -static const QRegExp MFinder("([mM])\\s*([+-\\.\\d]+)[\\s,]+([+-\\.\\d]+)"); -const QRegExp GerberGenerator::MultipleZs("[zZ]\\s*[^\\s]"); - const QString GerberGenerator::SilkTopSuffix = "_silkTop.gto"; const QString GerberGenerator::SilkBottomSuffix = "_silkBottom.gbo"; const QString GerberGenerator::CopperTopSuffix = "_copperTop.gtl"; @@ -864,9 +860,8 @@ bool GerberGenerator::dealWithMultipleContours(QDomElement & root, bool displayM QString originalPath = path.attribute("d", "").trimmed(); if (MultipleZs.indexIn(originalPath) >= 0) { QStringList subpaths = path.attribute("d").split("z", QString::SkipEmptyParts, Qt::CaseInsensitive); - QString priorM; MFinder.indexIn(subpaths.at(0).trimmed()); - priorM += MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; + QString priorM = MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; for (int i = 1; i < subpaths.count(); i++) { QDomElement newPath = path.cloneNode(true).toElement(); QString z = ((i < subpaths.count() - 1) || originalPath.endsWith("z", Qt::CaseInsensitive)) ? "z" : ""; diff --git a/src/svg/gerbergenerator.h b/src/svg/gerbergenerator.h index a2f9a96d2..92aab2397 100644 --- a/src/svg/gerbergenerator.h +++ b/src/svg/gerbergenerator.h @@ -51,8 +51,6 @@ class GerberGenerator static const QString MagicBoardOutlineID; static const double MaskClearanceMils; - static const QRegExp MultipleZs; - protected: static int doSilk(LayerList silkLayerIDs, const QString & silkName, const QString & gerberSuffix, ItemBase * board, PCBSketchWidget * sketchWidget, const QString & filename, const QString & exportDir, bool displayMessageBoxes, const QString & clipString); diff --git a/src/svg/svgpathregex.h b/src/svg/svgpathregex.h new file mode 100644 index 000000000..d8816791b --- /dev/null +++ b/src/svg/svgpathregex.h @@ -0,0 +1,10 @@ +#ifndef SVGPATHPARSER_H +#define SVGPATHPARSER_H + +#include + +static const QRegExp AaCc("[aAcCqQtTsS]"); +static const QRegExp MFinder("([mM])\\s*([-+\\.\\d]+)[\\s,]+([-+\\.\\d]+)"); +static const QRegExp MultipleZs("[zZ]\\s*[^\\s]"); + +#endif diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro new file mode 100644 index 000000000..5db9e8bff --- /dev/null +++ b/tests/auto/auto.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs + +SUBDIRS = test_svg + diff --git a/tests/auto/test_svg/test_mfinder.cpp b/tests/auto/test_svg/test_mfinder.cpp new file mode 100644 index 000000000..d3b9596ea --- /dev/null +++ b/tests/auto/test_svg/test_mfinder.cpp @@ -0,0 +1,27 @@ +#define BOOST_TEST_MODULE SVG Tests +#include + +//#include + +#define private public +#include "svg/svgpathregex.h" + +BOOST_AUTO_TEST_CASE( mfinder ) +{ + QString input1 = "M11488.1,3614.03L78.7354,3614.03C35.1135,3614.03,0,3578.92,0,3535.3L0,78.7298C0,35.1078,35.1135"; + MFinder.indexIn(input1.trimmed()); + QString priorM = MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; + BOOST_REQUIRE_EQUAL(priorM.toStdString(), std::string("M11488.1,3614.03 ")); + + QString input2 = "m-800.008,0 m-924.988,0 m-2550.01,0L7094.74,243.586l-133.688,0l0,-57.5969l-199.138,0l0,57.5969l-133.708,0l0,232.279z"; + MFinder.indexIn(input2.trimmed()); + priorM = MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; + BOOST_REQUIRE_EQUAL(priorM.toStdString(), std::string("m-800.008,0 ")); + + // FIXME + // We currently ingore this kind of malformed svg path and pass on an single ", " + QString input3 = "m,924.988,0L3644.74,243.586l-133.688,0l0,-57.5969l-199.138,0l0,57.5969l-133.708,0l0,232.279z"; + MFinder.indexIn(input3.trimmed()); + priorM = MFinder.cap(1) + MFinder.cap(2) + "," + MFinder.cap(3) + " "; + BOOST_REQUIRE_EQUAL(priorM.toStdString(), std::string(", ")); +} diff --git a/tests/auto/test_svg/test_svg.pro b/tests/auto/test_svg/test_svg.pro new file mode 100644 index 000000000..82e85b863 --- /dev/null +++ b/tests/auto/test_svg/test_svg.pro @@ -0,0 +1,23 @@ +# /******************************************************************* +# Part of the Fritzing project - http://fritzing.org +# Copyright (c) 2019 Fritzing +# Fritzing is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# Fritzing is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with Fritzing. If not, see . +# ********************************************************************/ + +include($$absolute_path(../../../pri/boostdetect.pri)) + +HEADERS += $$files(*.h) +SOURCES += $$files(*.cpp) + +INCLUDEPATH += $$absolute_path(../../../src) +#INCLUDEPATH += $$top_srcdir +# unix:QMAKE_POST_LINK = $$PWD/generated/test_svg diff --git a/tests/tests.pro b/tests/tests.pro new file mode 100644 index 000000000..804d671c7 --- /dev/null +++ b/tests/tests.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs + +SUBDIRS = auto + From e64ae00ac10596b2e35b9e0e07cee053e1134031 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Tue, 19 Nov 2019 16:21:01 +0100 Subject: [PATCH 43/61] Fix boostdetect for MacOS --- pri/boostdetect.pri | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pri/boostdetect.pri b/pri/boostdetect.pri index 279d80660..379d212f8 100644 --- a/pri/boostdetect.pri +++ b/pri/boostdetect.pri @@ -13,6 +13,7 @@ # along with Fritzing. If not, see . # ********************************************************************/ + exists($$boost_root) { INCLUDEPATH += $$absolute_path($$boost_root) message("using boost $$absolute_path($$boost_root)") @@ -24,12 +25,15 @@ exists($$boost_root) { # message("Boost auto detect is deprecated, please set boost root variable.") message("Using fritzing boost detect script.") + # boost_1_54_0 is buggy - BOOSTS = 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 + BOOSTS = 43 44 45 46 47 48 49 50 51 52 53 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 LATESTBOOST = 0 - for(boost, BOOSTS) { - exists($$absolute_path(../../boost_1_$${boost}_0)) { + exists(../../boost_1_$${boost}_0) { + LATESTBOOST = $$boost + } + exists(../src/lib/boost_1_$${boost}_0) { LATESTBOOST = $$boost } } @@ -45,9 +49,8 @@ exists($$boost_root) { } } - !contains(LATESTBOOST, installed) { message("using boost_1_$${LATESTBOOST}_0") - INCLUDEPATH += $$absolute_path(../../boost_1_$${LATESTBOOST}_0) + INCLUDEPATH += src/lib/boost_1_$${LATESTBOOST}_0 ../boost_1_$${LATESTBOOST}_0 } -} +} \ No newline at end of file From ab28b3b6cb4112bc18a1969de3ecab8fe8dce84f Mon Sep 17 00:00:00 2001 From: Kjell Date: Wed, 20 Nov 2019 12:02:40 +0100 Subject: [PATCH 44/61] Add start labels --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ce58c11e3..d3fbe6516 100644 --- a/README.md +++ b/README.md @@ -12,19 +12,21 @@ The Fritzing application is an Electronic Design Automation software with a low * To report a problem or suggest improvements, use the [issue tracker](https://github.com/fritzing/fritzing-app/issues) or the [user forum](http://forum.fritzing.org). Please provide steps, what operating system you are on, including the version. Add screenshots or copies of error messages, describe what behavior you saw and what you expected. -* If you would like to help with the development, please take a look at the [developer instructions](https://github.com/fritzing/fritzing-app/wiki). This includes information about how to compile and run the Fritzing app in a few steps. +* If you would like to help with the development, please take a look at those labels: + * [![label: easy start][~easy start]](https://github.com/fritzing/fritzing-app/labels/easy%20start) + * [![label: challenging start][~challenging start]](https://github.com/fritzing/fritzing-app/labels/challenging%20start) + +Some of those don't need C++ skills, like reproducing an issue on a certain platform, or verifying translations of languages we don't speak. If there is something for you, you might want to check the [developer instructions](https://github.com/fritzing/fritzing-app/wiki) next. This includes information about how to compile and run the Fritzing app. ## Project Structure -* **help** - End-user documentation included with the app. This should really be moved back to the website. +* **help** - End-user documentation included with the app. * **parts** - All the part definitions, including meta data (.fzp) and graphics (.svg), as well as some utility tools. They are kept in a separate repository at [https://github.com/fritzing/fritzing-parts](http://github.com/fritzing/fritzing-parts) and only linked from here. * **pri** - Submodule definitions for Qt -* **config.tests** - Files needed by Qt to determine if the boost is installed. See README there. - -* **resources** - Binaries and definitions that are supposed to not be touched by users, such as fonts, images, special parts, etc. +* **resources** - Binaries and definitions that are supposed not to be touched by users, such as fonts, images, special parts, etc. * **sketches** - Example circuits/sketches shipped with the application @@ -40,16 +42,20 @@ The Fritzing app was maintained by the Friends-of-Fritzing e.V., a non-profit fo The founding team consists of Prof. Reto Wettach, André Knörig, Jonathan Cohen, and Stefan Hermann. Many [fantastic people](http://fritzing.org/about/people/) have contributed to it over the years. -Since 2019, the project is maintained by Kjell Morgenstern, with great support from Peter Van Epp, André Knörig and AISLER. +Since 2019, the project is maintained by Kjell Morgenstern, with great support from Peter Van Epp, André Knörig, and AISLER. The Fritzing app is written on top of the [Qt cross-platform framework](http://qt-project.org). ## Licensing -The source code of Fritzing is licensed under GNU GPL v3, the documentation and part designs under Creative Commons Attribution-ShareALike 3.0 Unported. The full text of these licenses are shipped with this download. +The source code of Fritzing is under GNU GPL v3, the documentation and part designs under Creative Commons Attribution-ShareALike 3.0 Unported. The full texts of these licenses are shipped with this download. This means that you can create your own variation of Fritzing, as long as you credit us and also publish it under GPL. Similarly, you may re-publish our documentation, as long as you credit us, and publish it under the same license. You may publish circuits and diagrams that you create with Fritzing and that use our graphics, again as long as you credit us, and publish your works under the same license. A credit can be as simple as "this image was created with Fritzing." -Look up [our FAQs](http://fritzing.org/faq/) for more details on licensing. +Lookup [our FAQs](http://fritzing.org/faq/) for more details on licensing. + +[~help wanted]: https://img.shields.io/badge/-help%20wanted-%23159818 +[~easy start]: https://img.shields.io/badge/-easy%20start-%2333AAFF +[~challenging start]: https://img.shields.io/badge/-challenging%20start-%235500EE From aa03a34bd7c296e9394452bbba6b10ced2a95fae Mon Sep 17 00:00:00 2001 From: Ben Brian Date: Mon, 10 Jul 2017 15:48:10 -0400 Subject: [PATCH 45/61] Updates SVG font handling for single-quoted font-family inside style attribute --- src/utils/textutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/textutils.cpp b/src/utils/textutils.cpp index b98e9e1ad..961a068e7 100644 --- a/src/utils/textutils.cpp +++ b/src/utils/textutils.cpp @@ -118,7 +118,7 @@ FixedFontsHash fixFontsMapping(const QSet fontsTofix, const QString & d } bool removeFontFamilySingleQuotes(QString &fileContent) { - static QString pattern = "font-family=\"('[^']*')\""; + static QString pattern = "font-family(?:=\"|:)('[^']*')\"?"; QSet wrongFontFamilies = TextUtils::getRegexpCaptures(pattern, fileContent); foreach(QString ff, wrongFontFamilies) { From 6cc1c5ff4c11b16694a355b46883af2c3b27b808 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Thu, 21 Nov 2019 14:46:42 +0100 Subject: [PATCH 46/61] Add unit test for removing single quotes --- src/utils/textutils.cpp | 7 ++-- src/utils/textutils.h | 3 +- tests/auto/test_textutils/test_textutils.cpp | 35 ++++++++++++++++++++ tests/auto/test_textutils/test_textutils.pro | 32 ++++++++++++++++++ 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 tests/auto/test_textutils/test_textutils.cpp create mode 100644 tests/auto/test_textutils/test_textutils.pro diff --git a/src/utils/textutils.cpp b/src/utils/textutils.cpp index 961a068e7..8824fd692 100644 --- a/src/utils/textutils.cpp +++ b/src/utils/textutils.cpp @@ -54,6 +54,8 @@ const QString TextUtils::SMDFlipSuffix("___"); const QString TextUtils::RegexFloatDetector = "[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"; const QRegExp TextUtils::floatingPointMatcher(RegexFloatDetector); +static const QString fontFamilyQuotesPattern = R"x(font-family(?:="|:)('[^']*')"?)x"; + static const QRegExp HexExpr("&#x[0-9a-fA-F];"); // static const QRegExp Xmlns("xmlns=([\"|'])[^\"']*\\1"); @@ -117,9 +119,8 @@ FixedFontsHash fixFontsMapping(const QSet fontsTofix, const QString & d return retval; } -bool removeFontFamilySingleQuotes(QString &fileContent) { - static QString pattern = "font-family(?:=\"|:)('[^']*')\"?"; - QSet wrongFontFamilies = TextUtils::getRegexpCaptures(pattern, fileContent); +bool TextUtils::removeFontFamilySingleQuotes(QString &fileContent) { + QSet wrongFontFamilies = TextUtils::getRegexpCaptures(fontFamilyQuotesPattern, fileContent); foreach(QString ff, wrongFontFamilies) { QString wrongFF = ff; diff --git a/src/utils/textutils.h b/src/utils/textutils.h index 80dfe5c86..ef1fe2bf2 100644 --- a/src/utils/textutils.h +++ b/src/utils/textutils.h @@ -147,7 +147,8 @@ class TextUtils static bool fixViewBox(QDomElement & root); static void chopNotDigits(QString &); static void collectTransforms(QDomElement & root, QList & transforms); - +private: + static bool removeFontFamilySingleQuotes(QString &fileContent); }; #endif diff --git a/tests/auto/test_textutils/test_textutils.cpp b/tests/auto/test_textutils/test_textutils.cpp new file mode 100644 index 000000000..3985244d9 --- /dev/null +++ b/tests/auto/test_textutils/test_textutils.cpp @@ -0,0 +1,35 @@ +#define BOOST_TEST_MODULE SVG Tests +#include + +//#include + +#define private public +#include "textutils.h" + +BOOST_AUTO_TEST_CASE( test_removeFontFamilySingleQuotes ) +{ + QString input1 = R"(g-text-style=“font-family:Droid Sans;text-anchor:middle;”)"; + QString input2 = R"(g-text-font-family=“Droid Sans”)"; + QString input3 = R"(style="font-family:‘Droid Sans’")"; + QString input4 = R"(style="font-family:'Droid Sans'")"; + QString input5 = R"x(echo)x"; + + bool changed; + changed = TextUtils::removeFontFamilySingleQuotes(input1); + BOOST_REQUIRE(!changed); + + changed = TextUtils::removeFontFamilySingleQuotes(input2); + BOOST_REQUIRE(!changed); + + // We can probably not process opening and closing single quotes, but + // I don't think they are valid svg anyhow. + changed = TextUtils::removeFontFamilySingleQuotes(input3); + BOOST_REQUIRE(!changed); + + changed = TextUtils::removeFontFamilySingleQuotes(input4); + BOOST_REQUIRE(changed); + + changed = TextUtils::removeFontFamilySingleQuotes(input5); + BOOST_REQUIRE(changed); + +} diff --git a/tests/auto/test_textutils/test_textutils.pro b/tests/auto/test_textutils/test_textutils.pro new file mode 100644 index 000000000..9c2890768 --- /dev/null +++ b/tests/auto/test_textutils/test_textutils.pro @@ -0,0 +1,32 @@ +# /******************************************************************* +# Part of the Fritzing project - http://fritzing.org +# Copyright (c) 2019 Fritzing +# Fritzing is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# Fritzing is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with Fritzing. If not, see . +# ********************************************************************/ + +boost_root = ../../boost_1_70_0 +include($$absolute_path(../../../pri/boostdetect.pri)) + +QT += core xml +#concurrent core gui network printsupport serialport sql svg widgets xml + +HEADERS += $$files(*.h) +SOURCES += $$files(*.cpp) + +INCLUDEPATH += $$absolute_path(../../../src) +#INCLUDEPATH += $$top_srcdir + +HEADERS += $$files(../../../src/utils/textutils.h) +SOURCES += $$files(../../../src/utils/textutils.cpp) +INCLUDEPATH += $$absolute_path(../../../src/utils) +# FLIBS += textutils + From 44c260798297e9ae80894dcb9e0d84e657804d62 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 20 Nov 2019 02:31:23 +0100 Subject: [PATCH 47/61] Add italian translations from 5volts --- translations/fritzing_it.ts | 3358 ++++++++++++++++++++++++++++------- 1 file changed, 2702 insertions(+), 656 deletions(-) diff --git a/translations/fritzing_it.ts b/translations/fritzing_it.ts index 688a997b2..1e19354c0 100644 --- a/translations/fritzing_it.ts +++ b/translations/fritzing_it.ts @@ -4,213 +4,278 @@ AboutBox + <a href="http://www.fritzing.org">www.fritzing.org</a> <a href="http://www.fritzing.org">www.fritzing.org</a> + <b>GNU GPL v3 on the code and CreativeCommons:BY-SA on the rest <b>GNU GPL v3 sul codice e CreativeCommons:BY-SA su tutto il resto + Fritzing is made by: - + Fritzing è fatto da: + Prof. Reto Wettach, Andr&eacute; Kn&ouml;rig, Myriel Milicevic, + Zach Eveland, Dirk van Oosterbosch, + Jonathan Cohen, Marcus Paeschke, Omer Yosha, + Travis Robertson, Stefan Hermann, Brendan Howell, + Mariano Crowe, Johannes Landstorfer, - Bryant Mairs, Uleshka Asher, and Daniel Tzschentke. - - - + Special thanks goes out to: + Jussi &Auml;ngeslev&auml;, Massimo Banzi, Ayah Bdeir, + Durrell Bishop, David Cuartielles, Fabian Hemmert, + Gero Herkenrath, Jeff Hoefs, Tom Hulbert, + Tom Igoe, Hans-Peter Kadel, Till Savelkoul, + Jan Sieber, Yaniv Steiner, Olaf Val, + Michaela Vieser and Julia Werner. + to Gianluca Urgese for the Italian translation, + to Gianluca Urgese and 5volts for the Italian translation, + + + Fritzing is made possible with funding from the + MWFK Brandenburg, the sponsorship of the Design + Department of Bauhaus-University Weimar, + IxDS, an anonymous donor, Parallax, Picaxe, Sparkfun, + Special thanks goes out as well to all the students + and alpha testers who were brave enough to give + Fritzing a test spin. + and from each purchase of a Fritzing Starter Kit or a PCB from Fritzing Fab. Version %1.%2.%3 <small>(%4%5 %6) %7 [Qt %8]</small> - + Versione %1.%2.%3 <small>(%4%5 %6) %7 [Qt %8]</small> + Jenny Chowdhury, Lionel Michel, Fabian Althaus, Jannis Leidel, + <b>2007-%1 Fritzing</b> - Thanks for the translations go out to: + + Version %1.%2.%3 <br><small>(%4%5 %6) %7 [Qt %8]</small> - Spanish: + + Bryant Mairs, Uleshka Asher, Daniel Tzschentke, - Italian: + + and Kjell Morgenstern - Portuguese (European): + + Thanks for the translations go out to: - Portuguese (Brazilian): + + Bulgarian: + Chinese (Simplified): - Japanese: + + Yuelin and Ninjia - Russian: + + Chinese (Traditional): - Dutch: + + Robert Lee + Czech: - Korean: + + Dutch: - Slovak: + + French: + Greek: - French: + + Italian: - Turkish: + + Japanese: - Bulgarian: + + Hiroshi Suzuki - Yuelin and Ninjia + + Korean: - Chinese (Traditional): + + Jinbuhm Kim - Robert Lee + + Portuguese (European): - Hiroshi Suzuki + + Portuguese (Brazilian): - Jinbuhm Kim + + Slovak: + + + + + Spanish: + + + + + Russian: + + + + + Turkish: AutorouteProgressDialog + Cancel - Annulla + Annulla + Stop Now - + Ferma Ora + zoom and pan controls - + controlli zoom e pan + Best So Far @@ -218,6 +283,7 @@ Autorouter + Routing canceled! Now cleaning up... @@ -225,245 +291,305 @@ AutorouterSettingsDialog + Production type - + Tipo di produzione + homebrew - + casalinga + professional - + professionale + custom - + personalizzata + Trace width - + Larghezza traccia + Cancel - Annulla + Annulla + OK - OK + OK + Keepout - + Distanziamento + <b>Keepout</b> is the minimum distance between copper elements on different nets. - + Il <b>distanziamento</b> (keepout) è la distanza minima fra gli elementi in rame di circuiti differenti. + A keepout of 0.01 inch (0.254 mm) is a good default. - + Un distanziamento di 0.01 pollici (0.254 mm) è un buon valore predefinito. + Note: the smaller the keepout, the slower the DRC and Autorouter will run. - + Nota: più è ridotto il distanziamento, più sono lenti il DRC e l'Autoinstradamento. BinManager + Parts Componenti + New bin (%1) Nuovo Componente (%1) + BinManager::setDirtyTab: Couldn't set the bin '%1' as dirty + Fritzing Bin Files (*%1 *%2);;Fritzing Bin (*%1);;Fritzing Shareable Bin (*%2) + Cannot set a NULL bin as the current one + BinManager::updateTitle: Couldn't set the bin '%1' as dirty + Select a Fritzing Parts Bin file to open + Bin - Cesto + Cesto + New Bin... - + Nuovo Cesto... + Create a new parts bin + Close Bin - + Chiudi Cesto + Close parts bin + Delete Bin - + Cancella Cesto + Delete parts bin + Save Bin - + Salva Cesto + Save parts bin + Save Bin As... - + Salva Cesto Come... + Save parts bin as... + Export Bin... - + Esporta Cesto... + Save parts bin in compressed format... + Rename Bin... - + RInomina Cesto... + Rename parts bin... + Show Bin in List View - + Mostra Cesto come Lista + Display parts as a list + Show Bin in Icon View - + Mostra Cesto come Icone + Display parts as icons + Export Part... - + Esporta Parte... + Remove Part - + Rimuovi Parte + Delete bin + Do you really want to delete bin '%1'? This action cannot be undone. - + Vuoi davvero cancellare il cesto '%1'? Questa azione non può essere annullata. + Read-only bin + This bin cannot be renamed. + Rename bin - Rinomina cesto + Rinomina cesto + Please choose a name for the bin: - Seleziona un nome per il cesto: + Seleziona un nome per il cesto: + Remove from bin - Rimuovi dal cesto + Rimuovi dal cesto + Searching... - + Ricerca... + Import... - + Importa... + Load a Fritzing part (.fzpz), or a Fritzing parts bin (.fzb, .fzbz) + Select a Fritzing File to Open - Seleziona un File di Fritzing da aprire + Seleziona un File di Fritzing da aprire + Fritzing Files (*%1 *%2 *%3);;Fritzing Part (*%1);;Fritzing Bin (*%2);;Fritzing Shareable Bin (*%3) + Edit Part (new parts editor)... - + Modifica (editor parti nuove)... + Find Part in Sketch - + Trova parte nello Sketch + Remove from Bin + Unable to remove part '%1'--it is in use in a sketch + Do you really want to remove '%1' from the bin? This operation cannot be undone. + Copy to Sketch + Copy all the parts in the bin to a sketch + Copy all to Sketch + Copy all loaded parts to the sketch @@ -471,89 +597,110 @@ Board + one layer (single-sided) - + un livello (singolo lato) + two layers (double-sided) - + due livelli (doppio lato) + Have a look at the circle_pcb.svg file in your Fritzing installation folder at parts/svg/core/pcb/. + image file - + file immagine + load image file - + carica file immagine + Images - + Immagini + Select an image file to load + due to an xml problem: %1 line:%2 column:%3 + because the xml is not correctly formatted + the <board> element contains no shape elements + because there are multiple <board> layers + because there are multiple <silkscreen> layers + because there is no <board> layer + the svg contains no shape elements + but the pcb itself will have no silkscreen layer + the svg doesn't fit the custom board format + Unable to load + Unable to load image from %1 %2 + Can load, but + The image from %1 can be loaded, but %2 Use the file? + A custom board svg typically has one or two silkscreen layers and one board layer. @@ -561,34 +708,42 @@ A custom board svg typically has one or two silkscreen layers and one board laye + because there are multiple <silkscreen0> layers + <b>The custom shape has been loaded, and you will see the new board shortly.</b><br/><br/> + Before actual PCB production we recommend that you test your custom shape by using the 'File > Export for Production > Extended Gerber' option. + Check the resulting contour file with a Gerber-viewer application to make sure the shape came out as expected.<br/><br/> + The rest of this message concerns 'cutouts'. + These are circular or irregularly-shaped holes that you can optionally incorporate into a custom PCB shape.<br/><br/> + <b>The custom shape has no cutouts.</b> + <b>The custom shape has %n cutouts.</b> @@ -596,14 +751,17 @@ A custom board svg typically has one or two silkscreen layers and one board laye + <br/>However, the cutouts may not be formatted correctly. + <br/><br/>If you intended your custom shape to have cutouts and you did not get the expected result, + it is because Fritzing requires that you make cutouts using a shape 'subtraction' or 'difference' operation in your vector graphics editor. @@ -611,21 +769,26 @@ A custom board svg typically has one or two silkscreen layers and one board laye BoardLogoItem + shape - + forma BreadboardLogoItem + + color - colore + colore + Set text color + Select text color @@ -633,6 +796,7 @@ A custom board svg typically has one or two silkscreen layers and one board laye Capacitor + Select from the dropdown, or type in a %1 value @@ -640,109 +804,135 @@ A custom board svg typically has one or two silkscreen layers and one board laye ConnectorItem + Add bendpoint - + Aggiungi gomito + Remove bendpoint - + Rimuovi gomito + Straighten curve - + Raddrizza curva ConsoleSettings + Settings - + Impostazioni + Select Parameters + BaudRate: + Data bits: + Parity: + Stop bits: + Flow control: + Select Serial Port + Description: + Manufacturer: - + Produttore: + Serial number: + Location: - + Posizione: + Vendor ID: + Product ID: + Apply + Additional options + Local echo + Description: %1 + Manufacturer: %1 + Serial number: %1 + Location: %1 - + Posizione: %1 + Vendor Identifier: %1 + Product Identifier: %1 @@ -750,114 +940,142 @@ A custom board svg typically has one or two silkscreen layers and one board laye ConsoleWindow + Serial Monitor - + Monitor Seriale + Monitor + Tools - + Strumenti + &About - &Informazioni + &Informazioni + About program + Alt+A + About Qt + C&onnect + Connect to serial port + Ctrl+O + &Disconnect + Disconnect from serial port + Ctrl+D + &Configure + Configure serial port + Alt+C + C&lear + Clear data + Alt+L + &Quit - &Esci + &Esci + Ctrl+Q + Connected to %1 : %2, %3, %4, %5, %6 + Error + Serial port open error + Disconnected + Critical Error + About Serial Monitor + This terminal displays the serial communication on the selected port, usually between your computer and the connected microcontroller. @@ -865,50 +1083,62 @@ A custom board svg typically has one or two silkscreen layers and one board laye DRC + DRC was cancelled. + Your sketch is ready for production: there are no connectors or traces that overlap or are too close together. + The areas on your board highlighted in red are connectors and traces which may overlap or be too close together. + Reposition them and run the DRC again to find more problems + Fritzing error: unable to render board svg. + No traces or connectors to check + Unexpected SVG rendering failure--contact fritzing.org + Fritzing + %1 is overlapping (%2 layer) + Too close to a border (%1 layer) + A hole in %1 may lie outside the border of the board and would be clipped. + Connector %1 on %2 should have both copper top and bottom layers, but the svg only specifies one layer. @@ -916,14 +1146,17 @@ A custom board svg typically has one or two silkscreen layers and one board laye DRCResultsDialog + DRC Results + Note: the list items and the red highlighting will not update as you edit your sketch--you must rerun the DRC. The highlighting will disappear when you close this dialog. + Click on an item in the list to highlight of overlap it refers to. @@ -931,6 +1164,7 @@ A custom board svg typically has one or two silkscreen layers and one board laye DebugDialog + for debugging per il debugging @@ -938,14 +1172,17 @@ A custom board svg typically has one or two silkscreen layers and one board laye DeleteDialog + Also delete the file + Remove - Rimuovi + Rimuovi + Don't remove @@ -953,6 +1190,7 @@ A custom board svg typically has one or two silkscreen layers and one board laye Dip + chip label @@ -960,53 +1198,67 @@ A custom board svg typically has one or two silkscreen layers and one board laye FApplication + + + Fritzing failure + Fritzing caught an exception from %1 in event %2 + Fritzing caught an exception %1 from %2 in event %3 + Please specify an .fzz file name to save to (cancel will delete the backup) + Fritzing (*%1) + Fritzing caught an exception from %1 in event %2: %3 + Regenerate parts database? + Regenerating the parts database will take some minutes and you will have to restart Fritzing + Would you like to regenerate the parts database? + Regenerate + Cancel - Annulla + Annulla + Regenerating parts database... @@ -1014,18 +1266,22 @@ A custom board svg typically has one or two silkscreen layers and one board laye FirstTimeHelpDialog + First Time Help - Aiuto prima volta + Aiuto prima volta + <br/>The <b>Breadboard View</b> is meant to look like a <i>real-life</i> breadboard prototype.<br/><br/>Begin by dragging a part from the Parts Bin, which is over at the top right. Then pull in more parts, connecting them by placing them on the breadboard or clicking on the connectors and dragging wires. The process is similar to how you would arrange things in the physical world. <br/><br/>After you're finished creating your sketch in the breadboard view, try the other views. You can switch views by clicking the Tabs at the top of the window. Because different views have different purposes, parts will look different in the other views. + Welcome to the <b>Schematic View</b><br/><br/>This is a more abstract way to look at components and connections than the Breadboard View. You have the same elements as you have on your breadboard, they just look different. This representation is closer to the traditional diagrams used by engineers.<br/><br/>After you have drawn wires between parts, you can press &lt;Shift&gt;-click with the mouse to create bend points and tidy up your connections. The Schematic View can help you check that you have made the right connections between components. You can also print out your schematic for documentation. + The <b>PCB View</b> is where you layout the components will on a physical PCB (Printed Circuit Board).<br/><br/>PCBs can be made at home or in a small lab using DIY etching processes. They also can be sent to professional PCB manufacturing services for more precise fabrication. <br/><table><tr><td>The first thing you will need is a board to place your parts on. There should already be one in your sketch, but if not, drag in the board icon from the Parts Bin. The icon matches the image to the right: </td><td><img src=":resources/parts/svg/core/icon/rectangle_pcb.svg" /></td></tr></table><br/><br/>To lay out your PCB, arrange all the components so they fit nicely on the board. Then try to shift them around to minimize the length and confusion of connections. You can also resize rectangular boards. <br/><table><tr><td>Once the parts are sorted out, you connect them with copper traces. You can drag out a trace from individual connections or use the autorouter to generate them. The Autoroute button is at the bottom of the window. The button matches the image to the right:</td><td><img src=":resources/images/icons/toolbarAutorouteEnabled_icon.png" /></td></tr></table> @@ -1033,10 +1289,12 @@ A custom board svg typically has one or two silkscreen layers and one board laye FolderUtils + Moving your custom parts + <p>Your custom-made parts and bins are moved from the hidden app data folder to your fritzing documents folder at <br/><br/><em>%1</em><br/><br/>This way we hope to make it easier for you to find and edit them manually.</p> @@ -1044,54 +1302,67 @@ A custom board svg typically has one or two silkscreen layers and one board laye FritzingWindow + &Close Window &Chiudi Finestra + Ctrl+W Ctrl+W + Close the current sketch Chiudi lo sketch corrente + %1 - %2 %1 - %2 + Specify a file name Specifica un nome di file + Save "%1" Salva "%1" + Do you want to save the changes you made in the document "%1"? - Vuoi salvare i cambiamenti che hai fatto nel documento "%1"? + Vuoi salvare le modifiche che hai fatto nel documento "%1"? + Save... Salvataggio... + Save Salva + Don't Save Non salvare + Ctrl+D + Your changes will be lost if you don't save them. I tuoi cambiamenti andranno perduti se non li salverai. + Cancel Annulla @@ -1099,6 +1370,7 @@ A custom board svg typically has one or two silkscreen layers and one board laye GroundFillSeedDialog + The difference between a 'ground fill' and plain 'copper fill' is that in a ground fill, the flooded area includes traces and connectors that are connected to 'ground' connectors. Ground connectors are usually labeled 'GND' or 'ground' but sometimes this is not the case. It also may be that there are multiple nets with a ground connector, and you might only want one of the nets to be filled. This dialog collects only connectors labeled 'GND' or 'ground', as well as connectors already chosen as seeds. @@ -1106,1411 +1378,1809 @@ This dialog collects only connectors labeled 'GND' or 'ground&apo Click an item to highlight its connections in the sketch. It is also possible to choose a connector as a ground fill seed by right-clicking a connector and choosing the 'Set Ground Fill Seed' context menu option. - + La differenza fra un 'piano massa' e un semplice 'piano rame' è che nel piano massa l'area ramata include le piste ed i connettori che sono collegati ai connettori di 'massa'. I connettori di massa sono normalmente etichettati GND o 'ground', ma a volte no. Ci possono anche essere diversi circuiti con un connettore di massa, e potresti voler ramare solo un circuito. + +Questa finestra raggruppa solo i connettori marcati 'GND' o 'ground', così come i connettori già scelti come "semi". + +Clicca un elemento per evidenziare le sue connessioni nello sketch. + +E' anche possibile scegliere un connettore come seme per il piano massa con il click destro su un connettore e scegliendo l'opzione 'Imposta Seme Piano Massa'dal menù contestuale. + Cancel - Annulla + Annulla + OK - OK + OK + OK and ground fill - + OK e Piano Massa + OK and copper fill - + OK e Piano Rame Hole + hole size - + dimensione foro HtmlInfoView + Connections Connessioni + conn. conn. + connected to %n item(s) - - connesso a %n elemento(i) - - + + connesso a %n elemento(i) + name nome + type tipo + (autoroutable) (autoinstradabile) + Wire Filo + Trace wire %1 Traccia %1 + Properties Proprietà + Tags - Tag + Etichette + Change the part label here + Part breadboard view image + Part schematic view image + Part pcb view image + Part version number + Locked - + Bloccato + Ratsnest wire + Change the locked state of the part in this view. A locked part can't be moved. + Sticky - + Adesivo + Change the "sticky" state of the part in this view. When a sticky part is moved, objects on top of it also move. + v. %1 %2 + obsolete - + obsoleto + Placement - + Posizionamento + pcb layer - + livello pcb + location - + posizione + rotation - + rotazione + degrees - + gradi ItemBase + Part Componente + family - famiglia + famiglia + color - colore + colore + resistance - resistenza + resistenza + voltage - + voltaggio + + pin spacing - + spaziatura piedini + rated power + rated voltage + rated current + version - + versione + package - + package + shape - + forma + maximum resistance + size - + dimensione + form + model part problem + capacitance - + capacità + inductance - + induttanza + current - + corrente + power - + potenza + part number + type - tipo + tipo + model - + modello + pins - + piedini + spacing - + spaziatura + frequency - + frequenza + processor - + processore + variant - + variante + layers - + livelli + tolerance - + tolleranza + descr - + descr + filename + title - + titolo + date - + data + rev - + rev + sheet + project - + progetto + unable to create renderer for svg %1 + file for %1 %2 not found + banded + top - + sopra + bottom - + sotto + copper bottom - + rame inferiore + copper top - + rame superiore + silkscreen bottom - + silkscreen inferiore + silkscreen top - + silkscreen superiore KicadModuleDialog + Cancel - Annulla + Annulla + OK - OK + OK LayerPalette + show all layers - + mostra tutti i livelli LinkDialog + Cancel Annulla + OK + url: - + url: + text: - + testo: LogoItem - shape + + Unable to display + + + + + Unable to display image from %1 + + shape + forma + + + due to a rendering error + because the svg is empty + due to an xml problem: %1 line:%2 column:%3 + because the file has no root element + because the file has no <svg> element + for unknown reasons--possibly the image file is corrupted + because this appears to be a SVG file exported from CorelDRAW without choosing the 'presentation attributes' setting + + text - - - - Unable to display - - - - Unable to display image from %1 - + testo MainWindow + + Rotate Ruota + Flip Ribalta + + Autoroute Autoinstrada + + Add a note Aggiungi nota + + Ready Pronto + Save %1 Salva %1 + + Specify a file name Specifica un nome per il file + + Fritzing (*%1) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fritzing + Unable to export %1 to shareable sketch Impossibile esportare %1 come sketch condivisibile + Fritzing Part (*%1) Componente di Fritzing (*%1) + + Do you want to keep the imported parts? Vuoi mantenere i componenti importati? + No connections to route Nessuna connessione da instradare + Routing completed Instradamento completato + %1 of %2 nets routed - %n connector(s) still to be routed - - %1 di %2 reti instradate - %n connettore(i) ancora da instradare - - + + %1 di %2 reti instradate - %n connettore(i) ancora da instradare + %1 - [%2] %1 - [%2] + + Sorry! Spiacente! + No part with those characteristics. We're working to avoid this message, and only let you choose between properties that do exist Nussun componente con queste caratteristiche. Stiamo lavorando per evitare questo messaggio, quindi ti chiediamo di scegliere tra le proprietà esistenti + Swapped %1 with module %2 Invertito %1 con il modulo %2 + PDF (*.pdf) - PostScript (*.ps) - - - + PNG Image (*.png) Immagine PNG (*.png) + JPEG Image (*.jpg) Immagine JPEG (*.jpg) + SVG Image (*.svg) Immagine SVG (*.svg) + Printing... In Stampa... + All traces have not yet been routed. Non sono ancora state instradate tutte le tracce. + Do you want to proceed anyway? Vuoi procedere comunque? + + Sketch exported Sketch esportato + Export... Esporta... + Exporting... Esportazione... + Unable to save %1 Impossibile salvare %1 + Cannot print to %1 Non posso stampare su %1 + Cannot write file %1: %2. Non posso scrivere il file %1: %2. + Saved '%1' Salvato '%1' + Select a Fritzing File to Open Seleziona un File di Fritzing da aprire + Cannot find file %1. Non riesco a trovare il file %1. + Cannot read file 1 %1: %2. Non riesco a leggere il file 1 %1: %2. + directly loading parts caricamento diretto componenti + loading %1 (model) carica %1 (modello) + loading %1 (breadboard) carica %1 (breadboard) + loading %1 (pcb) carica %1 (pcb) + loading %1 (schematic) carica %1 (schema) + Create a new sketch Crea nuovo sketch + &Open... &Apri... + Ctrl+O + &Open Recent Files &Apri File Recenti + &Open Example &Apri Esempio + &Save &Salva + Ctrl+S + + Save the current sketch Salva lo sketch corrente + &Save As... &Salva come... + Shift+Ctrl+S + Export the current sketch to Eagle CAD Esporta lo sketch corrente come file CAD di Eagle + &Print... &Stampa... + Ctrl+P + Print the current view Stampa la vista corrente + &Quit &Esci + Ctrl+Q + Quit the application Esci dall'applicazione + &%1 %2 &%1 %2 + + Undo Annulla + + Redo Ripeti + &Cut &Taglia + Cut selection Taglia selezione + &Copy &Copia + Copy selection Copia selezione + &Paste &Incolla + Paste clipboard contents Incolla contenuto della clipboard + &Duplicate &Duplica + Ctrl+D + Duplicate selection Duplica selezione + &Delete &Elimina + Delete selection Elimina selezione + &Select All - &Seleziona tutto + &Seleziona Tutto + Select all elements Seleziona tutti gli elementi + &Deselect &Deseleziona + Deselect Deseleziona + + Add Note Aggiungi nota + &Preferences... &Preferenze... + + Show the application's about box - Mostra la finestra di diaologo dell'applicazione + Mostra la finestra informazionidell'applicazione + Update InfoView on hover Aggiorna InfoView in sospeso + Rotate the selected parts by 90 degrees clockwise Ruota i componenti selezionati di 90 gradi in senso orario + Rotate the selected parts by 180 degrees Ruota i componenti selezionati di 180 gradi + Rotate current selection 90 degrees counter clockwise Ruota la selezione corrente di 90 gradi in senso anti-orario + &Flip Horizontal &Ribalta Orizontalmente + Flip current selection horizontally Ribalta la selezione corrente orizontalmente + &Flip Vertical &Ribalta Verticalmente + Flip current selection vertically Ribalta la selezione corrente verticalmente + Bring to Front Porta in primo piano + Shift+Ctrl+] + Bring selected object(s) to front of their layer Porta l'oggetto selezionato in primo piano nel suo livello + Bring Forward Porta avanti + Ctrl+] + Bring selected object(s) forward in their layer Porta l'oggetto selezionato in avanti sul suo livello + Send Backward Manda indietro + Ctrl+[ + Send selected object(s) back in their layer Manda l'oggetto selezionato indietro sul suo livello + Send to Back Manda dietro + Shift+Ctrl+[ + Send selected object(s) to the back of their layer Manda l'oggetto selezionato dietro sul suo livello + &Show All Layers &Mostra tutti livelli + Show all the available layers for the current view Mostra tutti i livelli disponibili per la vista corrente + &Hide All Layers &Nascondi tutti i livelli + Hide all the layers of the current view Nascondi tutti i livelli della vista corrente + &Show part label &Mostra etichetta componente + &Zoom In &Zoom avanti + Ctrl++ + Zoom in Zoom avanti + Ctrl+= + &Zoom Out &Zoom indietro + Ctrl+- + Zoom out Zoom indietro + &Fit in Window &Adatta alla Finestra + Ctrl+0 + Fit in window Adatta alla Finestra + &Actual Size &Dimensioni attuali + Shift+Ctrl+0 + &Show Breadboard &Mostra Breadboard + Ctrl+1 + Show the breadboard view Mostra la vista Breadboard + &Show Schematic &Mostra Schema + Ctrl+2 + Show the schematic view Mostra la vista Schema + &Show PCB &Mostra PCB + Ctrl+3 + Show the PCB view Mostra la vista PCB + &Minimize &Minimizza + Ctrl+M + Minimize current window Minimizza finestra corrente + Debugger Output Output del Debugger + Ctrl+? Ctrl+? + Open Fritzing help Apri aiuto di Fritzing + Open Fritzing examples Apri esempi Fritzing + Open Parts Reference Apri referenze componenti + First Time Help Aiuto prima volta + Check for updates... Controlla aggiornamenti... + Check whether a newer version of Fritzing is available for download Controlla se è disponibile una nuova versione di Fritzing per il download + &About &Informazioni + &About Qt &Informzaioni su QT + Show Qt's about box Mostra finestra informazioni di Qt + + Report a but you've found in Fritzing Segnala un bug che hai trovato in Fritzing + &File &File + &Export &Esporta + &Edit &Modifica + &Export... &Esporta... + Export selected part Esporta componenti selezionati + Online Tutorials Tutorial Online + Online Projects Gallery Galleria Progetti Online + Online Parts Reference Referimento componenti Online + &Part &Componenti + &View &Visualizza + &Window &Finestra + &Help &Aiuto + Page Setup Impostazioni pagina + Sorry, "%1" has not been implemented yet Spiacente, "%1" non è ancora stato implementato + This will soon provide an export of your Fritzing sketch to the EAGLE layout software. If you'd like to have more exports to your favourite EDA tool, please let us know, or contribute. Questa funzionalità presto permetterà di esportare i tuoi file di Fritzing nel formato EAGLE. Se vorresti più funzionalita di esportazione per il tuo EDA preferito, faccelo sapere o contribuisci. + Export Bill of Materials (BoM)... Esporta Lista dei materiali (BoM)... + Select All Traces - Seleziona tutte le tracce + Seleziona Tutte le Tracce + Select all trace wires - Seleziona tutte le tracce + Seleziona tutte le tracce delle piste + Select all trace wires excluded from autorouting Seleziona tutte le tracce escluse dall'autoinstradamento + Autorouting... Autoinstradamento... + Raise and Lower Sollevare e Abbassare + Svg %1 is missing a '%2' layer. For more information on how to create a custom board shape, see the tutorial at <a href='http://fritzing.org/learning/tutorials/designing-pcb/pcb-custom-shape/'>http://fritzing.org/learning/tutorials/designing-pcb/pcb-custom-shape/</a>. + + Add Bendpoint - + Aggiungi Gomito + Add a bendpoint to the selected wire + Remove Bendpoint - + Rimuovi Gomito + Your sketch does not have a board yet! Please add a PCB in order to export to Gerber. + + Choose a folder for exporting + Export the visible area of the current sketch as a JPG image + Export the visible area of the current sketch as a PNG image - Export the visible area of the current sketch as a PostScript image - - - + Export the visible area of the current sketch as a PDF image + Export the current sketch as an SVG image + Save a Bill of Materials (BoM)/Shopping List as text + Export SVG... + Unable to export %1 as shareable + Proceed + + Cancel - Annulla + Annulla + MainWindow::populateMenuWithIndex: couldn't load example with id='%1' + &Add to bin... - + &Aggiungi al cesto... + Add selected part to bin + Tidy Wires + Tidy selected wires + + &Wire Color + Disconnect All Wires + Disconnect all wires connected to this connector + Display some handy Fritzing tips and tricks + Share - + Condividi + Share online... - + Condividi online... + Post a project to the Fritzing website + List of parts (&Bill of Materials)... + XML Netlist... + Save a netlist in XML format + Export Netlist... + + Copper Fill - + Piano Rame + Remove Copper Fill - + Rimuovi Piano Rame + Remove the copper fill + Remove copper fill + Export Normalized SVG + Export 1000 dpi SVG of this part in this view + Export Normalized Flattened SVG + Export 1000 dpi Flattened SVG of this part in this view + + Select outdated parts - + Seleziona parti obsolete + + Update selected parts - + Aggiorna parti selezionate + No outdated parts found. All your parts are up-to-date. + Outdated parts - + Parti obsolete + Successfully updated %1 part(s). Please check all views for potential side-effects. + Update %1 part(s) + No exactly matching part found; Fritzing chose the closest match. + Shell launch %1 + Launch %1... + All + throw test exception + throw a fake exception to see what happens + Select All Jumpers - + Seleziona Tutti i Jumpers + New - + Nuovo + Ctrl+N + Tips, Tricks and Shortcuts - + Trucchi, Suggerimenti e Scorciatoie + Align to Grid - + Allinea alla Griglia + Align items to grid when dragging + Open programming window + Open microcontroller programming window + Report a bug... - + Segnala un bug... + Enable debugging log - + Abilita log debugging + Both Layers - + Entrambi i Livelli + Bottom Layer - + Livello Inferiore + Top Layer - + Livello Superiore + Backing up '%1' + Rotate current selection 45 degrees counter clockwise - Ruota la selezione corrente di 90 gradi in senso anti-orario {45 ?} + era tradotto "Ruota la selezione corrente di 90 gradi in senso anti-orario {45 ?}" ?!? + Ruota la selezione corrente di 45 gradi in senso anti-orario + Rotate current selection 45 degrees clockwise - + Ruota la selezione corrente di 45 gradi in senso orario + Actual (real world physical) size - + Misura effettiva (fisica mondo reale) + 100% Size - + Dimensione 100% + 100% (pixel) size + + Set both copper layers clickable - + Rendi entrambi i livelli rame cliccabili + + Set copper top layer clickable - + Rendi il livello rame superiore cliccabile + + Set copper bottom layer clickable - + Rendi il livello rame inferiore cliccabile + Copper Top and Copper Bottom layers are both active + Copper Top layer is active + Copper Bottom layer is active + Autorouting Progress... + + File '%1' not found + Paste in Place - + Incolla sul Posto + Paste clipboard contents in place + Delete - + Cancella + Routing completed using %n jumper part(s) @@ -2518,882 +3188,1105 @@ Please check all views for potential side-effects. + Delete Ratsnest Line + Delete Wire + Move selected traces to the other side of the board (note: the 'first' trace will be moved and the rest will follow to the same side) + Force Update Routing Status and Ratsnests + Recalculate routing status and ratsnest wires (in case the auto-update isn't working correctly) + Lock Part - + Blocca Parte + Prevent a part from being moved - + evita che un componente sia spostato + Select All Locked Parts - + Seleziona Tutte le Parti Bloccate + Select all parts that can't be moved + Show Parts Bin Icon View - + Mostra Cesto Parti in Vista a Icone + Display the parts bin in an icon view + Show Parts Bin List View - + Mostra Cesto Parti in Vista a Elenco + Display the parts bin in a list view + Donate to Fritzing - + Dona a Fritzing + Open Fritzing donation web page + Export for PCB - + Esporta per PCB + Export the current sketch to PDF for DIY PCB production (photoresist) + Export the current sketch to SVG for DIY PCB production (photoresist) + JPG... + PNG... - PostScript... - - - + PDF... + SVG... + Eagle... + Etchable (PDF)... - + Fotoincisione (PDF)... + Etchable (SVG)... - + Fotoincisione (SVG)... + as Image - + come Immagine + for Production - + per la Produuzione + loading %1 - + caricamento %1 + Loading... - + Caricamento... + new sketch - + nuovo sketch + BoM Text File (*.html) + Extended Gerber (RS-274X)... + Export the current sketch to Extended Gerber format (RS-274X) for professional PCB production + Unable to save BOM file, but the text is on the clipboard. + Do not autoroute - + Non autoinstradare + When autorouting, do not rip up this trace wire, via, or jumper item + Move to other side of the board + Select all jumper item parts + Select All Vias - + Seleziona tutte le Via + Select all via parts + Shift+Ctrl+D + Order a PCB... - + Ordina un PCB... + Order a PCB created from your sketch--from fabulous Fritzing Fab + Straighten Curve - + Rettifica Curva + Straighten the curve of the selected wire - + Raddrizza la cuva del filo selezionato + Select All CopperFill - + Seleziona Tutti i Piani Rame + Select all copper fill items + unable to find replacement for %1. + Ctrl+R Rotate Clockwise + Alt+Ctrl+R Rotate Clockwise + Meta+Ctrl+R Rotate Clockwise + Shift+Ctrl+R Rotate Counterclockwise + Alt+Shift+Ctrl+R Rotate Counterclockwise + Meta+Shift+Ctrl+R Rotate Counterclockwise + Shift+Ctrl+Tab Toggle Active Layer + Sketch exported to Gerber + Shift+Ctrl+A + Shift+Ctrl+3 + Shift+Ctrl+2 + Shift+Ctrl+1 + + + Ground Fill - + Piano Massa + Fill empty regions of the copper layer--fill will include all traces connected to a GROUND + Fill empty regions of the copper layer--not including traces connected to a GROUND + No copper top layer + The copper top (copper 1) layer is not available on a one-sided board. Please switch the board to double-sided or choose the copper bottom (copper 0) layer. + No Sketch found in '%1' + Convert - + Converti + Read-only + + + &Routing - + &Instradamento + &Create trace from ratsnest + Create a trace from the ratsnest line + &Create wire from ratsnest + Create a wire from the ratsnest line + Select All Wires - + Seleziona Tutti i Fili + Select all wires + Fill empty regions of the copper layer--fill will include all traces connected to the seeds + Choose Ground Fill Seed(s)... - + Scegli Seme/i Piano Massa... + Set Ground Fill Seed - + Imposta Seme Piano Massa + Treat this connector and its connections as a 'ground' during ground fill. + Clear Ground Fill Seeds - + Cancella Seme Piano Massa + Clear ground fill seeds--enable copper fill only. + Generating %1 fill... - + Generazione piano %1... + ground - + massa + copper - + rame + Show Grid - + Mostra Griglia + Show the grid - + Mostra la griglia + Actual Size - + Dimensione Effettiva + It doesn't seem to be possible to automatically determine the actual physical size of the monitor, so 'actual size' as currently implemented is only a guess. Your best bet would be to drag out a ruler part, then place a real (physical) ruler on top and zoom until they match up. + Select All "Don't Autoroute" Traces - + Seleziona Tutte le Tracce "Non Autoinstradare" + Select All Autoroutable Traces - + Seleziona Tutte le Tracce Autoinstradabili + Select all trace wires that can be changed during autorouting + Change to single layer pcb + Change to two layer pcb + Change image to %2 + Gerber export can only handle one board at a time--please select the board you want to export. + Sticky - + Adesivo + If a "sticky" part is moved, parts on top of it are also moved - + Se un componente "adesivo"è spostato, si spostano anche i componenti soprastanti + Set Grid Size... - + Imposta Misura Griglia... + Set the size of the grid in this view + Set Background Color... - + Imposta Colore Sfondo... + Set the background color of this view + jumpers + copperfill + vias + OK - OK + OK + Set the grid size for %1. - + Imposta la dimensione della griglia per la %1. + Grid Size: - + Misura Griglia: + in + mm + Restore Default - + Ripristina Predefinito + Fritzing Files (*%1 *%2 *%3 *%4 *%5);;Fritzing (*%1);;Fritzing Shareable (*%2);;Fritzing Part (*%3);;Fritzing Bin (*%4);;Fritzing Shareable Bin (*%5) + Your sketch does not have a board yet! Please add a PCB in order to export etchable. + Etchable export can only handle one board at a time--please select the board you want to export. + Your sketch does not have a board yet! Please add a PCB in order to use the autorouter. + Please select the board you want to autoroute. The autorouter can only handle one board at a time. + Your sketch does not have a board yet! Please add a PCB in order to use ground or copper fill. + Please select a PCB--copper fill only works for one board at a time. + Your sketch does not have a board yet! Please add a PCB in order to remove copper fill. + Please select a PCB--ground fill operations only work on a one board at a time. + Your sketch does not have a board yet! DRC only works with a PCB. + Please select a PCB. DRC only works on one board at a time. + + Your sketch does not have a board yet! Please add a PCB in order to use copper fill operations. + + Please select a PCB. Copper fill operations only work on one board at a time. + Convert Bendpoint to Via - + Converti Gomito in Via + Convert the bendpoint to a via - + Converte il gomito in una via + Convert Via to Bendpoint - + Converti Via in Gomito + Convert the via to a bendpoint - + Converte la via in un gomito + Revert? - + Ripristino? + This operation can not be undone--you will lose all of your changes. Go ahead and revert? - + Questa operazione non può essere annullata. Perderai tutte le tue modifiche. + +Procedere e ricaricare il file come salvato sul disco? + Open a Fritzing sketch (.fzz, .fz), or load a Fritzing part (.fzpz), or a Fritzing parts bin (.fzb, .fzbz) + Revert - + Ripristina + Reload the sketch - + Ricarica lo sketch + Check Loaded Traces + Unrouted connections + There are no unrouted connections in this view. + Edit (new parts editor) - + Modifica (editor parti nuove) + Open the new parts editor on an existing part + Show unrouted - + Mostra non instradati + Highlight all unrouted connectors + Inspector - Inspector + Inspector + Undo History - Annulla Cronologia + Cronologia Annulla + Breadboard - Breadboard + Breadboard + Schematic - Schema + Schema + PCB - PCB + PCB + Layers - + Livelli + Couldn't get the dock widget + &Delete Wire - + &Cancella Filo + Parts Editor Help - + Aiuto Editor Parti + Display Parts Editor help in a browser + Design Rules Check (DRC) + DRC Progress... + Highlights any parts that are too close together for safe board production + Autoroute connections... + Show/hide the label for the selected parts + + Hide part silkscreen - + Nascondi impronta componente + Hide/show the silkscreen layer for only this part + Hide part label - + Nascondi etichetta parte + Show part label - + Mostra etichetta parte + Show part silkscreen - + Mostra impronta componente + Select any traces where the screen location doesn't match the actual location. Only needed for sketches autorouted with version 0.7.10 or earlier + Autorouter/DRC settings... + Set autorouting parameters including keepout... + Ctrl+4 + Code - + Codice + Show Code - + Mostra Codice + Show the code (programming) view + Fritzing Fab Quote... + How much would it could to produce a PCB from this sketch with Fritzing Fab + Find part in sketch... - + Trova parte nello schema... + Search for parts in a sketch by matching text + Text will match part label, description, title, etc. Enter text to search for: + Search - + Cerca + No parts matched search term '%1'. + Unable to load part from '%1' + MainWindow::moveToPartsFolder mainwindow missing + There is already a part with id '%1' loaded into Fritzing. + SPICE Netlist... + Save a netlist in SPICE format + Unable to open '%1': %2 + Unable to open shareable '%1': %2 + Unable to open shareable part '%1': %2 + Export SPICE Netlist... + Set Ground Fill Keepout... - + Imposta Distanza Piano Massa... + Set the minimum distance between ground fill and traces or connectors + Enter Text + View from Above - + Vedi da Sopra + View from Below - + Vedi da Sotto + + View from below - + Vedi da sotto + + View the PCB from the bottom layers upwards - + Guarda il circuito dal livello di sotto in su + View from above - + Vedi da sopra + View the PCB from the top layers downwards - + Guarda il circuito dal livello di sopra in giù + Delete Minus - + Cancella (non le piste) + Delete selection without attached wires - + Cancella la selezione ma non le piste connesse + Delete Wire up to bendpoints - + Cancella Filo fino ai gomiti + Move to bottom layer - + Muovi al livello di sotto + Move to top layer - + Muovi al livello di sopra + Align Left - + Allinea a Sinsistra + Align selected items at the left + Align Horizontal Center - + Allinea al Centro Orizzontale + Align selected items at the horizontal center + Align Right - + Allinea a Destra + Align selected items at the right + Align Top - + Allinea Su + Align selected items at the top + Align Vertical Center - + Allinea al Centro Verticale + Align selected items at the vertical center + Align Bottom - + Allinea Giù + Align selected items at the bottom + Align - + Allinea + top and bottom - + sopra e sotto + bottom - + sotto + top - + sopra + Ground Fill (%1) - + Piano Massa (%1) + Copper Fill (%1) - + Piano Rame (%1) + Do you want to update now? + There are %n outdated part(s) in this sketch. @@ -3401,48 +4294,59 @@ Do you want to update now? + Click to highlight unconnected parts + Fabricate - + Fabbrica + Welcome - + Benvenuto + Dump all parts + Debug dump all parts in this view + Ctrl+5 + &Show Welcome - + Mostra B&envenuto + Show the welcome view + Display First Time Help + Note: if you want to update later, there are options under the 'Part' menu for dealing with outdated parts individually. + We strongly recommend that you update these %n parts to the latest version. @@ -3450,105 +4354,130 @@ Note: if you want to update later, there are options under the 'Part' + This may result in changes to your sketch, as parts or connectors may be shifted. + %1 background - + sfondo %1 + Schematic conversion + Saving this sketch will convert it to the new schematic graphics standard. Go ahead and convert? + Test Connectors + Connect all connectors to a single test part + Schematic view update + There is a new graphics standard for schematic-view part images, beginning with version 0.8.6. + Would you like to convert '%1' to the new standard now or open the file read-only? + The conversion process will not modify '%1', until you save the file. + You will have to rearrange parts and connections in schematic view, as the sizes of most part images will have changed. Consider using the Autorouter to clean up traces. + Note that any custom parts will not be converted. A tool for converting 'rectangular' schematic images is available in the Parts Editor. + Ctrl+Shift+V + (x,y)=(%1, %2) %3 + (x, y)=(%1, %2) (width, height)=(%3, %4) %5 - + (x, y)=(%1, %2) (larghezza, altezza)=(%3, %4) %5 + Rotate 45° Clockwise - + Ruota 45° Orario + Rotate 90° Clockwise - + Ruota 90° Orario + Rotate 180° - + Ruota 180° + Rotate 90° Counter Clockwise - + Ruota 90° Antiorario + Rotate 45° Counter Clockwise - + Ruota 45° Antiorario + Regenerate parts database ... - + Rigenera database delle parti... + Regenerate the parts database (should only be used if your parts database is broken) + Fritzing uncompressed (*%1) + Color Breadboard Wires By Length + Display breadboard wires using standard color coding by length @@ -3556,22 +4485,28 @@ Note: if you want to update later, there are options under the 'Part' MazeRouter + Autorouter was cancelled. + + round %1 of: + Unexpected SVG rendering failure--contact fritzing.org + best so far: %1 of %2 routed + with %n vias @@ -3579,30 +4514,38 @@ Note: if you want to update later, there are options under the 'Part' + Routing reached maximum round %1. + Routing stopped! + Routing complete! + Routing unsuccessful; stopping at round %1. + + Use best so far... + Preparing undo... + Optimizing traces... @@ -3610,22 +4553,27 @@ Note: if you want to update later, there are options under the 'Part' ModFileDialog + Modified files + decision + Fritzing can proceed with the update, but the set of files listed below must first be cleaned (removed or reset). It may take a few minutes. <p>Do you want to proceed with cleaning these files?</p> + Clean files + Now cleaning files. Please don't interrupt the process. @@ -3633,15 +4581,18 @@ Note: if you want to update later, there are options under the 'Part' ModelBase + File save failed! + Couldn't overwrite file '%1'. Reason: %2 (errcode %3) + Unable to find the following %n part(s): @@ -3649,6 +4600,7 @@ Reason: %2 (errcode %3) + at @@ -3656,10 +4608,12 @@ Reason: %2 (errcode %3) MysteryPart + label - + etichetta + chip label @@ -3667,6 +4621,7 @@ Reason: %2 (errcode %3) NetLabel + net label @@ -3674,6 +4629,7 @@ Reason: %2 (errcode %3) Note + [write your note here] [scrivi qui le tue note] @@ -3681,139 +4637,204 @@ Reason: %2 (errcode %3) PCBSketchWidget + Click this connector to drag out a new trace. Click questo connettore per trascinare fuori una nuova traccia. + Change trace layer + + + + + + + + + + + + + + + + + + + + Fritzing + + Your sketch does not have a board yet! Please add a PCB in order to use copper fill. + + Fritzing error: unable to render board svg (1). + + + Fritzing error: unable to render copper svg (1). + Fritzing error: unable to write copper fill (1). + Fritzing error: unable to write copper fill (2). + Unable to create copper fill--probably the part wasn't dropped onto the PCB. + Unable to create copper fill--possibly the part was dropped onto another part or wire rather than the actual PCB. + Create Trace from Ratsnest + Please designate one or more ground fill seeds before doing a ground fill. + Clear ground fill seeds + %1 Fill: please select the board you want to apply fill to. + Ground + Copper + Copper fill: please select only the board you want to fill. + Your sketch does not have a board yet! Please add a PCB in order to use this selection operation. + + + Please click on a PCB first--this selection operation only works for one board at a time. + + Your sketch does not have a board yet! Please add a PCB in order to use this selection operation. + Unable to convert this via to a bendpoint because it is connected to a part that is only on the bottom layer and another part that is only on the top layer. + Show part silkscreen - + Mostra impronta componente + Hide part silkscreen - + Nascondi impronta componente + Your sketch does not have a board yet. You cannot fabricate this sketch without a PCB part. + Enter Keepout - + Inserisci Distanziamento + Keepout is in mils (.001 inches). - + Il distanziamento (keepout) è in mils (0.001 pollici = 0.0254 mm; 1mm = 39.37 mills). + + + Note that due to aliasing, distances may be too short by up to 2 mils - + Nota che a causa dell'aliasing, le distanze sotto i 2 mills possono essere troppo ridotte + so you may want to increase the keepout value by that much. - + per cui potresti voler incremetare di molto la distanza. + + + 10 mils is a good default choice. - + 10 mils (0.254 mm) è un buon valore predefinito. + + + Enter keepout value: - + Inserisci il valore di distanziamento: + + Fritzing Fab Quote + Sorry, http://fab.fritzing.org is not responding to the quote request. Please check your network connection and/or try again later. @@ -3821,407 +4842,526 @@ Reason: %2 (errcode %3) PEConnectorsView + This is where you edit the connector metadata for the part - + Qui è dove puoi modificare i metadati dei connettori per il componente + number of connectors: - + numero di connettori (piedini): + Through-hole - + Piedino passante + SMD - + SMD PEMainWindow + + + + + + + + + + Parts Editor - Editor Componenti + Editor Componenti + Show Icon - + Mostra Icona + Ctrl+4 + Show the icon view + Ctrl+5 + Show the metadata view + Show Connectors - + Mostra Connettori + Ctrl+6 + Change %1 to '%2' + Change tags + Change properties + Change description + Change connector %1 + SVG + + Connectors - Connettori + Connettori + Show in Folder - + Mostra nella Cartella + On the desktop, open the folder containing the current svg file. + + Unable to write svg to %1 + Unable to parse fzp file %1 + Icon View - + Vista Icona + Metadata View + Connectors View + Image & Footprint Files (%1 %2 %3 %4 %5);;SVG Files (%1);;JPEG Files (%2);;PNG Files (%3);;gEDA Footprint Files (%4);;Kicad Module Files (%5) + Image Files (%1 %2 %3);;SVG Files (%1);;JPEG Files (%2);;PNG Files (%3)%4%5 + Open Image - Apri Immagine + Apri Immagine + Copy problem + Unable to make a local copy of: '%1' + You may use a PNG or JPG image to construct your part, but it is better to use an SVG. + PNG and JPG images retain their nature as bitmaps and do not look good when scaled-- + so for Fritzing parts it is best to use PNG and JPG only as placeholders. + Use of PNG and JPG discouraged + + + + Conversion problem + + + SVG problem + Unable to parse '%1': %2 line:%3 column:%4 + There are no copper layers defined in: %1. - + Non ci sono livelli rame definiti in: %1. + See <a href="http://fritzing.org/learning/tutorials/creating-custom-parts/providing-part-graphics/">this explanation</a>. - + Vedi <a href="http://fritzing.org/learning/tutorials/creating-custom-parts/providing-part-graphics/">questa spiegazione</a>. + <br/><br/>This will not be a problem in the next release of the Parts Editor, + but for now please modify the file according to the instructions in the link. + no schematics found in %1 + schematic part + no footprints found in %1 + Relocate connector %1 + &File - &File + &File + Sketch Change Warning - + Avvertenza Cambio Sketch + The open sketch '%1' uses the part you are editing. - + Lo sketch aperto '%1' usa il componente che stai editando. + Saving this part will make a change to the sketch that cannot be undone. - + Salvare questo componente causerà delle modifiche non annullabili allo sketch. + The open sketches + '%1', + and '%1' + Saving this part will make a change to these sketches that cannot be undone. + Go ahead and save? - + + +Andare avanti e salvare? + Save - Salva + Salva + Cancel - Annulla + Annulla + Move terminal point + Remove connector + Remove %1 connectors + Save "%1" - Salva "%1" + Salva "%1" + Do you want to save the changes you made in the part "%1"? - + Vuoi salvare le modifiche che hai fatto al componente "%1"? + Your changes will be lost if you don't save them. - I tuoi cambiamenti andranno perduti se non li salverai. + I tuoi cambiamenti andranno perduti se non li salvi. + untitled part + Add connector - Aggiungi connettore + Aggiungi connettore + Add %1 connectors + There is one last edit still pending. + Duplicate 'family' property not allowed + Duplicate 'variant' property not allowed + Close without saving? + Close without saving + Keep working + Icon - Icona + Icona + Metadata - + Metadati + Remove Internal Connection + + Fritzing (New) Parts Editor + Show Metadata - + Mostra Metadati + Show the connector metadata in a list view + Blank not allowed + The value of '%1' can not be blank. + Change %1 to %2 + Must be unique + Variant '%1' is in use. The variant name must be unique. + + Duplicate problem + Unable to load '%1' + The SVG file '%1' appears to have been exported from CorelDRAW without the 'presentation attributes' setting. + Please re-export the SVG file using that setting, and try loading again. + Fonts + Fritzing currently only supports OCRA and Droid fonts--these have been substituted in for the fonts in '%1' - Unable to load image file '%1': + + Unable to load image file '%1': %2 + Remove internal connection from '%1' + Internal connections are very messed up. + Add internal connection from '%1' to '%2' + The 'family' property can not be blank. + A duplicate 'family' property is not allowed + A duplicate 'variant' property is not allowed + This part can not be saved as-is: + Do you want to keep working or close without saving? + This part has %n unassigned connectors @@ -4229,6 +5369,7 @@ Go ahead and save? + across %n views. @@ -4236,152 +5377,189 @@ Go ahead and save? + Until all connectors are assigned to SVG elements, the part will not work correctly. + Layers - + Livelli + Reuse breadboard image - + Riusa l'immagine Breadboard + Reuse the breadboard image in this view + Reuse schematic image - + Riusa l'immagine Schema + Reuse the schematic image in this view + Reuse PCB image - + Riusa l'immagine PCB + Reuse the PCB image in this view + Make only this view visible - + Rendi visibile solo questa vista + The part will only be visible in this view and icon view + This version of the new Parts Editor can not deal with separate copper0 and copper1 layers in '%1'. + So editing may produce an invalid PCB view image + &Export - &Esporta + &Esporta + Change all connectors to %1 + Unable to parse '%1' + Change to %1 + Make only %1 view visible + Exiting the Parts Editor now is fine, as long as you remember to finish the assignments later. + Load image for view... - + Carica immagine per la vista... + Open a file to use as the image for this view of the part. + Save as new part - + Salva come nuovo componente + Make a copy of the part and save it in the 'My Parts' Bin + &Edit - &Modifica + &Modifica + This part has bendable legs. + This version of the Parts Editor does not yet support editing bendable legs, and the legs may not be displayed correctly in breadboard view . + If you make changes to breadboard view, or change connector metadata, the legs may no longer work. + You can safely make changes to Schematic or PCB view. + This warning will not be repeated in this session of Fritzing + Unable to load '%1'. Please close the parts editor without saving and try again. + Unable to load image file '%1' + Inspector - Inspector + Inspector + Unable to load fzp from %1 + Unable to create new connector--you may have to start over. + Filename prefix + Convert schematic to 0.1 inch standard + Convert pre-0.8.6 schematic image to new 0.1 inch standard + <p>Please enter a prefix to help you identify the part files.<br/>The file names will have the form 'PREFIX_%1'.<br/>(It is not necessary to change the proposed prefix, since a unique suffix is always added.)</p> @@ -4389,86 +5567,107 @@ Go ahead and save? PEMetadataView + This is where you edit the metadata for the part ... - + Qui è dove puoi modificare i metadati per il componente... + Set the part's title + Title - + Titolo + Set the part's date + Date - + Data + Set the part's author + Author - Autore + Autore + Set the part's description--you can use simple html (as defined by Qt's Rich Text) + Description - Descrizione + Descrizione + Set the default part label prefix + Label - Etichetta + Etichetta + Set the part's family--what other parts is this part related to + Family - + Famiglia + Set the part's properties + Properties - Proprietà + Proprietà + Set the part's tags + Tags - Tag + Etichette + Set the part's variant--this makes it unique from all other parts in the same family + Variant - + Variante + Set the part's url if it is described on a web page + URL @@ -4476,105 +5675,130 @@ Go ahead and save? PESvgView + width: - + larghezza: + height: - + altezza: PEToolView + Center - + Centro + N - + N + E - + E + S - + S + W - + O + Connector %1 - + Connettore %1 + Set Internal Connections - + Imposta Connessioni Interne + Set this checkbox to edit internal connections by drawing wires + Controls for setting the terminal point for a connector. The terminal point is where a wire will attach to the connector. You can also drag the crosshair of the current connector + center - + centro + west - + ovest + north - + nord + south - + sud + east - + est + Sets the connector's terminal point to %1. - + Imposta il punto terminale del conettore a %1. + Modifies the x-coordinate of the terminal point + Modifies the y-coordinate of the terminal point + Dragging disabled + <font color='black'>Dragging enabled</font> + <font color='gray'>Dragging disabled</font> + Connector List (a checkmark means the graphic was selected) - + Lista Connettori (una spunta indica che la grafica è stata selezionata) + Select graphic - + Seleziona grafica + Use the cursor location and mouse wheel to navigate to the SVG element which you want to assign to the current connector, then mouse down to select it. @@ -4582,317 +5806,397 @@ Go ahead and save? Pad + shape - + forma + center - + centro + north - + nord + east - + est + south - + sud + west - + ovest + + connect to - + connetti a PaletteItem + Edit Pin Labels + + + Fritzing + Unable to proceed; unable to find top level view. + Unable to proceed; part connectors do no have standard IDs. + Label mismatch. Nothing was saved. + hole size - + dimens. foro + advanced settings - + impostazioni avanzate + in - + + mm - + + Hole Diameter - + Diametro Foro + Ring Thickness - + Spessore Anello PartLabel + Rotate current selection 90 degrees counter clockwise Ruota la selezione corrente di 90 gradi in senso anti-orario + Edit - + Modifica + Edit label text - + Modifica testo etichetta + Display Values - + Mostra Valori + Flip/Rotate - + Ribalta/Ruota + Font Size - + Dimensione Testo + Rotate the label by 90 degrees clockwise + Rotate the label by 180 degrees + Flip Horizontal - + Ribalta Orizzontalmente + Flip label horizontally + Flip Vertical - + Ribalta Verticalmente + Flip label vertically + Small - + Piccolo + Set font size to small + Medium - + Medio + Set font size to medium + Large - + Grande + Set font size to large + Label text + Display the text of the label + Display the value of property %1 + Set label for %1 + Label text: + Hide - + Nascondi + Hide part label - + Nascondi etichetta parte + Rotate the label by 45 degrees clockwise + Rotate the label by 135 degrees clockwise + Rotate the label by 135 degrees counter clockwise + Rotate the label by 45 degrees counter clockwise + Tiny + Set font size to tiny + Rotate 45° Clockwise - + Ruota 45° Orario + Rotate 90° Clockwise - + Ruota 90° Orario + Rotate 135° Clockwise - + Ruota 135° Orario + Rotate 180° - + Ruota 180° + Rotate 135° Counter Clockwise - + Ruota 135° Antiorario + Rotate 90° Counter Clockwise - + Ruota 90° Antiorario + Rotate 45° Counter Clockwise - + Ruota 45° Antiorario PartsBinPaletteWidget + Untitled Bin Cesto senza titolo + Specify a file name Specifica un nome di file + + Fritzing + Cannot find file %1. Non riesco a trovare il file %1. + Cannot read file %1: %2. Non riesco a leggere il file %1: %2. + Save Salva + Fritzing Bin (*%1) Cesto di Fritzing (*%1) + Don't Save Non salvare + Ctrl+D + Your changes will be lost if you don't save them. I tuoi cambiamenti andranno perduti se non li salverai. + Add to bin Aggiungi al cesto + Do you really want to add the selected part to the bin? Vuoi aggiungere veramente il componente selezionato al cesto? + Do you want to save the changes you made in the bin "%1"? - + Vuoi salvare le modifiche che hai fatto al cesto"%1"? + Save bin "%1" - + Salva Cesto "%1" + Cancel - Annulla + Annulla + Loading... - + Caricamento... + loading bin '%1' - + caricamento cesto '%1' + Change icon color... + Change the color of the icon for this bin. + Select a color for this icon @@ -4900,74 +6204,90 @@ Go ahead and save? Perfboard + size - + dimensione + set board size + rows + columns + Performance Warning + Performance of perfboards and stripboards with more than approximately 2000 holes can be slow. Are you sure ? Note: this warning will not be repeated during this session. + Set new size + Cancel - Annulla + Annulla PinLabelDialog + <p><h2>Pin Label Editor</h2></p> + <p>Click on a label next to a pin number to rename that pin. + You can use the tab key to move through the labels in order.</p> + Cancel - Annulla + Annulla + Undo - Annulla + Annulla + Redo - Ripeti + Ripristina + Save - Salva + Salva PlatformArduino + Running %1 %2 @@ -4975,6 +6295,7 @@ Note: this warning will not be repeated during this session. PlatformPicaxe + Running %1 %2 @@ -4982,122 +6303,152 @@ Note: this warning will not be repeated during this session. PrefsDialog + Cancel Annulla + OK OK + Language Lingua + Colors - + Colori + + %1 (click to change...) + Connected Highlight - + Evidenziatura Connessi + Unconnected Highlight - + Evidenziatura Disonnessi + Mouse Wheel Behavior - + Comportamento Rotella Mouse + Command + Control + Change Wheel Behavior - + Cambia Comportamento Rotella + Autosave - + Autosalvataggio + Autosave every: - + Salva automaticamente ogni: + minutes - + minuti + no keys down = scroll shift key swaps scroll axis Alt or %1 key = zoom + no keys down = zoom Alt or %1 key = scroll shift key swaps scroll axis + General - + Generale + Curvy vs. straight wires - + Fili curvi o rettilinei + Clear Settings - + Cancella Impostazioni + When you mouse-down and drag on a wire or the leg of a part (as opposed to a connector or a bendpoint) do you want to change the curvature of the wire (or leg) or drag out a new bendpoint? + This checkbox sets the default behavior. You can switch back to the non-default behavior by holding down the Control key (Mac: Command key) when you drag. + Curvy wires and legs - + Fili e piste curvi + Code View - + Vista Codice + Platform Support - + Supporto Piattaforme + <b>%1</b> + Location: - + Posizione: + ... - + ... + You need to have <a href='%1'>%2</a> (version %3 or newer) installed. - + Devi avere <a href='%1'>%2</a> (versione %3 o più nuova) installata. + Select a programmer (executable) for %1 @@ -5105,74 +6456,92 @@ shift key swaps scroll axis ProgramTab + Select a program file to load + Fritzing is unable to find '%1', please locate it + New - + Nuovo + Save - Salva + Salva + Remove "%1"? + Are you sure you want to remove "%1" from the sketch? + Code (*.%1) + While it is possible to read and edit %1 programming files, it is not yet possible to use Fritzing to compile or upload these programs to a microcontroller. + Open - + Apri + Platform - + Piattaforma + Board - Basetta + Scheda + Port - + Porta + Serial Monitor - + Monitor Seriale + Upload - + Carica + No uploader for %1 specified. Go to Preferences > Code View to configure it. + Uploader configured, but not found at %1 + Upload finished. + Upload failed with exit code %1, %2 @@ -5180,178 +6549,222 @@ shift key swaps scroll axis ProgramWindow + &Edit - &Modifica + &Modifica + Undo - Annulla + Annulla + Redo - Ripeti + Ripeti + &Cut - &Taglia + &Taglia + Cut selection - Taglia selezione + Taglia selezione + &Copy - &Copia + &Copia + Copy selection - Copia selezione + Copia selezione + &Paste - &Incolla + &Incolla + Paste clipboard contents - Incolla contenuto della clipboard + Incolla contenuto degli appunti + &Select All - &Seleziona tutto + &Seleziona Tutto + Select all text + File '%1' was restored from the .fzz file; the local copy was not found. + File '%1' was restored from the .fzz file; save a local copy to work with an external editor. + &Code + &View - &Visualizza + &Visualizza + Code Window + Code Window - %1 + No boards available + &Preferences... - &Preferenze... + &Preferenze... + Show the application's about box - Mostra la finestra di diaologo dell'applicazione + Mostra la finestra informazioni dell'applicazione + &New Tab - + &Nuova Scheda + Create a new program tab + &Import Code... + Alt+Ctrl+I + Import a program from a file + &Save Tab + Alt+Ctrl+S + Save the current program tab + &Rename Tab + Alt+Ctrl+R + Rename the current program tab + Close Tab + Alt+Ctrl+W + Remove the current program tab from the sketch + Platform - + Piattaforma + Board - Basetta + Scheda + Port - + Porta + Serial Monitor - + Monitor Seriale + Ctrl+M + Monitor the serial port communication + Upload - + Carica + Ctrl+U + Upload the current program onto a microcontroller + %1%2 @@ -5359,36 +6772,72 @@ shift key swaps scroll axis QObject + + Breadboard View Vista Breadboard + + + + + + + + + + + + + + + + + + + + + + + Fritzing + The file '%1' is read-only; please use a different filename. Il file '%1' è in sola lettura: usa un file differente. + Edit link Modifica link + + + Part Componente + + + Wire Filo + + Cannot read file %1: %2. Non riesco a leggere il file %1: %2. + Parse error (1) at line %1, column %2: %3 %4 @@ -5397,18 +6846,22 @@ shift key swaps scroll axis %4 + The file %1 is not a Fritzing file (2). Il file %1 non è un file di Fritzing (2). + The file %1 is not a Fritzing file (3). Il file %1 non è un file di Fritzing (3). + No parts found. Nessun Componente trovato. + Parse error (2) at line %1, column %2: %3 %4 @@ -5417,470 +6870,649 @@ shift key swaps scroll axis %4 + The part '%1' at '%2' does not have a unique module id '%3'. Il componente '%1' in '%2' non ha un id univoco del modulo '%3'. + a label una etichetta + a value un valore + + PCB View Vista PCB + Trace wires Traccia + Ratsnest wires Nido di topo + + Select all %1 Seleziona tutto %1 + Preferences Preferenze + Please note that a new language setting will not take effect until the next time you run Fritzing. - Nota che l'impostazione della nuova lingua non avra effetto se non al prossimo avvio di Fritzung. + Nota che l'impostazione della nuova lingua non avrà effetto se non al prossimo avvio di Fritzung. + + + Oops! Oops! + Sorry, we have a problem with the swapping mechanism. Fritzing still works, but you won't be able to change parts properties. Spiacente, abbiamo un broblema con il meccanismo di scambio. Fritzing continuerà a funzionare, ma non sarà possibile cambiare le proprietà dei componenti. + + Schematic View Vista schema + %1 %2 %3 + %1 Layer Livello %1 + + Bring forward Porta avanti + Send backward Manda indietro + Bring to front Porta in primo piano + Split Wire Dividi traccia + Join Wire Unisci traccia + Check for updates Controlla aggiornamenti + icon view vista icone + breadboard view vista breadboard + schematic view vista schema + pcb view vista pcb + Icon Icona + Breadboard Breadboard + + Parts Componenti + + Wires Fili + + Part Labels Etichette componenti + + + Notes Note + + + Rulers Righelli + Board Basetta + Unknown Layer - Livello sconosciuto + Livello Sconosciuto + The file %1 is not a Fritzing file (4). Il file %1 non è un file di Fritzing (4). + Part already in bin Conponente gi&agrave; nel cesto + The part that you have just added, is already there, we won't add it again, right? - Il componente che hai appena aggiunto, + Il componente che hai appena aggiunto, &egrave; gi&agrave; stato inserito, non vuoi aggiungerne un'altro, giusto? + bb + pcb + schem + File Progress... + Select outdated parts - + Seleziona parti obsolete + files + + + unable to open %1 + unable to parse %1 + parse failure in %1 + Sorry, Fritzing can't yet handle both pins and pads together (in %1) + bad pin argument count + bad pad argument count + footprint %1 not found in %2 + + + + unexpected end of file in footprint %1 in file %2 + unexpected format (1) in %1 from %2 + unexpected end of file + pad missing drill + pad missing attributes + pad missing position + pad missing shape + position missing params + drill missing params + drill offset not implemented + drill missing ellipse params + attributes missing params + Sorry, can't handle pad type %1 + pad shape missing params + shape delta not implemented + trapezoidal pads not implemented + unable to handle pad shape %1 + failure in svg conversion 1: %1 %2 %3 + failure in svg conversion 2: %1 %2 %3 + Copying file %1 + File %1 already exists: it won't be overwritten + Silkscreen Top + Silkscreen Top (Part Labels) + Copper Bottom + Copper Bottom Trace + Copper Top + Copper Top Trace + Silkscreen Bottom + Silkscreen Bottom (Part Labels) + Sorry, Fritzing can't yet handle both pins and pads together (in %1 in %2) + bad layer mask parameter + non-circular holes not implemented + non-copper holes not implemented + Unable to parse copper: %1 %2 %3 + Select %1 - Seleziona %1 + Seleziona %1 + pad shape size is invalid + bad schematic definition %1 + schematic part %1 not found in %2 + + schematic %1 unexpectedly ends (1) in %2 + + schematic %1 unexpectedly ends (2) in %2 + schematic %1 unexpectedly ends (3) in %2 + Part Image + Error reading file %1: %2. + Select locked parts + Basic - + Base + Input - + Ingresso + Output - + Uscita + ICs + Power - + Alimentazione + Connection - + Connessioni + Microcontroller - + Microcontrollore + Tools - + Strumenti + Frame + %1 %2,%3 %4 + Change leg of %1,%2 + outline is empty - Copper Fill Bottom + + the board outline layer, - Copper Fill Top + + silkscreen layer(s), + + + + + copper layer(s), + + + + + mask layer(s), + + + + + Unable to translate svg curves in %1 + + silk export failure + + + + + drill export failure + + + + + + mask export failure + + + + + Copper Fill Bottom + Piano Rame Inferiore + + + + Copper Fill Top + Piano Rame Superiore + + + Shields + LilyPad + Other - + Altro + Sensors - + Sensori + Pin Label Editor + + + Ratsnest + mm + in + Cannot write file temp: %1 %2 @@ -5888,321 +7520,366 @@ is already there, we won't add it again, right? + Cannot autoroute: no board (or multiple boards) found + Set Ground Fill Seed - + Imposta Seme Piano Massa + Ground Fill Seed Editor + Editor Seme Piano Massa + + + + %1 mask export failure (2) + Select all 'Don't autoroute' traces + Select all autorouteable traces + Set Grid Size - + Imposta Misura Griglia + There is no undo for this action, and no further warning!!!! + Clear Settings - + Cancella Impostazioni + No connections (on the PCB) to route. + No connections to route. + Connected highlight color + Unconnected highlight color + Clear all saved settings and close this dialog immediately. + This action does not delete any files; it restores settings to their default values. + Convert to Via - + Converti in Via + Convert Via to Bendpoint - + Converti Via in Gomito + %1 wires moved from their saved position in %2. + + paste mask layer(s), + + + + ii + Icon View - + Vista Icone + <b>id:</b> + <b>Name:</b> - + <b>Nome:</b> + Set the connectors's title + <b>Description:</b> - + <b>Descrizione:</b> + Set the connectors's description + Fritzing cannot load the parts bin + Internal Connections - + Connessioni Interne + Set all to: - + Imposta tutti come: + + Pad + <b>type:</b> - + <b>tipo:</b> + Part %1 '%2' - - - - unable to copy file '%1' to '%2'. - - - - Autorouter Settings - - - - Unable to save pick and place file: %2 - - - - Text - - - - %2 ... %1 wires moved from their saved position - - - - <font face='Lucida Grande, Tahoma, Sans Serif' size='2' color='#eaf4ed'>Version %1.%2.%3 (%4%5) %6</font> - + Parte %1 '%2' - N/A - - - - <font face='Lucida Grande, Tahoma, Sans Serif' size='2' color='#eaf4ed'>&#169; 2007-%1 Fritzing</font> - - - - Regenerate database failed - - - - Regenerating parts database + + Fritzing is unable to process the cutouts in this custom PCB shape. - Unable to find parts git repository + + You may need to reload the shape SVG. - Unable to find parts git repository HEAD + + Fritzing requires that you make cutouts using a shape 'subtraction' or 'difference' operation in your vector graphics editor. - The parts folder '%1' has been changed--it is not in the master branch (%2). %3 + + unable to copy file '%1' to '%2'. - The parts folder '%1' may have been damaged (%2). %3 - + + Autorouter Settings + Impostazioni Autoinstradamento - The parts folder '%1' has been changed (%2). %3 + + %1 layer export is empty. - There are new or modified files in the parts folder '%1'. These changes will be discarded by the update. + + exported drill file is empty - There are unreadable files in the parts folder '%1'. %2 + + exported mask layer %1 is empty - Unable to open parts folder '%1' for update. %2 + + exported paste mask layer is empty - Parts folder repo '%1' is empty. %2 + + %1 layer: unable to save to '%2' - Unable to determine network site for '%1'. %2 + + Unable to save pick and place file: %2 - Unable to access network site for '%1'. %2 - + + Text + Testo - Unable to retrieve network references for '%1'. %2 + + %1 layer export is empty (case 2). - Unable to retrieve master network reference for '%1'. %2 + + silk layer %1 export is empty - Error %1 - + + %2 ... %1 wires moved from their saved position - the board outline layer, + + N/A - silkscreen layer(s), + + <font face='Lucida Grande, Tahoma, Sans Serif' size='2' color='#eaf4ed'>&#169; 2007-%1 Fritzing</font> - copper layer(s), + + Regenerate database failed - mask layer(s), + + + Regenerating parts database - paste mask layer(s), + + Unable to find parts git repository - Unable to translate svg curves in %1 + + Unable to find parts git repository HEAD - %1 layer export is empty. + + The parts folder '%1' has been changed--it is not in the master branch (%2). %3 - %1 layer export is empty (case 2). + + The parts folder '%1' may have been damaged (%2). %3 - silk layer %1 export is empty + + The parts folder '%1' has been changed (%2). %3 - silk export failure + + There are new or modified files in the parts folder '%1'. These changes will be discarded by the update. - exported drill file is empty + + There are unreadable files in the parts folder '%1'. %2 - drill export failure + + Unable to open parts folder '%1' for update. %2 - exported mask layer %1 is empty + + Parts folder repo '%1' is empty. %2 - %1 mask export failure (2) + + Unable to determine network site for '%1'. %2 - mask export failure + + Unable to access network site for '%1'. %2 - exported paste mask layer is empty + + Unable to retrieve network references for '%1'. %2 - %1 layer: unable to save to '%2' + + Unable to retrieve master network reference for '%1'. %2 - Fritzing is unable to process the cutouts in this custom PCB shape. + + <font face='Lucida Grande, Tahoma, Sans Serif' size='2' color='#eaf4ed'>Version %1.%2.%3 (%4 %5) %6</font> - You may need to reload the shape SVG. + + Error %1 + - Fritzing requires that you make cutouts using a shape 'subtraction' or 'difference' operation in your vector graphics editor. + + Application folder %1 not found QShortcut + Ctrl for naming shortcut keys on menu items + Alt for naming shortcut keys on menu items + Shift for naming shortcut keys on menu items + Meta for naming shortcut keys on menu items @@ -6211,34 +7888,42 @@ is already there, we won't add it again, right? QuoteDialog + For more information on pricing see <a href='http://fab.fritzing.org/pricing'>http://fab.fritzing.org/pricing</a>. + Order your PCB from Fritzing Fab + Price per board + Price + Copies + Visit Fritzing Fab + Fritzing Fab Quote + The total area of the %n PCB(s) in this sketch is @@ -6246,53 +7931,70 @@ is already there, we won't add it again, right? - Please note that prices do not include shipping,<br /> + + %1 cm%3 (%2 in%3).<br /> + + + + + Use Fritzing Fab to produce a PCB from your sketch.<br /> - possible additional taxes, or the checking fee.<br /> + + Take advantage of our quantity discount: - %1 cm%3 (%2 in%3).<br /> + + <b>Shipping is free wordlwide</b>.<br /> - Use Fritzing Fab to produce a PCB from your sketch.<br /> + + Documents for local customs control are included.<br /> - Take advantage of our quantity discount: + + Some countries might charge additional import taxes or checking fees.<br /> RecoveryDialog + &Recover + &Ignore + File + Last backup + Last saved + file not saved + <p><b>Fritzing may have crashed, but some of the changes to the following files may be recovered.</b></p><p>The date and time each file was backed-up is displayed. If the file was saved, that date and time is also listed for comparison.</p><p>The original files are still on your disk, if they were ever saved. You can choose whether to overwrite the original file after you load its recovery file.</p><p><b>Select any files you want to recover from the list below.</b></p> @@ -6300,18 +8002,22 @@ is already there, we won't add it again, right? RegenerateDatabaseThread + Unable to open temporary file + Database failure + Unable to remove original db file %1 + Unable to copy database file %1 @@ -6319,14 +8025,17 @@ is already there, we won't add it again, right? Resistor + resistance - resistenza + resistenza + Resistor - + Resistenza + You can either type in a resistance value, or select one from the drop down. Format nnn.dP where P is one of 'umkMG' @@ -6334,124 +8043,155 @@ is already there, we won't add it again, right? ResizableBoard + shape - + forma + width: %1mm - + larghezza: %1mm + height: %1mm - + altezza: %1mm + width(mm) - + larghezza (mm) + height(mm) - + altezza (mm) + keep aspect ratio - + mantieni proprorzioni + Revert - + Ripristina + size - + dimensione + + custom - + personalizzata + A0 (1030x1456) - + + A1 (728x1030) - + + A2 (515x728) - + + A3 (364x515) - + + A4 (257x364) - + + A5 (182x257) - + + A6 (128x182) - + + Letter (8.5x11) - + + Legal (8.5x14) - + + Ledger (17x11) - + + Tabloid (11x17) - + Ruler + width - larghezza + larghezza + &cm - + + &in - + S2S + Failed loading '%1', %2 line:%3 col:%4 + Schematic not found for '%1' + + Unable to load schematic '%1' for '%2' + Schematic '%1' is already using the 0.1inch standard. + Missing connector %1 in '%2' schematic of '%3' + Failed loading schematic '%1', %2 line:%3 col:%4 @@ -6459,49 +8199,60 @@ is already there, we won't add it again, right? SchematicFrame + Project - + Progetto + Filename + Date - + Data + Sheet + Rev - + Rev + of + date - + data + sheet + shape - + forma SchematicSketchWidget + Change voltage from %1 to %2 + Change label from %1 to %2 @@ -6509,283 +8260,359 @@ is already there, we won't add it again, right? SetColorDialog + Make this the default %1 color - + Rendi questo il colore predefinto per %1 + Cancel - Annulla + Annulla + OK - OK + OK + %1 Color... - + Colore per %1... + Choose %1 color: - + Scegli colore per %1: + Reset to default - + Ripristina predefinito + Default color (%1) - + Colore predefinito (%1) + Pick custom color ... - + Preleva colore personalizzato... + Pick custom %1 color - + Preleva colore personalizzato %1 + Current color (%1) - + Colore corrente (%1) SketchWidget + loading part caricamento componente + done loading caricamento completato + %1 %2 + %1 %2 items %1 %2 elementi + Select All - Seleziona tutto + Seleziona Tutto + Deselect Deseleziona + Add %1 Aggiungi %1 + Selection Selezione + Move %2 (%1) Muovi %2 (%1) + Move %2 items (%1) Muovi %2 elementi (%1) + + Select %1 Seleziona %1 + + Select %1 items Seleziona %1 elementi + + Disconnect Disconnetti + Change Cambia + + Connect Connetti + + to %1 a %1 + Create and connect wire Crea e connetti filo + Rotate Ruota + Flip Ribalta + Change %1 label to '%2' Cambia etichetta da %1 a '%2' + Change %1 color from %2 to %3 Cambia %1 colore da %2 a %3 + Change color of %1 wires to %2 Cambia colore del filo %1 in %2 + Change %1 width from %2 to %3 Cambia larghezza %1 da %2 a %3 + Change width of %1 wires to %2 Cambia larghezza del filo %1 in %2 + Move label '%1' Muovi etichetta '%1' + %1 label '%2' %1 etichetta '%2' + Resize Note Note ridimensione + Rotate %2 (%1) - + Ruota %2 (%1) + Double-click to delete this bend point + Double-click + Drag or double-click + or alt-drag to move the segment + Disconnect all wires from %1 + Disconnect all wires from %1 items + Change Resistance from %1 to %2 + Change image from %1 to %2 + + Change %1 from %2 to %3 + from %1 + Move leg of + Flip %2 (%1) + Change leg curvature for %1. + Change leg bendpoint for %1. + change pin labels + Delete ratsnest + Fritzing + This seems like an attempt to create a trace across layers. This circumstance should not arise: please contact the developers. + Create and connect %1 + wire + trace + Create wire from Ratsnest + Note text change + Unrouted connections are highlighted in yellow. + There are no unrouted connections + Unrouted connections + %1 Note: you can also trigger this display by mousing down on the routing status text in the status bar. + Deselect all - + Deseleziona tutto + Part '%1' not found in sketch + + Resize board to %1 %2 - Ridimensiona basetta da %1 %2 + Ridimensiona basetta da %1 %2 + show %n part label(s) @@ -6793,6 +8620,7 @@ Note: you can also trigger this display by mousing down on the routing status te + hide %n part label(s) @@ -6800,14 +8628,17 @@ Note: you can also trigger this display by mousing down on the routing status te + Resize ruler to %1 %2 + Add %1 parts + test connectors @@ -6815,24 +8646,30 @@ Note: you can also trigger this display by mousing down on the routing status te SqliteReferenceModel + + The swapping mechanism is disabled for: + and %1 other parts + and %1 other properties + property '%1' in part '%2' with id '%3'. + part '%1' with id '%2'; possibly because it has no 'family' property. @@ -6840,14 +8677,17 @@ Note: you can also trigger this display by mousing down on the routing status te Stripboard + Restored + Cut - + Taglia + %1 %n strip(s) @@ -6855,14 +8695,17 @@ Note: you can also trigger this display by mousing down on the routing status te + rows + columns + %1 layout @@ -6870,18 +8713,22 @@ Note: you can also trigger this display by mousing down on the routing status te SymbolPaletteItem + voltage - + voltaggio + label - + etichetta + Net labels + Net labels cannot be blank @@ -6889,254 +8736,317 @@ Note: you can also trigger this display by mousing down on the routing status te TipsAndTricks + Tips and Tricks - + Trucchi e Suggerimenti + Fritzing Tips and Tricks + parts + If you can't find a part in the Parts Bin, the Generic IC is your friend. Drag it onto your sketch, then use the widgets in the Inspector to: choose from among 25 different through-hole and SMD packages; change the pin label; and--for DIPs and SIPs--change the number of pins. You can also change the pin names with the Pin Label editor + An icon in the parts bin may actually represent multiple related parts. So when you drag an icon from the parts bin into a sketch, make sure you look at the inspector. The inspector will display the range of choices available for you to modify a part, or swap it for a related part. The parts bin icon will also be a little 'stack' and not just a flat icon. + The Inspector Window--which lets you change the properties of parts--is only enabled for parts that are in a sketch (not for parts still in a Parts Bin). + moving and selection + To constrain the motion of a part to horizontal or vertical, hold down the shift key as you drag it. + If you're having trouble selecting a part or a wire (segment), try selecting the part that's in the way and send it to the back: use the Raise and Lower functions on the Part menu or the context menu (right-click menu). + To more precisely move a selection of parts, use the arrow keys. Shift-arrow moves by 10 units. + Click on the mouse position indicator in the status bar (at the bottom) to toggle the units from in to mm to px. + rotation - + rotazione + To free-rotate a part in Breadboard or PCB view, select it, then hover your mouse near one of the corners until you see the rotate cursor. Mouse down and that corner will follow your mouse as you drag. + To free-rotate a logo text or image item in PCB view hold down the Alt (Linux: meta) key and free-rotate as usual. + layers and views + To drag the canvas, hold down the space bar and drag with the mouse. + To toggle the visibility of layer in a view, go to the view menu and choose one of the view layer items. Or open up the <b>Layers</b> palette from the <b>Window</b> menu. + When you export images from Fritzing, you can choose which layers are exported. Before you choose 'Export...', go into the 'View' menu and hide the layers you don't want to be visible. + part labels + To edit a part label, double-click it, or use the text input widget in the inspector window. + To display different properties in a part label, as well as rotate it, or change the font, right-click the label. + To move a part label independently from its part, select the part first--both the part and the label will be highlighted. Once the label is selected you can drag it. + wires and bendpoints + To add a bendpoint to a wire, double-click where you want the bendpoint. + To delete a bendpoint from a wire, double-click it. + In Schematic or PCB view, if you drag from a bendpoint with the Alt (Linux: Meta) key down, you will drag out a new wire from that bendpoint. + To drag a wire segment (a section of a wire between two bendpoints), drag it with the Alt (Linux: Meta) key down. If you also hold down the shift key, the wire segment will be constrained to horizontal or vertical motion. + Use shift-drag on a wire end or bendpoint to constrain its wire segment to an angle of 45 degrees (or some multiple of 45 degrees). If the wire segment is connected to other wire segments, the segment you're dragging will snap to make 90 degree angles with the neighboring wire segment. + connections + To see all the connectors connected to a given connector, hold the mouse down on the connector--all the connections will be highlighted. + pcb layout + Always lead a trace straight out of a pin. This helps to prevent short circuits. + Through-hole parts can be traced from either side of a PCB. + It makes life easier to route traces horizontally on one side of a PCB and vertically on the other side. + Route traces in 45-degree angles to reduce noise. + If Fritzing is missing your special part and you don't want to build one by yourself, then use pinheaders as connectors and the grid to align them. + You can put your own Logo in the silkscreen of your PCB. Just use the Logo part of the core library and select your own file. SVG is the best format. + Smaller PCBs are more affortable than larger ones. Save space and money. + Use copper-blocker parts to mask out areas that you want free of copper fill. + To change trace width, select a trace then use the <b>width</b> combo box in the Inspector. You can use the drop-down or just type in a number (from 8 to 128). + parts editor + examples + Get a jump start by looking at the example circuits under File > Examples. + Can't find your part? Search for it by clicking the magnifier icon in the Parts Bin and type in some keywords + A ratsnest line (very thin 'wire') between connections in one view means that those connections are somehow connected in another view. + To create a custom shape for your PCB, import an SVG file. + To make a stylish Arduino shield in no time, switch the shape of the PCB from a rectangle to the Arduino + pcb production + Have your PCB quickly and easily produced with Fritzing Fab. Hover over the 'Fabricate' button to get a quote. + Fritzing stores files for custom parts, generated parts, and for other temporary and long-term purposes in a 'local storage folder'. On Mac and Linux this is usually ~/.config/Fritzing/. Under Windows Vista and above, it is something like C:\Users\[user name]\AppData\Roaming\Fritzing\; under Windows XP is something like C:\Documents and Settings\[user name]\Application Data\Fritzing\. + Check out Parts Editor Help under the <b>Help</b> Menu. + Before using the Parts Editor, see whether a Generic IC, Mystery Part, or Pin Header will do the job. Once you drop one of these into your sketch, you can change the number of pins, pin spacing, and other properties. + In the Parts Editor, to select a graphic underneath another graphic, use the mouse wheel while holding down the shift key. + You can use the Parts Editor to find the SVG file for a part's image for a given view. In the Parts Editor, click on the tab for that view, then use <b>Show in Folder</b> under the <b>File</b> Menu + Do not store your custom part files in the Fritzing installation folder. If you upgrade Fritzing, these files will probably be deleted. Also, files in the Fritzing installation folder will not be saved in sketch (.fzz) files, so you won't be able to share them. + notes + To insert a clickable URL into a note, select some text in the note and type ctrl-l (Mac: command-l). (That's 'l' as in the first letter of 'link'.) To modify an existing link select the linked text and use ctrl-l (command-l) again. + local file storage + curves and bendable legs + In Breadboard view, to drag a part with bendable legs while keeping it connected to the breadboard, hold the Alt (Linux: Meta) key down when you start dragging. + In Breadboard view, to drag out a wire from the end of a bendable leg, drag with the Alt (Linux: Meta) key down. + In Breadboard or PCB view, to add a curve to a wire or bendable leg, drag with the Control (Mac: Command) key down. You can set whether curvy wires are the default in Preferences. + When using the Fritzing Fab Service, If there are empty areas of the PCB that you do not want filled with copper, use the copper-blocker part. This resizable part will mask out copper fill in the rectangle it covers. @@ -7144,10 +9054,12 @@ Note: you can also trigger this display by mousing down on the routing status te TraceWire + width - larghezza + larghezza + Select from the dropdown, or type in any value from %1 to %2 @@ -7155,154 +9067,192 @@ Note: you can also trigger this display by mousing down on the routing status te TranslatorListModel + English - %1 Inglese - %1 + French - %1 Francese - %1 + German - %1 Tedesco - %1 + Spanish - %1 Spagnolo - %1 + Japanese - %1 Giapponese - %1 + Portuguese (European)- %1 Portoghese (Europeo) - %1 + Portuguese (Brazilian) - %1 Portoghese (Brasiliano) - %1 + Dutch - %1 Olandese - %1 + Russian - %1 Russo - %1 + Italian - %1 Italiano - %1 + Hebrew - %1 Ebraico - %1 + Arabic - %1 Arabo - %1 + Hindi - %1 + Hungarian - %1 + Chinese (Simplified) - %1 + Estonian - %1 + Chinese (Traditional) - %1 + Polish - %1 + Czech - %1 + Turkish - %1 + Swedish - %1 + Romanian - %1 + Thai - %1 + Greek - %1 + Bulgarian - %1 + Galician - %1 + Korean - %1 + Indonesian - %1 + Slovak - %1 + Bengali - %1 + Persian - %1 + Slovenian - %1 + Marathi - %1 + Ukrainian - %1 + Danish - %1 + Macedonian - %1 + Serbian - %1 + Urdu - %1 @@ -7310,82 +9260,102 @@ Note: you can also trigger this display by mousing down on the routing status te UpdateDialog + Close Chiudi + A new main release is available for downloading: Una nuova release principale è disponibile per il download: + A new interim release is available for downloading: Una nuova release intermedia è disponibile per il download: + Update parts + <p>No new versions found.</p> + <p>Checking for new releases...</p> + <p>Fritzing is unable to check for--and update--new parts.<br/>If you want this functionality, please enable write permission on this folder:<br/> '%1'.</p> + <p>Checking for new parts...</p> + <p>No new releases or new parts found</p> + <p>Sorry, unable to retrieve update info</p> + <p>Sorry, unable to retrieve parts update info</p> + <p>Downloading new parts...</p> + <p>Sorry, unable to download new parts</p> + <p>New parts successfully installed!</p><p>Fritzing must be restarted, so the 'Close' button will close Fritzing.<br/>The new parts will be available when you run Fritzing again.</p> + <p>Sorry, unable to install new parts: %1<br/>Fritzing must nevertheless be restarted, so the 'Close' button will close Fritzing.</p> + <p><b>There is a parts library update available!</b></p><p>Would you like Fritzing to download and install the update now?<br/>See the <a href='https://github.com/fritzing/fritzing-parts/compare/%1...master'>list of changes here.</a></p><p>Note: the update may take some minutes and you will have to restart Fritzing.<br/>You can also update later via the <i>Help &rarr; Check for Updates</i> menu.</p> + New files: - + Nuovi file: + Modified Files: - + File Modificati: + Fritzing was unable to clean the files, so the update cannot proceed.<br/>You may have to reinstall Fritzing. + <p>Installing new parts. This may take a few minutes.<br/>Please do not interrupt the process, as your parts folder could be damaged.</p> @@ -7393,190 +9363,266 @@ Note: you can also trigger this display by mousing down on the routing status te WelcomeView + Recent Sketches - + Sketch Recenti + New Sketch - + Nuovo Sketch + Open Sketch - + Apri Sketch + Fab Shop - - - - Fritzing CreatorKit - + Negozio + Fritzing Fab is an easy and affordable service for producing professional PCBs from your Fritzing sketches. - + Fritzing Fab è un servizio facile e conveniente per produrre circuiti stampati professionali dai tuoi sketch Fritzing. + produce your first pcb now >> - + produci il tuo primo circuito stampato ora >> + Order your PCB now. - + Ordina il tuo PCB ora. + <a href='%1'><img src='%2'/></a> + Projects - + Progetti + Blog - + + Fritzing News. - + Novità Fritzing. + Fritzing Projects. - + Progetti Fritzing. + <a href='%1'><img src='%2' /></a> + No recent sketches found - + Nessuno sketch recente + Unable to reach blog.fritzing.org - + Impossibile connettersi a blog.fritzing.org Unable to reach friting.org/projects - + Impossibile connettersi a fritzing.org/projects + Tip of the Day: - + Suggerimento del Giorno: + All Tips - + Tutti i Suggerimenti + Next Tip - + Suggerimento Successivo + Fritzing Fab - The Fritzing Creator Kit is out of Stock. For Updates please visit the fritzing.blog + + Donate + + + + + Fritzing development needs you + + + + + Software development and maintenance is a lot of work. Without your support, it is not possible to keep that up. + + + + + Donate and leave a comment. + + + + + Donate now + + + + + Unable to reach fritzing.org/projects Wire + + blue blu + + red rosso + + black nero + + yellow giallo + + green verde + + grey grigio + + white bianco + + orange arancione + thin (16 mil) - + sottile (16 mil) + standard (24 mil) - + normale (24 mil) + thick (32 mil) - + spesso (32 mil) + extra thick (48 mil) - + extra spessa (48 mil) + color - colore + colore + + brown - + marrone + + purple - + porpora + super fine (8 mil) - + super fine (8 mil) + extra thin (12 mil) - + extra sottile (12 mil) + Banded + + pink - + rosa + + ochre - + ocra + + cyan - + ciano ZoomSlider + % - + % From b72de1eab31a9ee5798312c5691147250cc023b6 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Sun, 24 Nov 2019 12:16:36 +0100 Subject: [PATCH 48/61] Fix issue #3338 QSvgText::bounds is not implemented (QTBUG-32405). Fritzing uses a custom implementation to determine position and size of a text. If the text was to small, the position would not be set correctly. --- pri/svg.pri | 6 +- src/items/layerkinpaletteitem.cpp | 90 +------------------- src/items/partfactory.cpp | 5 +- src/svg/svgtext.cpp | 88 +++++++++++++++++++ src/svg/svgtext.h | 18 ++++ tests/auto/test_svg/test_svg.pro | 6 ++ tests/auto/test_svg/test_svgtext.cpp | 123 +++++++++++++++++++++++++++ 7 files changed, 244 insertions(+), 92 deletions(-) create mode 100644 src/svg/svgtext.cpp create mode 100644 src/svg/svgtext.h create mode 100644 tests/auto/test_svg/test_svgtext.cpp diff --git a/pri/svg.pri b/pri/svg.pri index 52163b5c6..428ddb423 100644 --- a/pri/svg.pri +++ b/pri/svg.pri @@ -28,7 +28,8 @@ HEADERS += src/svg/svgfilesplitter.h \ src/svg/gedaelement2svg.h \ src/svg/gedaelementparser.h \ src/svg/gedaelementgrammar_p.h \ - src/svg/gedaelementlexer.h + src/svg/gedaelementlexer.h \ + $$PWD/../src/svg/svgtext.h SOURCES += src/svg/svgfilesplitter.cpp \ src/svg/svgpathparser.cpp \ @@ -46,4 +47,5 @@ SOURCES += src/svg/svgfilesplitter.cpp \ src/svg/gedaelement2svg.cpp \ src/svg/gedaelementparser.cpp \ src/svg/gedaelementgrammar.cpp \ - src/svg/gedaelementlexer.cpp + src/svg/gedaelementlexer.cpp \ + $$PWD/../src/svg/svgtext.cpp diff --git a/src/items/layerkinpaletteitem.cpp b/src/items/layerkinpaletteitem.cpp index 97732f88f..413f4906e 100644 --- a/src/items/layerkinpaletteitem.cpp +++ b/src/items/layerkinpaletteitem.cpp @@ -26,15 +26,12 @@ along with Fritzing. If not, see . #include "../utils/textutils.h" #include "../utils/folderutils.h" #include "../svg/svgfilesplitter.h" +#include "../svg/svgtext.h" #include //////////////////////////////////////////////// -static QString IDString("-_-_-text-_-_-%1"); - -//////////////////////////////////////////////// - LayerKinPaletteItem::LayerKinPaletteItem(PaletteItemBase * chief, ModelPart * modelPart, ViewLayer::ViewID viewID, const ViewGeometry & viewGeometry, long id, QMenu* itemMenu) : PaletteItemBase(modelPart, viewID, viewGeometry, id, itemMenu), m_layerKinChief(chief), m_ok(false), m_passMouseEvents(false) @@ -312,13 +309,6 @@ QString SchematicTextLayerKinPaletteItem::makeFlipTextSvg() { return doc.toString(); } -#define MINMAX(mx, my) \ - if (mx < minX) minX = mx; \ - if (mx > maxX) maxX = mx; \ - if (my < minY) minY = my; \ - if (my > maxY) maxY = my; - - void SchematicTextLayerKinPaletteItem::positionTexts(QList & texts) { // TODO: reuse these values unless the pin labels have changed //QString id = IDString.arg(0); @@ -340,7 +330,7 @@ void SchematicTextLayerKinPaletteItem::positionTexts(QList & texts) TextThing textThing; QRectF viewBox; QMatrix matrix; - renderText(image, text, textThing.minX, textThing.minY, textThing.maxX, textThing.maxY, matrix, viewBox); + SvgText::renderText(image, text, textThing.minX, textThing.minY, textThing.maxX, textThing.maxY, matrix, viewBox); double newX = (image.width() - textThing.maxX) * viewBox.width() / image.width(); double oldX = textThing.minX * viewBox.width() / image.width(); @@ -366,82 +356,6 @@ void SchematicTextLayerKinPaletteItem::positionTexts(QList & texts) } -void SchematicTextLayerKinPaletteItem::renderText(QImage & image, QDomElement & text, int & minX, int & minY, int & maxX, int & maxY, QMatrix & matrix, QRectF & viewBox) -{ - QString oldid = text.attribute("id"); - text.setAttribute("id", IDString); - - // TODO: handle inherited fill/stroke values - QString oldFill = text.attribute("fill"); - text.setAttribute("fill", "black"); - QString oldStroke = text.attribute("stroke"); - text.setAttribute("stroke", "black"); - text.setTagName("text"); - - image.fill(0xffffffff); - QByteArray byteArray = text.ownerDocument().toByteArray(); - QSvgRenderer renderer(byteArray); - QPainter painter; - painter.begin(&image); - painter.setRenderHint(QPainter::Antialiasing, false); - renderer.render(&painter /*, sourceRes */); - painter.end(); - -#ifndef QT_NO_DEBUG - image.save(FolderUtils::getTopLevelUserDataStorePath() + "/renderText.png"); -#endif - - viewBox = renderer.viewBoxF(); - double x = text.attribute("x").toDouble(); - double y = text.attribute("y").toDouble(); - QPointF xy(x, y); - matrix = renderer.matrixForElement(IDString); - QPointF mxy = matrix.map(xy); - - QPointF p(image.width() * mxy.x() / viewBox.width(), image.height() * mxy.y() / viewBox.height()); - QPoint iq((int) p.x(), (int) p.y()); - - minX = image.width() + 1; - maxX = -1; - minY = image.height() + 1; - maxY = -1; - - // spiral around q - int limit = qMax(image.width(), image.height()); - for (int lim = 0; lim < limit; lim++) { - int t = qMax(0, iq.y() - lim); - int b = qMin(iq.y() + lim, image.height() - 1); - int l = qMax(0, iq.x() - lim); - int r = qMin(iq.x() + lim, image.width() - 1); - - for (int iy = t; iy <= b; iy++) { - if (image.pixel(l, iy) == 0xff000000) { - MINMAX(l, iy); - } - if (image.pixel(r, iy) == 0xff000000) { - MINMAX(r, iy); - } - } - - for (int ix = l + 1; ix < r; ix++) { - if (image.pixel(ix, t) == 0xff000000) { - MINMAX(ix, t); - } - if (image.pixel(ix, b) == 0xff000000) { - MINMAX(ix, b); - } - } - } - - text.setTagName("g"); - if (oldid.isEmpty()) text.removeAttribute("id"); - else text.setAttribute("id", oldid); - if (oldFill.isEmpty()) text.removeAttribute("fill"); - else text.setAttribute("fill", oldFill); - if (oldStroke.isEmpty()) text.removeAttribute("stroke"); - else text.setAttribute("stroke", oldStroke); -} - void SchematicTextLayerKinPaletteItem::clearTextThings() { m_textThings.clear(); } diff --git a/src/items/partfactory.cpp b/src/items/partfactory.cpp index 90108c07b..e7bccb23d 100644 --- a/src/items/partfactory.cpp +++ b/src/items/partfactory.cpp @@ -55,6 +55,7 @@ along with Fritzing. If not, see . #include "../utils/lockmanager.h" #include "../utils/textutils.h" #include "../utils/graphicsutils.h" +#include "../svg/svgtext.h" #include @@ -636,7 +637,7 @@ void PartFactory::fixSubpartBounds(QDomElement & top, ModelPartShared * mps) QRectF elementBounds = renderer.boundsOnElement(mps->subpartID()); QRectF bounds = m.mapRect(elementBounds); // bounds is in terms of the whole svg - // unfortunately, QSvgRenderer doesn't deal with text bounds + // unfortunately, QSvgRenderer doesn't deal with text bounds, QTBUG-32405 int w = qCeil(sWidth * GraphicsUtils::SVGDPI); int h = qCeil(sWidth * GraphicsUtils::SVGDPI); @@ -658,7 +659,7 @@ void PartFactory::fixSubpartBounds(QDomElement & top, ModelPartShared * mps) int minX, minY, maxX, maxY; QMatrix matrix; QRectF viewBox2; - SchematicTextLayerKinPaletteItem::renderText(image, text, minX, minY, maxX, maxY, matrix, viewBox2); + SvgText::renderText(image, text, minX, minY, maxX, maxY, matrix, viewBox2); QRectF r(minX * viewBox.width() / image.width(), minY * viewBox.height() / image.height(), (maxX - minX) * viewBox.width() / image.width(), diff --git a/src/svg/svgtext.cpp b/src/svg/svgtext.cpp new file mode 100644 index 000000000..8b7cd6507 --- /dev/null +++ b/src/svg/svgtext.cpp @@ -0,0 +1,88 @@ +#include "svgtext.h" + +#include +#include +#include +#include +#include +#include + +#define MINMAX(mx, my) \ + if (mx < minX) minX = mx; \ + if (mx > maxX) maxX = mx; \ + if (my < minY) minY = my; \ + if (my > maxY) maxY = my; + +static QString IDString("-_-_-text-_-_-%1"); + +void SvgText::renderText(QImage & image, QDomElement & text, int & minX, int & minY, int & maxX, int & maxY, QMatrix & matrix, QRectF & viewBox) +{ + QString oldid = text.attribute("id"); + text.setAttribute("id", IDString); + + // TODO: handle inherited fill/stroke values + QString oldFill = text.attribute("fill"); + text.setAttribute("fill", "black"); + QString oldStroke = text.attribute("stroke"); + text.setAttribute("stroke", "black"); + text.setTagName("text"); + + image.fill(0xffffffff); + QByteArray byteArray = text.ownerDocument().toByteArray(); + QSvgRenderer renderer(byteArray); + QPainter painter; + painter.begin(&image); + painter.setRenderHint(QPainter::Antialiasing, false); + renderer.render(&painter /*, sourceRes */); + painter.end(); + + viewBox = renderer.viewBoxF(); + double x = text.attribute("x").toDouble(); + double y = text.attribute("y").toDouble(); + QPointF xy(x, y); + matrix = renderer.matrixForElement(IDString); + QPointF mxy = matrix.map(xy); + + QPointF p(image.width() * mxy.x() / viewBox.width(), image.height() * mxy.y() / viewBox.height()); + QPoint iq((int) p.x(), (int) p.y()); + + minX = p.x(); + maxX = p.x(); + minY = p.y(); + maxY = p.y(); + + // spiral around q + int limit = qMax(image.width(), image.height()); + for (int lim = 0; lim < limit; lim++) { + int t = qMax(0, iq.y() - lim); + int b = qMin(iq.y() + lim, image.height() - 1); + int l = qMax(0, iq.x() - lim); + int r = qMin(iq.x() + lim, image.width() - 1); + + for (int iy = t; iy <= b; iy++) { + if (image.pixel(l, iy) == 0xff000000) { + MINMAX(l, iy); + } + if (image.pixel(r, iy) == 0xff000000) { + MINMAX(r, iy); + } + } + + for (int ix = l + 1; ix < r; ix++) { + if (image.pixel(ix, t) == 0xff000000) { + MINMAX(ix, t); + } + if (image.pixel(ix, b) == 0xff000000) { + MINMAX(ix, b); + } + } + } + + text.setTagName("g"); + if (oldid.isEmpty()) text.removeAttribute("id"); + else text.setAttribute("id", oldid); + if (oldFill.isEmpty()) text.removeAttribute("fill"); + else text.setAttribute("fill", oldFill); + if (oldStroke.isEmpty()) text.removeAttribute("stroke"); + else text.setAttribute("stroke", oldStroke); +} diff --git a/src/svg/svgtext.h b/src/svg/svgtext.h new file mode 100644 index 000000000..8ee27818b --- /dev/null +++ b/src/svg/svgtext.h @@ -0,0 +1,18 @@ +#ifndef SVGTEXT_H +#define SVGTEXT_H + +class QImage; +class QDomElement; +class QMatrix; +class QRectF; + +class SvgText { +public: + // Works around QTBUG-32405 + // TODO: Rename, for example textBounds. "renderText" is misleading, as we are not interested in the image, just the + // size and transforms + // TODO: Refactor this method so it looks and behaves more similar to qsvg (pull reqeust to QSvgText::bounds ?) + static void renderText(QImage & image, QDomElement & text, int & minX, int & minY, int & maxX, int & maxY, QMatrix & matrix, QRectF & viewBox); +}; + +#endif // SVGTEXT_H diff --git a/tests/auto/test_svg/test_svg.pro b/tests/auto/test_svg/test_svg.pro index 82e85b863..e37f29d6c 100644 --- a/tests/auto/test_svg/test_svg.pro +++ b/tests/auto/test_svg/test_svg.pro @@ -13,11 +13,17 @@ # along with Fritzing. If not, see . # ********************************************************************/ +boost_root = ../../boost_1_70_0 include($$absolute_path(../../../pri/boostdetect.pri)) +QT += core xml svg + HEADERS += $$files(*.h) SOURCES += $$files(*.cpp) INCLUDEPATH += $$absolute_path(../../../src) + +HEADERS += $$files(../../../src/svg/svgtext.h) +SOURCES += $$files(../../../src/svg/svgtext.cpp) #INCLUDEPATH += $$top_srcdir # unix:QMAKE_POST_LINK = $$PWD/generated/test_svg diff --git a/tests/auto/test_svg/test_svgtext.cpp b/tests/auto/test_svg/test_svgtext.cpp new file mode 100644 index 000000000..cb07c4237 --- /dev/null +++ b/tests/auto/test_svg/test_svgtext.cpp @@ -0,0 +1,123 @@ +#include + +#include "svg/svgtext.h" + +#include +#include +#include +#include +#include +#include + +BOOST_AUTO_TEST_CASE( svgtext_bounds ) +{ + QString input = +R"x( + + + svg.schematic.Optocoupler_TLP621_schematic.svg + + + + + + + + + 1 + + + + + + + + + 2 + + + + + + + + + + + + + + 4 + + + + + + + + + 3 + + + + + + + + + + + +)x"; + + + // A QApplication instance is necessary if fonts are used in the SVG + int argc = 0; + QApplication app(argc, nullptr); + + QDomDocument doc; + QString errorStr; + int errorLine; + int errorColumn; + if (!doc.setContent(input, &errorStr, &errorLine, &errorColumn)) { + throw; + } + + QDomElement root = doc.documentElement(); + QDomNodeList nodeList = root.elementsByTagName("text"); + QList texts; + for (int i = 0; i < nodeList.count(); i++) { + texts.append(nodeList.at(i).toElement()); + } + + foreach (QDomElement text, texts) { + text.setTagName("g"); + } + + QImage image(116, 102, QImage::Format_Mono); // schematic text is so small it doesn't render unless bitmap is double-sized + + foreach (QDomElement text, texts) { + // TextThing textThing; + QRectF viewBox; + QMatrix matrix; + int minX=1; + int minY=1; + int maxX=0; + int maxY=0; + + SvgText::renderText(image, text, minX, minY, maxX, maxY, matrix, viewBox); + + BOOST_REQUIRE_LE(minX,maxX); + BOOST_REQUIRE_LE(minY,maxY); + + } + + foreach (QDomElement text, texts) { + text.setTagName("text"); + } + +} + + From e78323248f65651170f940b536f38aee77d829b1 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Sat, 4 Feb 2017 10:05:05 +0100 Subject: [PATCH 49/61] folderutils.cpp: Fix getAppPartsSubFolder2 returns current working directory if fritzing-parts folder is not found getApplicationSubFolder returns QDir() if the directory can not be found, but QDir() returns the current working directory, which nearly always exists and probably is the wrong path. As getAppPartsSubFolder2 only checks for existence of that directory we end up with the wrong directory if parts folder is used instead for fritzing-parts. Therefore check if when we ask for fritzing-parts folder we really get a folder with that name. --- src/utils/folderutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/folderutils.cpp b/src/utils/folderutils.cpp index 884a45e54..8d929f820 100644 --- a/src/utils/folderutils.cpp +++ b/src/utils/folderutils.cpp @@ -118,12 +118,12 @@ QDir FolderUtils::getAppPartsSubFolder(QString search) { QDir FolderUtils::getAppPartsSubFolder2(QString search) { if (m_partsPath.isEmpty()) { QDir dir = getApplicationSubFolder("fritzing-parts"); - if (dir.exists()) { + if (dir.exists() && dir.dirName().endsWith("fritzing-parts")) { m_partsPath = dir.absolutePath(); } else { QDir dir = getApplicationSubFolder("parts"); - if (dir.exists()) { + if (dir.exists() && dir.dirName().endsWith("parts")) { m_partsPath = dir.absolutePath(); } } From 81dff69b3c1435cbf95fecb8334e3ed0b59a1274 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Sat, 4 Feb 2017 10:05:05 +0100 Subject: [PATCH 50/61] folderutils.cpp: Fix getAppPartsSubFolder2 returns current working directory if fritzing-parts folder is not found getApplicationSubFolder returns QDir() if the directory can not be found, but QDir() returns the current working directory, which nearly always exists and probably is the wrong path. As getAppPartsSubFolder2 only checks for existence of that directory we end up with the wrong directory if parts folder is used instead for fritzing-parts. Therefore check if when we ask for fritzing-parts folder we really get a folder with that name. --- src/utils/folderutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/folderutils.cpp b/src/utils/folderutils.cpp index 6afce9a27..c6761b3b0 100644 --- a/src/utils/folderutils.cpp +++ b/src/utils/folderutils.cpp @@ -118,12 +118,12 @@ QDir FolderUtils::getAppPartsSubFolder(QString search) { QDir FolderUtils::getAppPartsSubFolder2(QString search) { if (m_partsPath.isEmpty()) { QDir dir = getApplicationSubFolder("fritzing-parts"); - if (dir.exists()) { + if (dir.exists() && dir.dirName().endsWith("fritzing-parts")) { m_partsPath = dir.absolutePath(); } else { QDir dir = getApplicationSubFolder("parts"); - if (dir.exists()) { + if (dir.exists() && dir.dirName().endsWith("parts")) { m_partsPath = dir.absolutePath(); } } From ba18b850635704a0698e30e8f16b72e2a49f4ad7 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 27 Nov 2019 09:27:24 +0100 Subject: [PATCH 51/61] Support recent OS versions in version string --- src/lib/qtsysteminfo/QtSystemInfo.cpp | 47 +++++++++++++++------------ 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/src/lib/qtsysteminfo/QtSystemInfo.cpp b/src/lib/qtsysteminfo/QtSystemInfo.cpp index 9afc3c7f3..50d4abe2a 100644 --- a/src/lib/qtsysteminfo/QtSystemInfo.cpp +++ b/src/lib/qtsysteminfo/QtSystemInfo.cpp @@ -19,7 +19,6 @@ class QtSystemInfoPrivate virtual QtSystemInfo::ArchitectureType architecture() = 0; virtual QtSystemInfo::SystemType systemType() = 0; - virtual QString architectureName() = 0; virtual QString kernelName() = 0; virtual QString kernelVersion() = 0; virtual QString systemName() = 0; @@ -63,11 +62,6 @@ class QtSystemInfoUnix: public QtSystemInfoPrivate } } - virtual QString architectureName() - { - return m_architectureName; - } - virtual QtSystemInfo::ArchitectureType architecture() { return m_architecture; @@ -141,6 +135,18 @@ class QtSystemInfoMac: public QtSystemInfoUnix return "10.5"; case QSysInfo::MV_10_6: return "10.6"; + case QSysInfo::MV_10_7: + return "10.7"; + case QSysInfo::MV_10_8: + return "10.8"; + case QSysInfo::MV_10_9: + return "10.9"; + case QSysInfo::MV_10_10: + return "10.10"; + case QSysInfo::MV_10_11: + return "10.11"; + case QSysInfo::MV_10_12: + return "10.12"; default: return UNKNOWN; } @@ -431,19 +437,6 @@ class QtSystemInfoWindows: public QtSystemInfoPrivate # endif } - virtual QString architectureName() - { - switch (architecture()) - { - case QtSystemInfo::X86_64: - return "x86_64"; - case QtSystemInfo::I386: - return "i386"; - default: - return UNKNOWN; - } - } - virtual QString kernelName() { if (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) @@ -470,6 +463,12 @@ class QtSystemInfoWindows: public QtSystemInfoPrivate return "6.0"; case QSysInfo::WV_6_1: return "6.1"; + case QSysInfo::WV_6_2: + return "6.2"; + case QSysInfo::WV_6_3: + return "6.3"; + case QSysInfo::WV_10_0: + return "10.0"; case QSysInfo::WV_CE: return "1.0"; case QSysInfo::WV_CENET: @@ -504,7 +503,7 @@ class QtSystemInfoWindows: public QtSystemInfoPrivate return "XP"; case QSysInfo::WV_2003: # ifdef Q_OS_WIN64 - return "XP Proffessional 64"; + return "XP Professional 64"; # else return "2003 Server"; # endif @@ -512,6 +511,12 @@ class QtSystemInfoWindows: public QtSystemInfoPrivate return "Vista / Server 2008"; case QSysInfo::WV_WINDOWS7: return "7 / Server 2008 R2"; + case QSysInfo::WV_WINDOWS8: + return "8"; + case QSysInfo::WV_WINDOWS8_1: + return "8.1"; + case QSysInfo::WV_WINDOWS10: + return "10"; default: return UNKNOWN; } @@ -548,7 +553,7 @@ QtSystemInfo::~QtSystemInfo() QString QtSystemInfo::architectureName() const { - return d->architectureName(); + return QSysInfo::currentCpuArchitecture(); } QtSystemInfo::ArchitectureType QtSystemInfo::architecture() const From 6efd5ec2f1391a0f9f11efe3c39affb5185adf9c Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 27 Nov 2019 09:28:17 +0100 Subject: [PATCH 52/61] More http -> https and routing fixes --- src/dialogs/quotedialog.cpp | 2 +- src/fapplication.cpp | 4 ++-- src/sketch/pcbsketchwidget.cpp | 2 +- src/sketch/welcomeview.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dialogs/quotedialog.cpp b/src/dialogs/quotedialog.cpp index 6fb332c5e..e7bf13909 100644 --- a/src/dialogs/quotedialog.cpp +++ b/src/dialogs/quotedialog.cpp @@ -310,7 +310,7 @@ void QuoteDialog::setText() { } void QuoteDialog::visitFritzingFab() { - QDesktopServices::openUrl(QString("http://fab.fritzing.org")); + QDesktopServices::openUrl(QString("https://fab.fritzing.org")); } QString QuoteDialog::countArgs() { diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 843c79b27..72159c991 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -1206,7 +1206,7 @@ int FApplication::startup() //if (!fabEnabled) { QNetworkAccessManager * manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotOrderFab(QNetworkReply *))); - manager->get(QNetworkRequest(QUrl(QString("http://fab.fritzing.org/launched%1").arg(Version::makeRequestParamsString(true))))); + manager->get(QNetworkRequest(QUrl(QString("https://fab.fritzing.org/launched%1").arg(Version::makeRequestParamsString(true))))); //} if (m_progressIndex >= 0) splash.showProgress(m_progressIndex, LoadProgressEnd); @@ -1429,7 +1429,7 @@ void FApplication::checkForUpdates(bool atUserRequest) } } - QString atom = QString("http://fritzing.org/download/feed/atom/%1/%2") + QString atom = QString("https://fritzing.org/download/feed/atom/%1/%2") .arg(PLATFORM_NAME) .arg(Version::makeRequestParamsString(true)); DebugDialog::debug(atom); diff --git a/src/sketch/pcbsketchwidget.cpp b/src/sketch/pcbsketchwidget.cpp index b4af2b3aa..9fadc68c0 100644 --- a/src/sketch/pcbsketchwidget.cpp +++ b/src/sketch/pcbsketchwidget.cpp @@ -2753,7 +2753,7 @@ void PCBSketchWidget::requestQuote(bool byUser) { manager->setProperty("count", countArgs); QString filename = QUrl::toPercentEncoding(filenameIf()); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotFabQuote(QNetworkReply *))); - QString string = QString("https://aisler.net/meta/fritzing_quote%1&area=%2&count=%3&filename=%4&byuser=%5") + QString string = QString("https://fab.fritzing.org/fritzing-fab/quote%1&area=%2&count=%3&filename=%4&byuser=%5") .arg(paramString) .arg(area) .arg(countArgs) diff --git a/src/sketch/welcomeview.cpp b/src/sketch/welcomeview.cpp index 64717024c..6a4d22745 100644 --- a/src/sketch/welcomeview.cpp +++ b/src/sketch/welcomeview.cpp @@ -484,7 +484,7 @@ QWidget * WelcomeView::initShop() { m_fabUberFrame = createShopContentFrame(":/resources/images/pcbs_2013.png", tr("Fritzing Fab"), tr("Fritzing Fab is an easy and affordable service for producing professional PCBs from your Fritzing sketches."), - "http://fab.fritzing.org/", + "https://fab.fritzing.org/", tr("produce your first pcb now >>"), tr("Order your PCB now."), ":/resources/images/icons/WS-fabLogo.png", @@ -591,12 +591,12 @@ QWidget * WelcomeView::initBlog() { QWidget * headerFrame = createHeaderFrame(tr("Projects"), "Projects", tr("Blog"), "Blog", m_inactiveHeaderLabelColor, m_activeHeaderLabelColor, m_projectsLabel, m_blogLabel); frameLayout->addWidget(headerFrame); - m_blogListWidget = createBlogContentFrame("https://blog.fritzing.org", tr("Fritzing News."), ":/resources/images/icons/WS-blogLogo.png", "#802742"); + m_blogListWidget = createBlogContentFrame("http://blog.fritzing.org", tr("Fritzing News."), ":/resources/images/icons/WS-blogLogo.png", "#802742"); m_blogUberFrame = m_blogListWidget; while (m_blogUberFrame->parentWidget()) m_blogUberFrame = m_blogUberFrame->parentWidget(); frameLayout->addWidget(m_blogUberFrame); - m_projectListWidget = createBlogContentFrame("https://fritzing.org/projects/", tr("Fritzing Projects."), ":/resources/images/icons/WS-galleryLogo.png", "#00a55b"); + m_projectListWidget = createBlogContentFrame("http://fritzing.org/projects/", tr("Fritzing Projects."), ":/resources/images/icons/WS-galleryLogo.png", "#00a55b"); m_projectsUberFrame = m_projectListWidget; while (m_projectsUberFrame->parentWidget()) m_projectsUberFrame = m_projectsUberFrame->parentWidget(); frameLayout->addWidget(m_projectsUberFrame); @@ -743,7 +743,7 @@ void WelcomeView::gotBlogSnippet(QNetworkReply * networkReply) { } if (!goodBlog) { - QString message = (blog) ? tr("Unable to reach blog.fritzing.org") : tr("Unable to reach friting.org/projects") ; + QString message = (blog) ? tr("Unable to reach blog.fritzing.org") : tr("Unable to reach fritzing.org/projects") ; QString placeHolder = QString("
  • ").arg(message); if (doc.setContent(placeHolder, &errorStr, &errorLine, &errorColumn)) { readBlog(doc, true, blog, ""); From 13c9ec97944ac7b86130a9d81f9f377cd2e664f5 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Tue, 3 Dec 2019 20:30:11 +0100 Subject: [PATCH 53/61] Also load blog and projects via https --- src/dialogs/quotedialog.cpp | 2 +- src/help/aboutbox.cpp | 2 +- src/sketch/welcomeview.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dialogs/quotedialog.cpp b/src/dialogs/quotedialog.cpp index e7bf13909..7addc8cf5 100644 --- a/src/dialogs/quotedialog.cpp +++ b/src/dialogs/quotedialog.cpp @@ -206,7 +206,7 @@ QuoteDialog::QuoteDialog(bool full, QWidget *parent) : QDialog(parent) QString additional = tr("Shipping is free wordlwide.
    "); additional += tr("Documents for local customs control are included.
    "); additional += tr("Some countries might charge additional import taxes or checking fees.
    "); - additional += tr("For more information on pricing see http://fab.fritzing.org/pricing."); + additional += tr("For more information on pricing see https://fab.fritzing.org/pricing."); label = new QLabel(additional); label->setObjectName("quoteAdditional"); label->setOpenExternalLinks(true); diff --git a/src/help/aboutbox.cpp b/src/help/aboutbox.cpp index 3ba4931a8..b2c3c2476 100644 --- a/src/help/aboutbox.cpp +++ b/src/help/aboutbox.cpp @@ -77,7 +77,7 @@ AboutBox::AboutBox(QWidget *parent) // Link to website QLabel *linkToFritzing = new QLabel(this); - linkToFritzing->setText(tr("www.fritzing.org")); + linkToFritzing->setText(tr("www.fritzing.org")); linkToFritzing->setOpenExternalLinks(true); linkToFritzing->setFont(smallFont); linkToFritzing->setGeometry(45, 188, 300, 18); diff --git a/src/sketch/welcomeview.cpp b/src/sketch/welcomeview.cpp index 1bbf35b28..7a64cadbc 100644 --- a/src/sketch/welcomeview.cpp +++ b/src/sketch/welcomeview.cpp @@ -321,11 +321,11 @@ WelcomeView::WelcomeView(QWidget * parent) : QFrame(parent) // TODO: blog network calls should only happen once, not for each window? QNetworkAccessManager * manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotBlogSnippet(QNetworkReply *))); - manager->get(QNetworkRequest(QUrl("http://blog.fritzing.org/recent-posts-app/"))); + manager->get(QNetworkRequest(QUrl("https://blog.fritzing.org/recent-posts-app/"))); manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotBlogSnippet(QNetworkReply *))); - manager->get(QNetworkRequest(QUrl("http://fritzing.org/projects/snippet/"))); + manager->get(QNetworkRequest(QUrl("https://fritzing.org/projects/snippet/"))); TipsAndTricks::initTipSets(); nextTip(); @@ -587,12 +587,12 @@ QWidget * WelcomeView::initBlog() { QWidget * headerFrame = createHeaderFrame(tr("Projects"), "Projects", tr("Blog"), "Blog", m_inactiveHeaderLabelColor, m_activeHeaderLabelColor, m_projectsLabel, m_blogLabel); frameLayout->addWidget(headerFrame); - m_blogListWidget = createBlogContentFrame("http://blog.fritzing.org", tr("Fritzing News."), ":/resources/images/icons/WS-blogLogo.png", "#802742"); + m_blogListWidget = createBlogContentFrame("https://blog.fritzing.org", tr("Fritzing News."), ":/resources/images/icons/WS-blogLogo.png", "#802742"); m_blogUberFrame = m_blogListWidget; while (m_blogUberFrame->parentWidget()) m_blogUberFrame = m_blogUberFrame->parentWidget(); frameLayout->addWidget(m_blogUberFrame); - m_projectListWidget = createBlogContentFrame("http://fritzing.org/projects/", tr("Fritzing Projects."), ":/resources/images/icons/WS-galleryLogo.png", "#00a55b"); + m_projectListWidget = createBlogContentFrame("https://fritzing.org/projects/", tr("Fritzing Projects."), ":/resources/images/icons/WS-galleryLogo.png", "#00a55b"); m_projectsUberFrame = m_projectListWidget; while (m_projectsUberFrame->parentWidget()) m_projectsUberFrame = m_projectsUberFrame->parentWidget(); frameLayout->addWidget(m_projectsUberFrame); From e9a9969aac2c3934a660d3bb540c8124f021e346 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 4 Dec 2019 11:42:02 +0100 Subject: [PATCH 54/61] Fallback to http if openssl not available --- src/fapplication.cpp | 11 ++++++----- src/sketch/pcbsketchwidget.cpp | 10 ++++++++-- src/sketch/welcomeview.cpp | 12 +++++++----- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/fapplication.cpp b/src/fapplication.cpp index eaabcab21..732c8821b 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -1196,13 +1196,13 @@ int FApplication::startup() //if (!fabEnabled) { QNetworkAccessManager * manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotOrderFab(QNetworkReply *))); - manager->get(QNetworkRequest(QUrl(QString("https://fab.fritzing.org/launched%1").arg(Version::makeRequestParamsString(true))))); + manager->get(QNetworkRequest(QUrl(QString("http%2://fab.fritzing.org/launched%1") + .arg(Version::makeRequestParamsString(true)) + .arg(QSslSocket::supportsSsl() ? "s" : "")))); //} if (m_progressIndex >= 0) splash.showProgress(m_progressIndex, LoadProgressEnd); - - //DebugDialog::debug("after createUserDataStoreFolderStructure"); if (m_progressIndex >= 0) splash.showProgress(m_progressIndex, 0.65); @@ -1419,9 +1419,10 @@ void FApplication::checkForUpdates(bool atUserRequest) } } - QString atom = QString("https://fritzing.org/download/feed/atom/%1/%2") + QString atom = QString("http%3://fritzing.org/download/feed/atom/%1/%2") .arg(PLATFORM_NAME) - .arg(Version::makeRequestParamsString(true)); + .arg(Version::makeRequestParamsString(true)) + .arg(QSslSocket::supportsSsl() ? "s" : ""); DebugDialog::debug(atom); versionChecker->setUrl(atom); m_updateDialog->setAtUserRequest(atUserRequest); diff --git a/src/sketch/pcbsketchwidget.cpp b/src/sketch/pcbsketchwidget.cpp index 7bce0a606..2f5934af6 100644 --- a/src/sketch/pcbsketchwidget.cpp +++ b/src/sketch/pcbsketchwidget.cpp @@ -2754,17 +2754,23 @@ void PCBSketchWidget::requestQuote(bool byUser) { QString paramString = Version::makeRequestParamsString(false); QNetworkAccessManager * manager = new QNetworkAccessManager(this); - + QString protocol = "http"; + if (QSslSocket::supportsSsl()) { + protocol = "https"; + } else { + qDebug() << QSslSocket::supportsSsl() << QSslSocket::sslLibraryBuildVersionString() << QSslSocket::sslLibraryVersionString(); + } QString countArgs = QuoteDialog::countArgs(); manager->setProperty("count", countArgs); QString filename = QUrl::toPercentEncoding(filenameIf()); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotFabQuote(QNetworkReply *))); - QString string = QString("https://fab.fritzing.org/fritzing-fab/quote%1&area=%2&count=%3&filename=%4&byuser=%5") + QString string = QString("%6://fab.fritzing.org/fritzing-fab/quote%1&area=%2&count=%3&filename=%4&byuser=%5") .arg(paramString) .arg(area) .arg(countArgs) .arg(filename) .arg(byUser) + .arg(protocol) ; QuoteDialog::setQuoteSucceeded(false); manager->get(QNetworkRequest(QUrl(string))); diff --git a/src/sketch/welcomeview.cpp b/src/sketch/welcomeview.cpp index 7a64cadbc..f553848f6 100644 --- a/src/sketch/welcomeview.cpp +++ b/src/sketch/welcomeview.cpp @@ -318,14 +318,16 @@ WelcomeView::WelcomeView(QWidget * parent) : QFrame(parent) connect(this, SIGNAL(openSketch()), this->window(), SLOT(mainLoad())); connect(this, SIGNAL(recentSketch(const QString &, const QString &)), this->window(), SLOT(openRecentOrExampleFile(const QString &, const QString &))); + QString protocol = QSslSocket::supportsSsl() ? "https" : "http"; // TODO: blog network calls should only happen once, not for each window? QNetworkAccessManager * manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotBlogSnippet(QNetworkReply *))); - manager->get(QNetworkRequest(QUrl("https://blog.fritzing.org/recent-posts-app/"))); + manager->get(QNetworkRequest(QUrl(QString("%1://blog.fritzing.org/recent-posts-app/").arg(protocol)))); manager = new QNetworkAccessManager(this); + connect(manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(gotBlogSnippet(QNetworkReply *))); - manager->get(QNetworkRequest(QUrl("https://fritzing.org/projects/snippet/"))); + manager->get(QNetworkRequest(QUrl(QString("%1://fritzing.org/projects/snippet/").arg(protocol)))); TipsAndTricks::initTipSets(); nextTip(); @@ -527,7 +529,7 @@ QWidget * WelcomeView::createShopContentFrame(const QString & imagePath, const Q contentTextFrameLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding)); label = new QLabel(headline); - label->setTextFormat(Qt::RichText); + label->setTextFormat(Qt::RichText); label->setObjectName("shopContentTextHeadline"); //label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); contentTextFrameLayout->addWidget(label); @@ -541,7 +543,7 @@ QWidget * WelcomeView::createShopContentFrame(const QString & imagePath, const Q label->setObjectName("shopContentTextCaption"); contentTextFrameLayout->addWidget(label); //label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - connect(label, &QLabel::linkActivated, this, &WelcomeView::clickBlog); + connect(label, &QLabel::linkActivated, this, &WelcomeView::clickBlog); contentTextFrameLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding)); @@ -654,7 +656,7 @@ BlogListWidget * WelcomeView::createBlogContentFrame(const QString & url, const zeroMargin(footerFrameLayout); footerFrameLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Expanding)); - QLabel * footerLabel = new QLabel(QString("%2").arg(url).arg(urlText).arg(footerLabelColor)); + QLabel * footerLabel = new QLabel(QString("%2").arg(url).arg(urlText).arg(footerLabelColor)); footerLabel->setObjectName("blogLogoText"); footerFrameLayout->addWidget(footerLabel); connect(footerLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(clickBlog(const QString &))); From e79a0da172c576e3862ac1f7980630f01281bb8f Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 4 Dec 2019 15:12:30 +0100 Subject: [PATCH 55/61] Show TLS status in DebugDialog --- src/sketch/pcbsketchwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sketch/pcbsketchwidget.cpp b/src/sketch/pcbsketchwidget.cpp index 2f5934af6..f0975d3e6 100644 --- a/src/sketch/pcbsketchwidget.cpp +++ b/src/sketch/pcbsketchwidget.cpp @@ -2758,7 +2758,9 @@ void PCBSketchWidget::requestQuote(bool byUser) { if (QSslSocket::supportsSsl()) { protocol = "https"; } else { - qDebug() << QSslSocket::supportsSsl() << QSslSocket::sslLibraryBuildVersionString() << QSslSocket::sslLibraryVersionString(); + QString msg; + msg = QSslSocket::supportsSsl() ? "TLS on," : "TLS off," + QSslSocket::sslLibraryBuildVersionString() + QSslSocket::sslLibraryVersionString(); + DebugDialog::debug(msg); } QString countArgs = QuoteDialog::countArgs(); manager->setProperty("count", countArgs); From 6b2150c99afe0de8cdd62f900d9ba82da141b76e Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 4 Dec 2019 15:17:49 +0100 Subject: [PATCH 56/61] Upgrade Qt 5.12.3 -> 5.12.6 for Windows builds, disable Qt5 32 bit install --- tools/qt_installer_noninteractive.qs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qt_installer_noninteractive.qs b/tools/qt_installer_noninteractive.qs index 7014259a6..0b372037e 100644 --- a/tools/qt_installer_noninteractive.qs +++ b/tools/qt_installer_noninteractive.qs @@ -31,8 +31,8 @@ Controller.prototype.ComponentSelectionPageCallback = function() { var widget = gui.currentPageWidget(); widget.deselectAll(); - widget.selectComponent("qt.qt5.5123.win32_msvc2017"); - widget.selectComponent("qt.qt5.5123.win64_msvc2017_64"); + //widget.selectComponent("qt.qt5.5123.win32_msvc2017"); + widget.selectComponent("qt.qt5.5126.win64_msvc2017_64"); // Cannot get older version of Qt qit Quick Scripts // Cannot programatically select LTS releases From ecf3b857c54c007b1ac48c78328441b78dc4a47c Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 4 Dec 2019 15:17:49 +0100 Subject: [PATCH 57/61] Fix qmake path --- tools/release_fritzing.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/release_fritzing.bat b/tools/release_fritzing.bat index 1f3564760..c53034a7c 100644 --- a/tools/release_fritzing.bat +++ b/tools/release_fritzing.bat @@ -46,7 +46,7 @@ IF %2==64 ( ) ELSE IF %3==2015 ( set QTBIN=C:\Qt\5.6\msvc2015_64\bin ) ELSE IF %3==2017 ( - set QTBIN=C:\Qt\5.12.3\msvc2017_64\bin + set QTBIN=C:\Qt\5.12.6\msvc2017_64\bin ) set arch=""QMAKE_TARGET.arch=x86_64"" ) ELSE ( From 5a915ebeb2c986e0268cdd1127d9f46f20fd9473 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Wed, 4 Dec 2019 17:34:59 +0100 Subject: [PATCH 58/61] Improve TLS status debug --- src/sketch/pcbsketchwidget.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sketch/pcbsketchwidget.cpp b/src/sketch/pcbsketchwidget.cpp index f0975d3e6..51035bed8 100644 --- a/src/sketch/pcbsketchwidget.cpp +++ b/src/sketch/pcbsketchwidget.cpp @@ -2757,11 +2757,14 @@ void PCBSketchWidget::requestQuote(bool byUser) { QString protocol = "http"; if (QSslSocket::supportsSsl()) { protocol = "https"; - } else { - QString msg; - msg = QSslSocket::supportsSsl() ? "TLS on," : "TLS off," + QSslSocket::sslLibraryBuildVersionString() + QSslSocket::sslLibraryVersionString(); - DebugDialog::debug(msg); } + + QString msg; + msg = QSslSocket::supportsSsl() ? "TLS on" : "TLS off"; + msg += " Want: " + QSslSocket::sslLibraryBuildVersionString(); + msg += " Found: " + QSslSocket::sslLibraryVersionString(); + DebugDialog::debug(msg); + QString countArgs = QuoteDialog::countArgs(); manager->setProperty("count", countArgs); QString filename = QUrl::toPercentEncoding(filenameIf()); From c4aa4a5a905c6794e87d3abc5a08fff72485bd07 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Mon, 9 Dec 2019 20:11:17 +0100 Subject: [PATCH 59/61] Cleanup verbose debug message --- src/items/perfboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/items/perfboard.cpp b/src/items/perfboard.cpp index dab228fe4..96725f6ea 100644 --- a/src/items/perfboard.cpp +++ b/src/items/perfboard.cpp @@ -311,9 +311,9 @@ void Perfboard::changeBoardSize() QString newSize = QString("%1.%2").arg(m_xEdit->text()).arg(m_yEdit->text()); m_propsMap.insert("size", newSize); - foreach (QString key, m_propsMap.keys()) { - DebugDialog::debug("prop " + key + " " + m_propsMap.value(key)); - } + // foreach (QString key, m_propsMap.keys()) { + // DebugDialog::debug("prop " + key + " " + m_propsMap.value(key)); + // } InfoGraphicsView * infoGraphicsView = InfoGraphicsView::getInfoGraphicsView(this); if (infoGraphicsView != NULL) { From 091ff39ce380e2e6e4f5d5e2acb8b934a0bb1541 Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Tue, 10 Dec 2019 01:07:22 +0100 Subject: [PATCH 60/61] Remove linux install and uninstall scripts. Add INSTALL.txt instructions --- INSTALL.txt | 40 ++++ install_fritzing.sh | 317 -------------------------- tools/deploy_fritzing_mac.sh | 2 +- tools/linux_release_script/release.sh | 2 +- tools/release_fritzing.bat | 1 + uninstall_fritzing.sh | 175 -------------- 6 files changed, 43 insertions(+), 494 deletions(-) create mode 100644 INSTALL.txt delete mode 100755 install_fritzing.sh delete mode 100755 uninstall_fritzing.sh diff --git a/INSTALL.txt b/INSTALL.txt new file mode 100644 index 000000000..b298f1d32 --- /dev/null +++ b/INSTALL.txt @@ -0,0 +1,40 @@ +# Installing Fritzing + +Please make sure your system satisfies one of these requirements: +Windows 10 +Windows 7 was reported to work, too +Mac - OSX 10.14 and up, though 10.13 might work too. MacOS 10.15 is currently untested. +Linux - a fairly recent linux distro with libc >= 2.6 + +Start downloading the Fritzing package that's right for you. +Unzip your Fritzing folder somewhere convenient on your hard drive. +This may also be a good time for you to create a shortcut to the Fritzing application. +A free unzipping program can be found here, should you need it. + +## Notes on Windows + +Unzipping Fritzing might be very slower than the download itself. We recommend +using 7zip + +To start Fritzing on Windows: double-click fritzing.exe + +## Notes on Linux +To start Fritzing double-click Fritzing, or try ./Fritzing in your shell window + +Fritzing uses the Qt5 libraries. On Ubuntu, they can be installed like this: + +"sudo apt install libqt5xml5 libqt5sql5 libqt5serialport5" + + +## Notes on macOS +To start Fritzing on macOS double-click the Fritzing application + +Recent versions of macOS do not allow "unverified" software to be launched directly. In order to run Fritzing, you will need to either: + +1a. right-click the Fritzing icon and select "Open" +2a. in the warning dialog, click "Open" +or, to get rid of the warning permanently: +1b. go to the System Preferences +2b. open the Security & Privacy page +3b. unlock it by clicking the lock in the lower left corner +4b. set it to allow app downloads from anywhere \ No newline at end of file diff --git a/install_fritzing.sh b/install_fritzing.sh deleted file mode 100755 index 1b29f9adf..000000000 --- a/install_fritzing.sh +++ /dev/null @@ -1,317 +0,0 @@ -#!/bin/bash -# -# This is a rough beginning of a Linux install script for Fritzing -# -# Sets up document icons and file associations (MIME types), -# and installs Fritzing to target. -# - -# Initial variables -APPDIR="$(dirname "$0")" -PROG="$(basename "$0")" -APPVER="0.9.3b" -ID="$(id -u)" -ARGS="$*" - -# Mode toggles -MODE="" -SYSMODE="false" -USERMODE="false" - -# Functions -show_help() { - cat >&2 <&2 - exit 1 -} - -esc_path() { - if [[ ! "$*" ]]; then - sed 's/\//\\\//g' - return - fi - - echo "$*" | sed 's/\//\\\//g' -} - -# Parse arguments -for i in $ARGS; do - case $i in - '-h' | '--help') - show_help - exit 0 - ;; - '-s' | '--system') - SYSMODE="true" - ;; - '-u' | '--user') - USERMODE="true" - ;; - -*) - arg_err "$i" - exit 1 - ;; - esac -done - -if [[ "$SYSMODE" == 'true' && "$USERMODE" == 'true' ]]; then - show_help - echo "Cannot be mixed: '-u/--user' and '-s/--system'" >&2 - exit 1 -elif [[ "$ID" -eq 0 || "$SYSMODE" == "true" ]]; then - MODE="system" -elif [[ "$ID" -ne 0 || "$USERMODE" = "true" ]]; then - MODE="user" -fi - -if [[ "$MODE" == "system" && "$ID" -ne 0 ]]; then - echo "(exit 1) Cannot install in system mode. Must be root!" >&2 - exit 1 -fi - -# Mode interpreter -case $MODE in - 'user') - MIMEDIR=~/.local/share/mime - APPS=~/.local/share/applications - APP_ICON=~/.local/share/icons/hicolor/128x128/apps/fritzing.png - MIMES=~/.mime.types - FRITZ_DIR=~/.local/share/fritzing - BIN=~/.local/bin - - # Back-up ~/.mime.types - echo " Copying ~/.mime.types -> ~/.mime.types.bak" - cp "$MIMES" "${MIMES}.bak";; - - 'system') - MIMEDIR=/usr/share/mime - APPS=/usr/share/applications - MIMES=/etc/mime.types - FRITZ_DIR=/usr/share/fritzing - APP_ICON=/usr/share/icons/hicolor/128x128/apps/fritzing.png - BIN=/usr/bin - - # Back-up /etc/mime.types - echo "Copying /etc/mime.types -> /etc/mime.types.bak" - cp "$MIMES" "${MIMES}.bak" - ;; - '') - echo "Sorry, but you might have a bug!" >&2 - exit 1 - ;; - esac - - -# check if user .mime.types file exists, otherwise create it -if [[ ! -f ~/.mime.types && "$MODE" == "user" ]]; then - echo "Creating ~/.mime.types ..." - touch ~/.mime.types -fi - -# Fritzing target directory -if [[ ! -d "$FRITZ_DIR" ]]; then - rm -rf "$FRITZ_DIR" - mkdir -p "$FRITZ_DIR" -fi - -# Executable(s) folder -if [[ ! -d "$BIN" ]]; then - mkdir -p "$BIN" -fi - -# add mime types for fritzing file formats - -if grep -q 'application/x-fritzing' "$MIMES" -then - echo "Fritzing MIME types already registered!" -else - echo "Registering Fritzing MIME types..." - - # This is the "correct" syntax - { - echo -e "application/x-fritzing-fz\t\t\tfritzing" ; - echo -e "application/x-fritzing-fzz\t\t\tfritzing" ; - echo -e "application/x-fritzing-fzp\t\t\tfritzing" ; - echo -e "application/x-fritzing-fzpz\t\t\tfritzing" ; - echo -e "application/x-fritzing-fzb\t\t\tfritzing" ; - echo -e "application/x-fritzing-fzbz\t\t\tfritzing" ; - echo -e "application/x-fritzing-fzm\t\t\tfritzing" ; - } >> "$MIMES" -fi - -# Install / copy Fritzing to target -echo "Copying Fritzing data..." -cp -Rp "$APPDIR" "$FRITZ_DIR" - -# Enter installation/Fritzing directory -echo "Entering $(basename "$FRITZ_DIR")/" | tr -s "/" -cd "$FRITZ_DIR" || exit $? - -# If installing in system mode, notify user that -# it will take a long time. -if [[ "$MODE" == "system" ]]; then - echo -e "\n" - echo ":: INSTALLING IN SYSTEM MODE. IT WILL TAKE A LONG TIME!" - echo "PLEASE BE PATIENT..." - echo -e "\n" -fi - -# install Fritzing into MIME directory -echo "Installing Fritzing MIME types..." -echo "-*-*-*-*-*-*-*-" -{ - xdg-mime install --mode "$MODE" 'icons/x-fritzing-fz.xml' && \ - xdg-mime install --mode "$MODE" 'icons/x-fritzing-fzz.xml' && \ - xdg-mime install --mode "$MODE" 'icons/x-fritzing-fzp.xml' && \ - xdg-mime install --mode "$MODE" 'icons/x-fritzing-fzpz.xml' && \ - xdg-mime install --mode "$MODE" 'icons/x-fritzing-fzb.xml' && \ - xdg-mime install --mode "$MODE" 'icons/x-fritzing-fzbz.xml' && \ - xdg-mime install --mode "$MODE" 'icons/x-fritzing-fzm.xml' ; -} -case $? in - 0) - echo "-- TASK ENDED SUCCESSFULLY! --" - ;; - 1) - echo "AN ERROR OCCURRED! PLEASE FIX THE PROBLEMS ABOVE, THEN TRY AGAIN" >&2 - echo -e "-*-*-*-*-*-*-*-\n" - exit 1 - ;; - esac -echo -e "-*-*-*-*-*-*-*-\n" - -# set the default application to org.fritzing.Fritzing.desktop -echo "Setting up default application -> org.fritzing.Fritzing.desktop" -echo "-*-*-*-*-*-*-*-" -{ - xdg-mime default 'org.fritzing.Fritzing.desktop' application/x-fritzing-fz && \ - xdg-mime default 'org.fritzing.Fritzing.desktop' application/x-fritzing-fzz && \ - xdg-mime default 'org.fritzing.Fritzing.desktop' application/x-fritzing-fzp && \ - xdg-mime default 'org.fritzing.Fritzing.desktop' application/x-fritzing-fzpz && \ - xdg-mime default 'org.fritzing.Fritzing.desktop' application/x-fritzing-fzb && \ - xdg-mime default 'org.fritzing.Fritzing.desktop' application/x-fritzing-fzbz && \ - xdg-mime default 'org.fritzing.Fritzing.desktop' application/x-fritzing-fzm ; -} -case $? in - 0) - echo "-- TASK ENDED SUCCESSFULLY! --" - ;; - 1) - echo "AN ERROR OCCURRED! PLEASE FIX THE PROBLEMS ABOVE, THEN TRY AGAIN" >&2 - echo -e "-*-*-*-*-*-*-*-\n" - exit 1 - ;; - esac -echo -e "-*-*-*-*-*-*-*-\n" - -# install image-files into mime system with specified size -echo "Installing Fritzing system icons..." -echo "-*-*-*-*-*-*-*-" - -{ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 128 'icons/fz_icon128.png' application-x-fritzing-fz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 256 'icons/fz_icon256.png' application-x-fritzing-fz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 128 'icons/fzz_icon128.png' application-x-fritzing-fzz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 256 'icons/fzz_icon256.png' application-x-fritzing-fzz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 128 'icons/fzp_icon128.png' application-x-fritzing-fzp && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 256 'icons/fzp_icon256.png' application-x-fritzing-fzp && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 128 'icons/fzpz_icon128.png' application-x-fritzing-fzpz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 256 'icons/fzpz_icon256.png' application-x-fritzing-fzpz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 128 'icons/fzb_icon128.png' application-x-fritzing-fzb && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 256 'icons/fzb_icon256.png' application-x-fritzing-fzb && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 128 'icons/fzbz_icon128.png' application-x-fritzing-fzbz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 256 'icons/fzbz_icon256.png' application-x-fritzing-fzbz && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 128 'icons/fzm_icon128.png' application-x-fritzing-fzm && \ - xdg-icon-resource install --mode "$MODE" --context mimetypes --size 256 'icons/fzm_icon256.png' application-x-fritzing-fzm ; -} -case $? in - 0) - echo "-- TASK ENDED SUCCESSFULLY! --" - ;; - 1) - echo "AN ERROR OCCURRED! PLEASE FIX THE PROBLEMS ABOVE, THEN TRY AGAIN" >&2 - echo -e "-*-*-*-*-*-*-*-\n" - exit 1 - ;; - esac -echo -e "-*-*-*-*-*-*-*-\n" - -echo "Making symlinks..." - - -if ! ln -s "$(realpath ./Fritzing)" "$BIN"/Fritzing 2>/dev/null -then - echo "Symlinks already exists! (or linking failed...)" >&2 -fi - -echo "Doing final touch..." - -# Escape all forward slashes to make `sed` stable -APP_ICON_ESC="$(esc_path "$APP_ICON")" - -# Modify Fritzing desktop executable [keep original] -sed -i.use "s/icons\/fritzing_icon.png/${APP_ICON_ESC}/" org.fritzing.Fritzing.desktop - -# Install Fritzing desktop application -cp org.fritzing.Fritzing.desktop.use "$APPS"/org.fritzing.Fritzing.desktop -cp icons/fritzing_icon.png "$APP_ICON" -rm -f org.fritzing.Fritzing.desktop.use - -# Escape all paths [forward slashes] to make `sed` stable -MIMES_ESC="$(esc_path "$MIMES")" -MIMEDIR_ESC="$(esc_path "$MIMEDIR")" -FRITZ_DIR_ESC="$(esc_path "$FRITZ_DIR")" -APPS_ESC="$(esc_path "$APPS")" -BIN_ESC="$(esc_path "$BIN")" - -DEVSTAT="$(grep 'DEVSTAT' uninstall_fritzing.sh | cut -d '=' -f 2 | tr -d '"')" - -# Substitute all variables -cp uninstall_fritzing.sh uninstall_fritzing.use - -# NOTE: Do not put a '$' before the placeholder brackets! -# How I did it: sed -i "s/{placeholder}/$VARIABLE/(g if necessary)" -# -sed -i "s/{mode}/$MODE/" uninstall_fritzing.use -sed -i "s/{fritz-dir}/${FRITZ_DIR_ESC}/" uninstall_fritzing.use -sed -i "s/{mimedir}/${MIMEDIR_ESC}/" uninstall_fritzing.use -sed -i "s/{mimes}/${MIMES_ESC}/" uninstall_fritzing.use -sed -i "s/{app-dir}/${APPS_ESC}/" uninstall_fritzing.use -sed -i "s/{bin}/${BIN_ESC}/" uninstall_fritzing.use - -# Activate/validate uninstall script -if [[ "$DEVSTAT" == '' ]]; then - echo "(warn) Uninstall script still in development!" >&2 - - # No-op (do not activate!) -else - echo "Activating uninstall script..." - sed -i "s/{stat}/true/" uninstall_fritzing.use - echo "Activated!" - echo -fi - -cp uninstall_fritzing.use "$BIN"/uninstall_fritzing.sh - -# update databases -echo "Updating databases..." -update-desktop-database "$APPS" -update-mime-database "$MIMEDIR" - -echo "Done!" diff --git a/tools/deploy_fritzing_mac.sh b/tools/deploy_fritzing_mac.sh index ead7e8e4c..8323077e8 100755 --- a/tools/deploy_fritzing_mac.sh +++ b/tools/deploy_fritzing_mac.sh @@ -30,7 +30,7 @@ echo "$supportdir" echo ">> copy support files" cd "$workingdir" -cp -rf sketches help translations README.md LICENSE.CC-BY-SA LICENSE.GPL2 LICENSE.GPL3 "$supportdir/" +cp -rf sketches help translations INSTALL.txt README.md LICENSE.CC-BY-SA LICENSE.GPL2 LICENSE.GPL3 "$supportdir/" echo ">> clean translations" cd "$supportdir" diff --git a/tools/linux_release_script/release.sh b/tools/linux_release_script/release.sh index a383c8d93..071cfed97 100755 --- a/tools/linux_release_script/release.sh +++ b/tools/linux_release_script/release.sh @@ -83,7 +83,7 @@ echo "making release folder: ${release_folder}" mkdir -p "${release_folder}" echo "copying release files" -cp -rf sketches/ help/ translations/ Fritzing.sh Fritzing.1 org.fritzing.Fritzing.desktop fritzing.rc org.fritzing.Fritzing.appdata.xml install_fritzing.sh README.md LICENSE.CC-BY-SA LICENSE.GPL2 LICENSE.GPL3 "$release_folder/" +cp -rf sketches/ help/ translations/ Fritzing.sh Fritzing.1 org.fritzing.Fritzing.desktop fritzing.rc org.fritzing.Fritzing.appdata.xml INSTALL.txt README.md LICENSE.CC-BY-SA LICENSE.GPL2 LICENSE.GPL3 "$release_folder/" mkdir -p "${release_folder}/icons" cp resources/system_icons/linux/* "$release_folder/icons/" mv Fritzing "${release_folder}/" diff --git a/tools/release_fritzing.bat b/tools/release_fritzing.bat index c53034a7c..387048285 100644 --- a/tools/release_fritzing.bat +++ b/tools/release_fritzing.bat @@ -150,6 +150,7 @@ xcopy /q .\sketches %DESTDIR%\deploy\sketches /E /I xcopy /q .\help %DESTDIR%\deploy\help /E /I copy .\README.md %DESTDIR%\deploy\README.md +copy .\INSTALL.txt %DESTDIR%\deploy\INSTALL.txt copy .\LICENSE.GPL2 %DESTDIR%\deploy\LICENSE.GPL2 copy .\LICENSE.GPL3 %DESTDIR%\deploy\LICENSE.GPL3 copy .\LICENSE.CC-BY-SA %DESTDIR%\deploy\LICENSE.CC-BY-SA diff --git a/uninstall_fritzing.sh b/uninstall_fritzing.sh deleted file mode 100755 index 384777041..000000000 --- a/uninstall_fritzing.sh +++ /dev/null @@ -1,175 +0,0 @@ -#!/bin/bash - -# Uninstall script for Fritzing. -# Self-destructing. -# Added in by: @johnDaH4x0r - -# Variables -PROGPATH="$(realpath "$0")" -PROG="$(basename "$0")" -ID="$(id -u)" -ARGS="$*" - -# TODO: remove marker when finished -DEVSTAT="" -export DEVSTAT - -# Variables [template] -MODE='{mode}' -FRITZ_DIR='{fritz-dir}' -MIMEDIR='{mimedir}' -MIMES='{mimes}' -APPS='{app-dir}' -BIN='{bin}' - -ACTIVATE="{stat}" - -# Functions - -# Show help screen -# -help_scr() { - cat >&2 <&2 - exit 1 -} - -# Parse arguments -for ARG in $ARGS; do - case $ARG in - '-h' | '--help') - help_scr - ;; - '-m' | '--show-mode') - echo "Installation mode: $MODE" >&2 - exit - ;; - -*) - arg_err "$ARG" - exit 1 - ;; - esac -done - -if [[ "$ACTIVATE" != "true" ]]; then - echo "(exit 1) Uninstall script not yet activated!" >&2 - exit 1 -fi - -if [[ "$MODE" == "system" && "$ID" -ne 0 ]]; then - echo "(exit 1) Fritzing was installed in system mode. Must be root!" >&2 - exit 1 -fi - -# ---- UNINSTALL START ---- # - -if grep -q 'application/x-fritzing' "$MIMES" -then - TOWRITE="$(grep -v 'application/x-fritzing' "$MIMES")" - echo "$TOWRITE" > "$MIMES" -else - echo "Fritzing MIME types are not registered. (or are deregistered)" -fi - -echo "Entering $(basename "$FRITZ_DIR")/" | tr -s "/" -cd "$FRITZ_DIR" || exit $? - -# Uninstall Fritzing MIME packages -echo "Uninstalling Fritzing MIME types..." -{ - xdg-mime uninstall --mode "$MODE" 'icons/x-fritzing-fz.xml' && \ - xdg-mime uninstall --mode "$MODE" 'icons/x-fritzing-fzz.xml' && \ - xdg-mime uninstall --mode "$MODE" 'icons/x-fritzing-fzp.xml' && \ - xdg-mime uninstall --mode "$MODE" 'icons/x-fritzing-fzpz.xml' && \ - xdg-mime uninstall --mode "$MODE" 'icons/x-fritzing-fzb.xml' && \ - xdg-mime uninstall --mode "$MODE" 'icons/x-fritzing-fzbz.xml' && \ - xdg-mime uninstall --mode "$MODE" 'icons/x-fritzing-fzm.xml' ; -} -case $? in - 0) - echo "-- TASK ENDED SUCCESSFULLY! --" - ;; - 1) - echo "AN ERROR OCCURRED! PLEASE FIX THE PROBLEMS ABOVE, THEN TRY AGAIN" >&2 - echo -e "-*-*-*-*-*-*-*-\n" - exit 1 - ;; - esac -echo -e "-*-*-*-*-*-*-*-\n" - -# Uninstall image-files into mime system with specified size -echo "Uninstalling Fritzing system icons..." -echo "-*-*-*-*-*-*-*-" - -{ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 128 'icons/fz_icon128.png' application-x-fritzing-fz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 256 'icons/fz_icon256.png' application-x-fritzing-fz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 128 'icons/fzz_icon128.png' application-x-fritzing-fzz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 256 'icons/fzz_icon256.png' application-x-fritzing-fzz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 128 'icons/fzp_icon128.png' application-x-fritzing-fzp && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 256 'icons/fzp_icon256.png' application-x-fritzing-fzp && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 128 'icons/fzpz_icon128.png' application-x-fritzing-fzpz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 256 'icons/fzpz_icon256.png' application-x-fritzing-fzpz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 128 'icons/fzb_icon128.png' application-x-fritzing-fzb && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 256 'icons/fzb_icon256.png' application-x-fritzing-fzb && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 128 'icons/fzbz_icon128.png' application-x-fritzing-fzbz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 256 'icons/fzbz_icon256.png' application-x-fritzing-fzbz && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 128 'icons/fzm_icon128.png' application-x-fritzing-fzm && \ - xdg-icon-resource uninstall --mode "$MODE" --context mimetypes --size 256 'icons/fzm_icon256.png' application-x-fritzing-fzm ; -} -case $? in - 0) - echo "-- TASK ENDED SUCCESSFULLY! --" - ;; - 1) - echo "AN ERROR OCCURRED! PLEASE FIX THE PROBLEMS ABOVE, THEN TRY AGAIN" >&2 - echo -e "-*-*-*-*-*-*-*-\n" - exit 1 - ;; - esac -echo -e "-*-*-*-*-*-*-*-\n" - -# Remove 'Fritzing' symlink -echo "Removing symlinks..." -rm -f "$BIN"/Fritzing 2>/dev/null - -echo "Leaving $(basename "$FRITZ_DIR")/" | tr -s "/" -cd - || exit $? - -echo "Deleting $(basename "$FRITZ_DIR")/" | tr -s "/" -rm -rf "$FRITZ_DIR" - -echo "Removing desktop file..." -rm -f "$APPS"/org.fritzing.Fritzing.desktop - -echo "Updating databases..." -update-desktop-database "$APPS" -update-mime-database "$MIMEDIR" - -echo "-*-*-*-*-*-*-" -echo "UNINSTALLED!" -echo "-*-*-*-*-*-*-" -echo - -# -- SCRIPT END-OF-LIFE -- # -echo "Removing residues..." -rm -f "$PROGPATH" From b9d85521054b0e1f01d78f912953028a06500c8f Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Tue, 10 Dec 2019 07:19:35 +0100 Subject: [PATCH 61/61] Fix: remove chmod to install script --- tools/linux_release_script/release.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/linux_release_script/release.sh b/tools/linux_release_script/release.sh index 071cfed97..9390a3a4e 100755 --- a/tools/linux_release_script/release.sh +++ b/tools/linux_release_script/release.sh @@ -87,7 +87,6 @@ cp -rf sketches/ help/ translations/ Fritzing.sh Fritzing.1 org.fritzing.Fritzin mkdir -p "${release_folder}/icons" cp resources/system_icons/linux/* "$release_folder/icons/" mv Fritzing "${release_folder}/" -chmod +x "${release_folder}/install_fritzing.sh" cd "${release_folder}"