diff --git a/filetransfer/ftpclient/ftpmanager.cpp b/filetransfer/ftpclient/ftpmanager.cpp index fe630f8..d4188c5 100644 --- a/filetransfer/ftpclient/ftpmanager.cpp +++ b/filetransfer/ftpclient/ftpmanager.cpp @@ -160,7 +160,9 @@ void FtpManager::uploadAllFiles(const QStringList &fileList, QString uploadPath) for (int i = 0; i < dirPathList.size(); i++) { handleUploadDir(dirPathList.value(i), uploadPath); } - upload(currentUploadFiles, uploadPath); + if (!currentUploadFiles.isEmpty()) { + upload(currentUploadFiles, uploadPath); + } } void FtpManager::list(QString path) @@ -360,10 +362,16 @@ void FtpManager::ftpCommandFinished(int commandId, bool error) qInfo() << "CommandFinished: Mkdir !"; QStringList list = m_taskLocalMap.take(commandId); QString uploadPath = m_taskPathMap.take(commandId); - upload(list, uploadPath); + if (!list.isEmpty()) { + upload(list, uploadPath); + } } m_taskLocalMap.remove(commandId); m_taskPathMap.remove(commandId); + if (m_uploadFiles.isEmpty() && m_taskLocalMap.isEmpty() && m_taskPathMap.isEmpty()) { + m_isFree = true; + Q_EMIT sigUpdateTransferProgress(0, 0); + } return; }