From bd07b9b255b146373a77b423084ddad33553d827 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Tue, 25 Jul 2023 21:47:54 +0200 Subject: [PATCH] Also use method-scoped static in Windows SftpPlugin --- plugins/sftp/sftpplugin-win.cpp | 7 +++++++ plugins/sftp/sftpplugin-win.h | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/sftp/sftpplugin-win.cpp b/plugins/sftp/sftpplugin-win.cpp index 09cae9e90..dccd375ed 100644 --- a/plugins/sftp/sftpplugin-win.cpp +++ b/plugins/sftp/sftpplugin-win.cpp @@ -34,6 +34,13 @@ bool SftpPlugin::startBrowsing() bool SftpPlugin::receivePacket(const NetworkPacket &np) { + static const QSet expectedFields{ + QStringLiteral("ip"), + QStringLiteral("port"), + QStringLiteral("user"), + QStringLiteral("password"), + QStringLiteral("path"), + }; QStringList receivedFieldsList = np.body().keys(); QSet receivedFields(receivedFieldsList.begin(), receivedFieldsList.end()); if (!(expectedFields - receivedFields).isEmpty()) { diff --git a/plugins/sftp/sftpplugin-win.h b/plugins/sftp/sftpplugin-win.h index 689b01fef..b8287f259 100644 --- a/plugins/sftp/sftpplugin-win.h +++ b/plugins/sftp/sftpplugin-win.h @@ -11,9 +11,6 @@ #define PACKET_TYPE_SFTP_REQUEST QStringLiteral("kdeconnect.sftp.request") -static const QSet expectedFields = QSet() - << QStringLiteral("ip") << QStringLiteral("port") << QStringLiteral("user") << QStringLiteral("password") << QStringLiteral("path"); -; class SftpPlugin : public KdeConnectPlugin { Q_OBJECT