summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-02-19 23:12:16 +0100
committerThomas Vanbesien <tvanbesi@proton.me>2026-02-19 23:12:16 +0100
commit11b99fda8727f2225961c0b83ecdb18674a9670a (patch)
treed835d8b677a294c59895537dbcd002cfd6678cfb /src
parent09a5b9c25011b6976813130239994661ab1b0d66 (diff)
downloadBobinkQtOpcUa-master.tar.gz
BobinkQtOpcUa-master.zip
Extract errorChanged lambda into named handleClientError slotHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/BobinkClient.cpp23
-rw-r--r--src/BobinkClient.h1
2 files changed, 14 insertions, 10 deletions
diff --git a/src/BobinkClient.cpp b/src/BobinkClient.cpp
index 7355a0c..41b7dbf 100644
--- a/src/BobinkClient.cpp
+++ b/src/BobinkClient.cpp
@@ -89,16 +89,7 @@ BobinkClient::setupClient ()
connect (m_client, &QOpcUaClient::findServersFinished, this,
&BobinkClient::handleFindServersFinished);
connect (m_client, &QOpcUaClient::errorChanged, this,
- [this] (QOpcUaClient::ClientError error)
- {
- if (error == QOpcUaClient::NoError)
- return;
- auto me = QMetaEnum::fromType<QOpcUaClient::ClientError> ();
- const char *key = me.valueToKey (static_cast<int> (error));
- emit connectionError (
- QStringLiteral ("Client error: %1")
- .arg (key ? QLatin1StringView (key) : "Unknown"_L1));
- });
+ &BobinkClient::handleClientError);
}
/* ======================================
@@ -332,6 +323,18 @@ BobinkClient::handleConnectError (QOpcUaErrorState *errorState)
}
}
+void
+BobinkClient::handleClientError (QOpcUaClient::ClientError error)
+{
+ if (error == QOpcUaClient::NoError)
+ return;
+ auto me = QMetaEnum::fromType<QOpcUaClient::ClientError> ();
+ const char *key = me.valueToKey (static_cast<int> (error));
+ emit connectionError (
+ QStringLiteral ("Client error: %1")
+ .arg (key ? QLatin1StringView (key) : "Unknown"_L1));
+}
+
/* ======================================
* Discovery
* ====================================== */
diff --git a/src/BobinkClient.h b/src/BobinkClient.h
index c566a67..7eb6c3c 100644
--- a/src/BobinkClient.h
+++ b/src/BobinkClient.h
@@ -155,6 +155,7 @@ private slots:
QOpcUa::UaStatusCode statusCode,
const QUrl &requestUrl);
void handleConnectError (QOpcUaErrorState *errorState);
+ void handleClientError (QOpcUaClient::ClientError error);
/* -- Discovery -- */
void handleFindServersFinished (