From 18d90163ab3c5348d0753be340ed789b0b829c66 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 30 Dec 2023 20:38:58 +0100 Subject: [PATCH] Change code for certificate handling to use the current coding style --- syncthingconnector/syncthingconnection.cpp | 4 ++-- syncthingconnector/syncthingconnectionsettings.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syncthingconnector/syncthingconnection.cpp b/syncthingconnector/syncthingconnection.cpp index 01c126d..59e3638 100644 --- a/syncthingconnector/syncthingconnection.cpp +++ b/syncthingconnector/syncthingconnection.cpp @@ -795,13 +795,13 @@ bool SyncthingConnection::loadSelfSignedCertificate(const QUrl &url) } // find cert - const QString certPath = !m_configDir.isEmpty() ? (m_configDir + QStringLiteral("/https-cert.pem")) : SyncthingConfig::locateHttpsCertificate(); + const auto certPath = !m_configDir.isEmpty() ? (m_configDir + QStringLiteral("/https-cert.pem")) : SyncthingConfig::locateHttpsCertificate(); if (certPath.isEmpty()) { emit error(tr("Unable to locate certificate used by Syncthing."), SyncthingErrorCategory::OverallConnection, QNetworkReply::NoError); return false; } // add exception - const QList certs = QSslCertificate::fromPath(certPath); + const auto certs = QSslCertificate::fromPath(certPath); if (certs.isEmpty() || certs.at(0).isNull()) { emit error(tr("Unable to load certificate used by Syncthing."), SyncthingErrorCategory::OverallConnection, QNetworkReply::NoError); return false; diff --git a/syncthingconnector/syncthingconnectionsettings.cpp b/syncthingconnector/syncthingconnectionsettings.cpp index 6c520c5..12cea23 100644 --- a/syncthingconnector/syncthingconnectionsettings.cpp +++ b/syncthingconnector/syncthingconnectionsettings.cpp @@ -22,7 +22,7 @@ bool SyncthingConnectionSettings::loadHttpsCert() if (httpsCertPath.isEmpty()) { return true; } - const auto certs(QSslCertificate::fromPath(httpsCertPath)); + const auto certs = QSslCertificate::fromPath(httpsCertPath); if (certs.isEmpty() || certs.at(0).isNull()) { return false; }