Index: sftp/kio_sftp.cpp =================================================================== --- sftp/kio_sftp.cpp +++ sftp/kio_sftp.cpp @@ -1614,18 +1614,16 @@ sCopyFile.clear(); } - // On success or errorcode < 0, emit the finished signal and - // send a warning message to the client if errorCode < 0. - if (cs == sftpProtocol::Success || errorCode < 0) { - if (errorCode < 0) - sftpSendWarning(errorCode, sCopyFile); - finished(); + if (cs != sftpProtocol::Success && errorCode > 0) { + error(errorCode, sCopyFile); return; } - if (errorCode) { - error(errorCode, sCopyFile); + if (errorCode < 0) { + sftpSendWarning(errorCode, sCopyFile); } + + finished(); } sftpProtocol::StatusCode sftpProtocol::sftpCopyGet(const QUrl& url, const QString& sCopyFile, int permissions, KIO::JobFlags flags, int& errorCode)