From 2591efaeaf714133aef070417cb316a233dcba76 Mon Sep 17 00:00:00 2001 From: lasyman Date: Fri, 22 Apr 2022 13:47:34 +0800 Subject: [PATCH 1/2] fix: QTcpsocket interface on old version --- src/debuggers/tcp/client/SAKTcpClientDevice.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debuggers/tcp/client/SAKTcpClientDevice.cc b/src/debuggers/tcp/client/SAKTcpClientDevice.cc index 834bae51..fe65285d 100644 --- a/src/debuggers/tcp/client/SAKTcpClientDevice.cc +++ b/src/debuggers/tcp/client/SAKTcpClientDevice.cc @@ -93,10 +93,10 @@ bool SAKTcpClientDevice::initialize() emit errorOccurred(QString("Connection has been closed!")); }); connect(mTcpSocket, -#if QT_VERSION > QT_VERSION_CHECK(5, 14, 0) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QOverload::of(&QTcpSocket::error), -#else +#if QT_VERSION > QT_VERSION_CHECK(5, 14, 0) &QTcpSocket::errorOccurred, +#else + QOverload::of(&QTcpSocket::error), #endif this, [=](QAbstractSocket::SocketError err){ if (err != QAbstractSocket::RemoteHostClosedError) { -- Gitee From 6f10cf472099222e89a5080afe932f9177c2afc2 Mon Sep 17 00:00:00 2001 From: lasyman Date: Fri, 22 Apr 2022 13:52:35 +0800 Subject: [PATCH 2/2] fix: auto response plugin enable problem --- src/base/SAKBaseListWidgetItemWidget.cc | 1 + .../autoresponse/SAKDebuggerPluginAutoResponse.cc | 10 ++++++++++ .../autoresponse/SAKDebuggerPluginAutoResponseItem.cc | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/src/base/SAKBaseListWidgetItemWidget.cc b/src/base/SAKBaseListWidgetItemWidget.cc index 5e0b4d23..47bdd5ea 100644 --- a/src/base/SAKBaseListWidgetItemWidget.cc +++ b/src/base/SAKBaseListWidgetItemWidget.cc @@ -20,6 +20,7 @@ SAKBaseListWidgetItemWidget::SAKBaseListWidgetItemWidget(QWidget *parent) SAKBaseListWidgetItemWidget::SAKBaseListWidgetItemWidget(quint64 id, QWidget *parent) :QWidget(parent) ,mId(id) + ,mEnable(false) { } diff --git a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc index 00e53ea5..973f2dec 100644 --- a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc +++ b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponse.cc @@ -195,6 +195,16 @@ void SAKDebuggerPluginAutoResponse::connectSignalsToSlots(QWidget *itemWidget) QVariant::fromValue(description)); }); + connect(cookedItemWidget, + &SAKDebuggerPluginAutoResponseItem::enableChanged, + this, + [&](quint64 id, bool enable){ + updateRecord(id, + mTableCtx.columns.enable, + QVariant::fromValue(enable)); + + }); + connect(cookedItemWidget, &SAKDebuggerPluginAutoResponseItem::referenceTextChanged, this, diff --git a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc index ff991007..44a93785 100644 --- a/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc +++ b/src/debuggers/debugger/plugins/autoresponse/SAKDebuggerPluginAutoResponseItem.cc @@ -155,6 +155,13 @@ void SAKDebuggerPluginAutoResponseItem::setupItem() emit descriptionChanged(id(), description); }); + connect(mUi->enableCheckBox, &QCheckBox::clicked, + this, [&](){ + bool enable = mUi->enableCheckBox->isChecked(); + setEnable(enable); + emit enableChanged(id(), enable); + }); + connect(mUi->referenceDataLineEdit, &QLineEdit::textChanged, this, [&](const QString description){ emit referenceTextChanged(id(), description); @@ -203,6 +210,8 @@ void SAKDebuggerPluginAutoResponseItem::setupItem() this, [&](int interval){ emit delayTimeChanged(id(), interval); }); + + setEnable(mUi->enableCheckBox->isChecked()); } bool SAKDebuggerPluginAutoResponseItem::needToResponse(QByteArray receiveData, -- Gitee