From 14b06ed6cea307a8e2c50ae35b519d3c9a6bb146 Mon Sep 17 00:00:00 2001 From: taynpg Date: Tue, 17 Jun 2025 16:50:36 +0800 Subject: [PATCH] change: can down not send. --- ClientCore/FileTrans.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ClientCore/FileTrans.cpp b/ClientCore/FileTrans.cpp index d893d73..0656cee 100644 --- a/ClientCore/FileTrans.cpp +++ b/ClientCore/FileTrans.cpp @@ -33,7 +33,7 @@ void FileTrans::fbtReqSend(QSharedPointer frame) // recv is single thread recv, judge idle if (downTask_.state == TaskState::STATE_RUNNING) { - info.msg = QString(tr("busy")); + info.msg = QString(tr("busy...")); clientCore_->Send(info, FBT_CLI_CANOT_SEND, frame->fid); return; } @@ -99,20 +99,12 @@ void FileTrans::fbtTransDone(QSharedPointer frame) qCritical() << QString(tr("recv file:%1 done sigal, but file not opened.")).arg(info.msg); } +// the other party indicates that can download, ready to receive the file. void FileTrans::fbtCanDown(QSharedPointer frame) { - // ready to send - InfoMsg info = infoUnpack(frame->data); - auto doTask = QSharedPointer::create(); - doTask->file.setFileName(info.fromPath); - if (!doTask->file.open(QIODevice::ReadOnly)) { - qCritical() << QString(tr("open file failed: %1")).arg(info.fromPath); - return; - } - doTask->task.isUpload = true; - doTask->task.localPath = ""; - doTask->task.remoteId = frame->fid; - SendFile(doTask); + // ready to recv file. + auto info = infoUnpack(frame->data); + qDebug() << QString(tr("start trans file:%1.")).arg(info.fromPath); } void FileTrans::fbtCanotDown(QSharedPointer frame)