From f4da422087f77ce9a549ff73250910e5ae217ff0 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 19 Feb 2026 22:59:08 +0100 Subject: Refactor BobinkClient and clean up comments - Format BobinkAuth.cpp to match GNU style used elsewhere - Replace brittle error name array with QMetaEnum in BobinkClient - Move QOpcUaPkiConfiguration include from header to .cpp - Replace m_discoveryInterval member with file-scope constant - Add doc comments to SecurityMode and SecurityPolicy enums - Comment endpoint selection strategy in handleEndpointsReceived - Add missing QML ids to connectionPage and serverListView --- src/BobinkAuth.cpp | 110 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 43 deletions(-) (limited to 'src/BobinkAuth.cpp') diff --git a/src/BobinkAuth.cpp b/src/BobinkAuth.cpp index 03ae2cf..132e4be 100644 --- a/src/BobinkAuth.cpp +++ b/src/BobinkAuth.cpp @@ -4,74 +4,98 @@ */ #include "BobinkAuth.h" -BobinkAuth::BobinkAuth(QObject *parent) - : QObject(parent) +BobinkAuth::BobinkAuth (QObject *parent) : QObject (parent) {} + +BobinkAuth::AuthMode +BobinkAuth::mode () const { + return m_mode; } -BobinkAuth::AuthMode BobinkAuth::mode() const { return m_mode; } - -void BobinkAuth::setMode(AuthMode mode) +void +BobinkAuth::setMode (AuthMode mode) { - if (m_mode == mode) - return; - m_mode = mode; - emit modeChanged(); + if (m_mode == mode) + return; + m_mode = mode; + emit modeChanged (); } -QString BobinkAuth::username() const { return m_username; } +QString +BobinkAuth::username () const +{ + return m_username; +} -void BobinkAuth::setUsername(const QString &username) +void +BobinkAuth::setUsername (const QString &username) { - if (m_username == username) - return; - m_username = username; - emit usernameChanged(); + if (m_username == username) + return; + m_username = username; + emit usernameChanged (); } -QString BobinkAuth::password() const { return m_password; } +QString +BobinkAuth::password () const +{ + return m_password; +} -void BobinkAuth::setPassword(const QString &password) +void +BobinkAuth::setPassword (const QString &password) { - if (m_password == password) - return; - m_password = password; - emit passwordChanged(); + if (m_password == password) + return; + m_password = password; + emit passwordChanged (); } -QString BobinkAuth::certPath() const { return m_certPath; } +QString +BobinkAuth::certPath () const +{ + return m_certPath; +} -void BobinkAuth::setCertPath(const QString &path) +void +BobinkAuth::setCertPath (const QString &path) { - if (m_certPath == path) - return; - m_certPath = path; - emit certPathChanged(); + if (m_certPath == path) + return; + m_certPath = path; + emit certPathChanged (); } -QString BobinkAuth::keyPath() const { return m_keyPath; } +QString +BobinkAuth::keyPath () const +{ + return m_keyPath; +} -void BobinkAuth::setKeyPath(const QString &path) +void +BobinkAuth::setKeyPath (const QString &path) { - if (m_keyPath == path) - return; - m_keyPath = path; - emit keyPathChanged(); + if (m_keyPath == path) + return; + m_keyPath = path; + emit keyPathChanged (); } -QOpcUaAuthenticationInformation BobinkAuth::toAuthenticationInformation() const +QOpcUaAuthenticationInformation +BobinkAuth::toAuthenticationInformation () const { - QOpcUaAuthenticationInformation info; - switch (m_mode) { + QOpcUaAuthenticationInformation info; + switch (m_mode) + { case Anonymous: - info.setAnonymousAuthentication(); - break; + info.setAnonymousAuthentication (); + break; case UserPass: - info.setUsernameAuthentication(m_username, m_password); - break; + info.setUsernameAuthentication (m_username, m_password); + break; case Certificate: - info.setCertificateAuthentication(m_certPath, m_keyPath); - break; + info.setCertificateAuthentication (m_certPath, m_keyPath); + break; } - return info; + return info; } -- cgit v1.2.3