Fix SFTP plugin on Windows

Broken by https://invent.kde.org/network/kdeconnect-android/-/merge_requests/320
This commit is contained in:
Albert Vaca Cintora 2023-09-06 04:44:04 +02:00
parent 17519fdb7a
commit 4d5474db7b

View file

@ -50,10 +50,18 @@ void SftpPlugin::receivePacket(const NetworkPacket &np)
QString path;
if (np.has(QStringLiteral("multiPaths"))) {
path = QStringLiteral("/");
QStringList paths = np.get<QStringList>(QStringLiteral("multiPaths"));
if (paths.size() == 1) {
path = paths[0];
} else {
path = QStringLiteral("/");
}
} else {
path = np.get<QString>(QStringLiteral("path"));
}
if (!path.endsWith(QChar::fromLatin1('/'))) {
path += QChar::fromLatin1('/');
}
QString url_string = QStringLiteral("sftp://%1:%2@%3:%4%5")
.arg(np.get<QString>(QStringLiteral("user")),