aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-04 14:47:45 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-04 16:38:07 -0800
commitc99fbde0eb0b1b9b725ba2fead13d3210ce961a7 (patch)
tree35a86b414b97eab928a84da677628dd8cb1832dc /gui
parent40d026e6fc5ab94c732682c62a6803bd3140953e (diff)
downloadnextpnr-c99fbde0eb0b1b9b725ba2fead13d3210ce961a7.tar.gz
nextpnr-c99fbde0eb0b1b9b725ba2fead13d3210ce961a7.tar.bz2
nextpnr-c99fbde0eb0b1b9b725ba2fead13d3210ce961a7.zip
Mark IdString and IdStringList single argument constructors explicit.
Single argument constructors will silently convert to that type. This is typically not the right thing to do. For example, the nexus and ice40 arch_pybindings.h files were incorrectly parsing bel name strings, etc. Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'gui')
-rw-r--r--gui/designwidget.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/gui/designwidget.cc b/gui/designwidget.cc
index a5dc7e3e..5c3584d9 100644
--- a/gui/designwidget.cc
+++ b/gui/designwidget.cc
@@ -911,7 +911,7 @@ void DesignWidget::prepareMenuProperty(const QPoint &pos)
ElementType type = getElementTypeByName(selectedProperty->propertyId());
if (type == ElementType::NONE)
continue;
- IdString value = ctx->id(selectedProperty->valueText().toStdString());
+ IdStringList value = IdStringList::parse(ctx, selectedProperty->valueText().toStdString());
auto node = getTreeByElementType(type)->nodeForId(value);
if (!node)
continue;
@@ -996,7 +996,9 @@ void DesignWidget::onItemDoubleClicked(QTreeWidgetItem *item, int column)
ElementType type = getElementTypeByName(selectedProperty->propertyId());
if (type == ElementType::NONE)
return;
- auto it = getTreeByElementType(type)->nodeForId(ctx->id(selectedProperty->valueText().toStdString()));
+
+ IdStringList value = IdStringList::parse(ctx, selectedProperty->valueText().toStdString());
+ auto it = getTreeByElementType(type)->nodeForId(value);
if (it) {
int num = getIndexByElementType(type);
clearAllSelectionModels();
@@ -1049,8 +1051,8 @@ void DesignWidget::onHoverPropertyChanged(QtBrowserItem *item)
QtProperty *selectedProperty = item->property();
ElementType type = getElementTypeByName(selectedProperty->propertyId());
if (type != ElementType::NONE) {
- IdString value = ctx->id(selectedProperty->valueText().toStdString());
- if (value != IdString()) {
+ IdStringList value = IdStringList::parse(ctx, selectedProperty->valueText().toStdString());
+ if (value != IdStringList()) {
auto node = getTreeByElementType(type)->nodeForId(value);
if (node) {
std::vector<DecalXY> decals = getDecals((*node)->type(), (*node)->id());