From b20c80a1574de4c8f1c23c87857c92a6e9cf5017 Mon Sep 17 00:00:00 2001 From: "huheng@kylinos.cn" Date: Tue, 16 May 2023 15:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E6=96=87=E4=BB=B6=E4=BC=A0?= =?UTF-8?q?=E8=BE=93):=20=E4=BF=AE=E5=A4=8D=E4=B8=8A=E4=BC=A0=E7=A9=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加判断,完成所有文件夹创建之后,若没有文件则发送完成信号 https://gitee.com/openkylin/kylin-connectivity/issues/I72CMD --- filetransfer/ftpclient/ftpmanager.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; }