From 1c8700897016e740241cb26a930b37e2b0773f9a Mon Sep 17 00:00:00 2001 From: Ahmed Sheimy Date: Fri, 5 Aug 2022 18:32:45 +0400 Subject: [PATCH 1/2] Update canconfactory.cpp restore network connection was not working because it was detected as serial by this modification it is working --- connections/canconfactory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connections/canconfactory.cpp b/connections/canconfactory.cpp index 1fc461c..0adb9b8 100644 --- a/connections/canconfactory.cpp +++ b/connections/canconfactory.cpp @@ -13,6 +13,9 @@ CANConnection* CanConFactory::create(type pType, QString pPortName, QString pDri case SERIALBUS: return new SerialBusConnection(pPortName, pDriverName); case GVRET_SERIAL: + if(pPortName.contains(".")) + return new GVRetSerial(pPortName, true); + else return new GVRetSerial(pPortName, false); case REMOTE: return new GVRetSerial(pPortName, true); //it's a special case of GVRET connected over TCP/IP so it uses the same class From 13c920f97110128ece5642c41f31d2208a71d5f4 Mon Sep 17 00:00:00 2001 From: Andy Huska Date: Tue, 20 Sep 2022 07:46:30 -0500 Subject: [PATCH 2/2] Fixed regression where non-commented node would not delete Fixed odd crash due to dbcNode being null on refresh --- dbc/dbchandler.cpp | 6 +++++- dbc/dbcnodeeditor.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dbc/dbchandler.cpp b/dbc/dbchandler.cpp index 6e29ad7..d60dd1b 100644 --- a/dbc/dbchandler.cpp +++ b/dbc/dbchandler.cpp @@ -351,7 +351,11 @@ DBC_NODE* DBCFile::findNodeByNameAndComment(QString fullname) if (dbc_nodes.length() == 0) return nullptr; for (int i = 0; i < dbc_nodes.length(); i++) { - nameAndComment = dbc_nodes[i].name + " - " + dbc_nodes[i].comment; + if(dbc_nodes[i].comment.isEmpty()) + nameAndComment = dbc_nodes[i].name; + else + nameAndComment = dbc_nodes[i].name + " - " + dbc_nodes[i].comment; + if (fullname.compare(nameAndComment, Qt::CaseInsensitive) == 0) { return &dbc_nodes[i]; diff --git a/dbc/dbcnodeeditor.cpp b/dbc/dbcnodeeditor.cpp index e8363a3..f553fb4 100644 --- a/dbc/dbcnodeeditor.cpp +++ b/dbc/dbcnodeeditor.cpp @@ -111,8 +111,11 @@ void DBCNodeEditor::showEvent(QShowEvent* event) void DBCNodeEditor::refreshView() { - ui->lineComment->setText(dbcNode->comment); - ui->lineMsgName->setText(dbcNode->name); + if(dbcNode) + { + ui->lineComment->setText(dbcNode->comment); + ui->lineMsgName->setText(dbcNode->name); + } //generateSampleText(); }