Fixed nonfunctional node delete. Was due to trying to find node by name but

passing in the name and comment concatenated together.  Made a new function to
find by name+comment since extracting only name from the text in the column would
require too much guessing.
This commit is contained in:
Andy Huska
2022-09-15 18:59:24 -05:00
parent b6b73d0e11
commit 7e4ebf2c74
3 changed files with 20 additions and 3 deletions
+3 -2
View File
@@ -631,7 +631,7 @@ void DBCMainEditor::deleteCurrentTreeItem()
{
QTreeWidgetItem *currItem = ui->treeDBC->currentItem();
int typ = currItem->data(0, Qt::UserRole).toInt();
QString idString;
QString idString, columnText;
int msgID;
DBC_MESSAGE *msg;
DBC_NODE *node;
@@ -642,7 +642,8 @@ void DBCMainEditor::deleteCurrentTreeItem()
switch (typ)
{
case 1: //deleting a node cascades deletion down to messages and signals
node = dbcFile->findNodeByName(currItem->text(0));
columnText = currItem->text(0);
node = dbcFile->findNodeByNameAndComment(columnText);
if (!node) return;
for (int x = 0; x < dbcFile->messageHandler->getCount(); x++)
{