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
This commit is contained in:
parent
eedbfe9b49
commit
e4c743a680
1 changed files with 1 additions and 2 deletions
|
@ -23,8 +23,6 @@
|
|||
|
||||
K_PLUGIN_CLASS_WITH_JSON(SftpPlugin, "kdeconnect_sftp.json")
|
||||
|
||||
static const QSet<QString> fields_c = QSet<QString>() << 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<QString> 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"))) {
|
||||
|
|
Loading…
Reference in a new issue