fun:文件校验功能添加(未结束)。

This commit is contained in:
2025-11-05 13:09:12 +08:00
parent 9bed3ed536
commit 1a81c34840
11 changed files with 229 additions and 15 deletions

View File

@@ -6,6 +6,7 @@
#include <QDialog>
#include <QFile>
#include <QThread>
#include <unordered_map>
namespace Ui {
class TransForm;
@@ -33,7 +34,7 @@ signals:
void sigTaskNum(const QString& data);
private:
void setProgress(double val);
void setProgress(double val);
void handleFailed();
void handleDone();
void handleUI(const TransTask& task);
@@ -41,12 +42,12 @@ private:
protected:
void showEvent(QShowEvent* event) override;
void closeEvent(QCloseEvent* event) override;
void closeEvent(QCloseEvent* event) override;
private:
bool exis_{ false };
bool exis_{false};
TranFromTh* workTh_{};
qint32 curTaskNum_{ 0 };
qint32 curTaskNum_{0};
QVector<TransTask> tasks_;
FileTrans* fileTrans_{};
ClientCore* clientCore_{};
@@ -61,6 +62,7 @@ public:
explicit TranFromTh(TransForm* tf, QObject* parent = nullptr) : QThread(parent), tf_(tf)
{
}
protected:
void run() override
{
@@ -73,4 +75,47 @@ private:
TransForm* tf_;
};
#endif // TRANSFORM_H
enum CondCheckResult {
CCR_NO_CHECK = 0,
CCR_CHECK_PASSED,
CCR_CHECK_FAILED,
CCR_CHECK_INTERRUPT,
CCR_CHECK_LOCAL_EXIT,
CCR_CHECK_REMOTE_EXIT,
CCR_CHECK_LOCAL_NOT_EXIT,
CCR_CHECK_REMOTE_NOT_EXIT
};
class CheckCondition : public QThread
{
Q_OBJECT
public:
CheckCondition(QObject* parent = nullptr);
public:
void SetClientCore(ClientCore* clientCore);
void SetTasks(const QVector<TransTask>& tasks);
Q_SIGNALS:
void sigCheckOver();
public Q_SLOTS:
void interrupCheck();
void recvFrame(QSharedPointer<FrameBuffer> frame);
protected:
void run() override;
private:
QString msg_;
bool isRun_;
bool isAlreadyInter_;
QVector<TransTask> tasks_;
ClientCore* clientCore_{};
QVector<QString> remoteNotExits_;
QVector<CondCheckResult> checkRet_;
std::unordered_map<CondCheckResult, QVector<QString>> resultMsgMap_;
};
#endif // TRANSFORM_H