Rewrite sftp file copy to Qt way (#562)

Rewrite sftp file copy to Qt way
This commit is contained in:
pokamest 2024-02-17 13:07:17 -08:00 committed by GitHub
parent b05a5ee1c6
commit 16db23c159
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 25 deletions

View file

@ -211,13 +211,7 @@ ErrorCode ServerController::uploadFileToHost(const ServerCredentials &credential
localFile.write(data);
localFile.close();
#ifdef Q_OS_WINDOWS
error = m_sshClient.sftpFileCopy(overwriteMode, localFile.fileName().toLocal8Bit().toStdString(), remotePath.toStdString(),
"non_desc");
#else
error = m_sshClient.sftpFileCopy(overwriteMode, localFile.fileName().toStdString(), remotePath.toStdString(),
"non_desc");
#endif
error = m_sshClient.sftpFileCopy(overwriteMode, localFile.fileName(), remotePath, "non_desc");
if (error != ErrorCode::NoError) {
return error;