From e4c743a680ec6ece002203d0a4c1f9daba91fb25 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Tue, 25 Jul 2023 21:37:02 +0200 Subject: [PATCH] SftpPlugin: Do not use global static for variable We only load it in one case anyway, meaning we can make it static in the method scope --- plugins/sftp/sftpplugin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp index a7f52caf5..9a575485a 100644 --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -23,8 +23,6 @@ K_PLUGIN_CLASS_WITH_JSON(SftpPlugin, "kdeconnect_sftp.json") -static const QSet fields_c = QSet() << QStringLiteral("user") << QStringLiteral("port") << QStringLiteral("path"); - struct SftpPlugin::Pimpl { Pimpl() : m_mounter(nullptr) @@ -123,6 +121,7 @@ bool SftpPlugin::startBrowsing() bool SftpPlugin::receivePacket(const NetworkPacket &np) { + static const QSet fields_c{QStringLiteral("user"), QStringLiteral("port"), QStringLiteral("path")}; const QStringList keysList = np.body().keys(); const auto keys = QSet(keysList.begin(), keysList.end()); if (!(fields_c - keys).isEmpty() && !np.has(QStringLiteral("errorMessage"))) {