🐞 fix(文件传输): 修复上传空文件夹错误问题
添加判断,完成所有文件夹创建之后,若没有文件则发送完成信号 https://gitee.com/openkylin/kylin-connectivity/issues/I72CMD
This commit is contained in:
parent
1ec861d960
commit
b20c80a157
|
@ -160,7 +160,9 @@ void FtpManager::uploadAllFiles(const QStringList &fileList, QString uploadPath)
|
||||||
for (int i = 0; i < dirPathList.size(); i++) {
|
for (int i = 0; i < dirPathList.size(); i++) {
|
||||||
handleUploadDir(dirPathList.value(i), uploadPath);
|
handleUploadDir(dirPathList.value(i), uploadPath);
|
||||||
}
|
}
|
||||||
|
if (!currentUploadFiles.isEmpty()) {
|
||||||
upload(currentUploadFiles, uploadPath);
|
upload(currentUploadFiles, uploadPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FtpManager::list(QString path)
|
void FtpManager::list(QString path)
|
||||||
|
@ -360,10 +362,16 @@ void FtpManager::ftpCommandFinished(int commandId, bool error)
|
||||||
qInfo() << "CommandFinished: Mkdir !";
|
qInfo() << "CommandFinished: Mkdir !";
|
||||||
QStringList list = m_taskLocalMap.take(commandId);
|
QStringList list = m_taskLocalMap.take(commandId);
|
||||||
QString uploadPath = m_taskPathMap.take(commandId);
|
QString uploadPath = m_taskPathMap.take(commandId);
|
||||||
|
if (!list.isEmpty()) {
|
||||||
upload(list, uploadPath);
|
upload(list, uploadPath);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_taskLocalMap.remove(commandId);
|
m_taskLocalMap.remove(commandId);
|
||||||
m_taskPathMap.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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue