Also use method-scoped static in Windows SftpPlugin

This commit is contained in:
Alexander Lohnau 2023-07-25 21:47:54 +02:00
parent 8edd2a2e52
commit bd07b9b255
2 changed files with 7 additions and 3 deletions

View file

@ -34,6 +34,13 @@ bool SftpPlugin::startBrowsing()
bool SftpPlugin::receivePacket(const NetworkPacket &np)
{
static const QSet<QString> expectedFields{
QStringLiteral("ip"),
QStringLiteral("port"),
QStringLiteral("user"),
QStringLiteral("password"),
QStringLiteral("path"),
};
QStringList receivedFieldsList = np.body().keys();
QSet<QString> receivedFields(receivedFieldsList.begin(), receivedFieldsList.end());
if (!(expectedFields - receivedFields).isEmpty()) {

View file

@ -11,9 +11,6 @@
#define PACKET_TYPE_SFTP_REQUEST QStringLiteral("kdeconnect.sftp.request")
static const QSet<QString> expectedFields = QSet<QString>()
<< QStringLiteral("ip") << QStringLiteral("port") << QStringLiteral("user") << QStringLiteral("password") << QStringLiteral("path");
;
class SftpPlugin : public KdeConnectPlugin
{
Q_OBJECT