chore: rename the signal

This commit is contained in:
Qsaker 2024-01-10 14:32:50 +08:00
parent 759fd6ebd3
commit 2247cc9784
10 changed files with 14 additions and 14 deletions

View File

@ -310,7 +310,7 @@ void SAKBleCentralTool::onBleCentralDisconnected()
{
QString msg = "disconnect from device";
qWarning() << msg;
emit errorOccured(msg);
emit errorOccurred(msg);
}
void SAKBleCentralTool::onServiceObjectStateChanged(QLowEnergyService *service,

View File

@ -42,7 +42,7 @@ SAKToolBox::SAKToolBox(QObject* parent)
int flag = Qt::AutoConnection | Qt::UniqueConnection;
for (auto tool : m_tools) {
connect(tool,
&SAKBaseTool::errorOccured,
&SAKBaseTool::errorOccurred,
this,
&SAKToolBox::errorOccurred,
Qt::ConnectionType(flag));
@ -111,8 +111,8 @@ void SAKToolBox::initialize(int type)
// rx->websocket transmition; websocket transmition->Tx analyzer
connect(m_comunicationTool, &SAKBaseTool::outputBytes, m_webSocketTransmitterTool, &SAKBaseTool::inputBytes);
connect(m_webSocketTransmitterTool, &SAKBaseTool::outputBytes, m_comunicationTool, &SAKBaseTool::inputBytes);
connect(m_comunicationTool, &SAKCommunicationTool::errorOccured, this, &SAKToolBox::errorOccurred);
connect(m_comunicationTool, &SAKCommunicationTool::errorOccurred, this, &SAKToolBox::errorOccurred);
// clang-format on
emit communicatonChanged();

View File

@ -22,7 +22,7 @@ SAKBaseTool::SAKBaseTool(QObject *parent)
this->m_isWorking = false;
emit this->isWorkingChanged();
});
connect(this, &SAKBaseTool::errorOccured, this, [=](const QString &errorString) {
connect(this, &SAKBaseTool::errorOccurred, this, [=](const QString &errorString) {
qWarning() << "Error occured: " << qPrintable(errorString);
exit();
wait();

View File

@ -29,7 +29,7 @@ public:
signals:
void outputBytes(const QByteArray &bytes);
void errorOccured(const QString &errorString);
void errorOccurred(const QString &errorString);
public:
bool isWorking() { return m_isWorking; }

View File

@ -31,7 +31,7 @@ void SAKCommunicationTool::run()
QString errStr;
if (!initialize(errStr)) {
qWarning() << errStr;
emit errorOccured(errStr);
emit errorOccurred(errStr);
return;
}

View File

@ -42,7 +42,7 @@ bool SAKTcpClientTool::initialize(QString& errStr)
connect(mTcpSocket, SAK_SIG_SOCKETERROROCCURRED, mTcpSocket, [=]() {
QString info = "Error occurred: " + mTcpSocket->errorString();
qInfo() << info;
emit errorOccured(mTcpSocket->errorString());
emit errorOccurred(mTcpSocket->errorString());
});
connect(mTcpSocket, &QTcpSocket::disconnected, mTcpSocket, [=]() { exit(); });

View File

@ -42,7 +42,7 @@ bool SAKUdpClientTool::initialize(QString &errStr)
connect(mUdpSocket, &QUdpSocket::readyRead, mUdpSocket, [=]() { readBytes(); });
connect(mUdpSocket, SAK_SIG_SOCKETERROROCCURRED, this, [=]() {
emit errorOccured(mUdpSocket->errorString());
emit errorOccurred(mUdpSocket->errorString());
});
return true;

View File

@ -39,7 +39,7 @@ bool SAKUdpServerTool::initialize(QString &errStr)
connect(mUdpSocket, &QUdpSocket::readyRead, mUdpSocket, [=]() { readBytes(); });
connect(mUdpSocket, SAK_SIG_SOCKETERROROCCURRED, this, [=]() {
emit errorOccured(mUdpSocket->errorString());
emit errorOccurred(mUdpSocket->errorString());
});
return true;
@ -96,7 +96,7 @@ void SAKUdpServerTool::readBytes()
mClients.append(info);
emit clientsChanged();
}
emit outputBytes(bytes);
emit bytesRead(bytes, info);
}

View File

@ -58,7 +58,7 @@ bool SAKWebSocketClientTool::initialize(QString &errStr)
connect(m_webSocket, SAK_SIG_WEBSOCKETERROROCCURRED, m_webSocket, [=]() {
QString errStr = m_webSocket->errorString();
//outputMessage(QtInfoMsg, errStr);
emit errorOccured(errStr);
emit errorOccurred(errStr);
});
QString address = "ws://" + mServerIp + ":" + QString::number(mServerPort);

View File

@ -36,11 +36,11 @@ bool SAKWebSocketServerTool::initialize(QString &errStr)
mWebSocketServer,
[=](QWebSocketProtocol::CloseCode closeCode) {
Q_UNUSED(closeCode)
emit errorOccured(mWebSocketServer->errorString());
emit errorOccurred(mWebSocketServer->errorString());
});
connect(mWebSocketServer, &QWebSocketServer::acceptError, mWebSocketServer, [=]() {
emit errorOccured(mWebSocketServer->errorString());
emit errorOccurred(mWebSocketServer->errorString());
});
connect(mWebSocketServer, &QWebSocketServer::newConnection, mWebSocketServer, [=]() {