up:校验逻辑进度更新。
This commit is contained in:
@@ -91,11 +91,11 @@ void ClientCore::handleAsk(QSharedPointer<FrameBuffer> frame)
|
||||
for (auto& item : msg.mapData) {
|
||||
if (item.mark == STRMSG_AC_UP) {
|
||||
if (!Util::DirExist(item.key, true)) {
|
||||
item.properD = static_cast<qint32>(FCS_DIR_NOT_EXIST);
|
||||
item.state = static_cast<qint32>(FCS_DIR_NOT_EXIST);
|
||||
}
|
||||
} else {
|
||||
if (!Util::FileExist(item.key)) {
|
||||
item.properD = static_cast<qint32>(FCS_FILE_NOT_EXIST);
|
||||
item.state = static_cast<qint32>(FCS_FILE_NOT_EXIST);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,6 +162,11 @@ void CheckCondition::SetTasks(const QVector<TransTask>& tasks)
|
||||
tasks_ = tasks;
|
||||
}
|
||||
|
||||
InfoMsg CheckCondition::GetInfoMsg() const
|
||||
{
|
||||
return infoMsg_;
|
||||
}
|
||||
|
||||
void CheckCondition::recvFrame(QSharedPointer<FrameBuffer> frame)
|
||||
{
|
||||
InfoMsg info = infoUnpack<InfoMsg>(frame->data);
|
||||
|
||||
@@ -85,6 +85,7 @@ public:
|
||||
public:
|
||||
void SetClientCore(ClientCore* clientCore);
|
||||
void SetTasks(const QVector<TransTask>& tasks);
|
||||
InfoMsg GetInfoMsg() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void sigCheckOver();
|
||||
|
||||
@@ -145,20 +145,27 @@ void frelayGUI::HandleTask(const QVector<TransTask>& tasks)
|
||||
transform_->SetTasks(tasks);
|
||||
|
||||
// 检查文件
|
||||
CheckCondition checkThread(this);
|
||||
checkThread.SetTasks(tasks);
|
||||
checkThread.SetClientCore(clientCore_);
|
||||
CheckCondition cond(this);
|
||||
cond.SetTasks(tasks);
|
||||
cond.SetClientCore(clientCore_);
|
||||
|
||||
LoadingDialog checking(this);
|
||||
checking.setTipsText("正在检查文件...");
|
||||
|
||||
connect(&checkThread, &CheckCondition::sigCheckOver, &checking, &LoadingDialog::cancelBtnClicked);
|
||||
connect(&checking, &LoadingDialog::cancelWaiting, &checkThread, &CheckCondition::interrupCheck);
|
||||
connect(clientCore_, &ClientCore::sigMsgAnswer, &checkThread, &CheckCondition::recvFrame);
|
||||
connect(&cond, &CheckCondition::sigCheckOver, &checking, &LoadingDialog::cancelBtnClicked);
|
||||
connect(&checking, &LoadingDialog::cancelWaiting, &cond, &CheckCondition::interrupCheck);
|
||||
connect(clientCore_, &ClientCore::sigMsgAnswer, &cond, &CheckCondition::recvFrame);
|
||||
|
||||
checkThread.start();
|
||||
cond.start();
|
||||
checking.exec();
|
||||
|
||||
auto msg = cond.GetInfoMsg();
|
||||
for (auto& data : msg.mapData) {
|
||||
if (data.state == static_cast<qint32>(FCS_NORMAL)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
transform_->exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,9 @@ enum FileCheckState {
|
||||
#define STRMSG_AC_ANSWER_FILEINFO "answerFileInfo"
|
||||
#define STRMSG_AC_UP "upAction"
|
||||
#define STRMSG_AC_DOWN "downAction"
|
||||
#define STRMSG_AC_ACCEPT "acceptAction"
|
||||
#define STRMSG_AC_REJECT "rejectAction"
|
||||
#define STRMSG_AC_CANCEL "cancelAction"
|
||||
|
||||
#define STRMSG_ST_FILEEXIT "fileExist"
|
||||
#define STRMSG_ST_FILENOEXIT "fileNotExist"
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
struct PropertyData {
|
||||
QString key;
|
||||
QString mark;
|
||||
QString properA;
|
||||
QString userAction;
|
||||
QString properB;
|
||||
QString properC;
|
||||
qint32 properD;
|
||||
qint32 state;
|
||||
qint32 properE;
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ struct InfoMsg {
|
||||
}
|
||||
data << mapData.size();
|
||||
for (const auto& item : mapData) {
|
||||
data << item.key << item.mark << item.properA << item.properB << item.properC << item.properD << item.properE;
|
||||
data << item.key << item.mark << item.userAction << item.properB << item.properC << item.state << item.properE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ struct InfoMsg {
|
||||
data >> mapSize;
|
||||
for (int i = 0; i < mapSize; ++i) {
|
||||
PropertyData prop;
|
||||
data >> prop.key >> prop.mark >> prop.properA >> prop.properB >> prop.properC >> prop.properD >> prop.properE;
|
||||
data >> prop.key >> prop.mark >> prop.userAction >> prop.properB >> prop.properC >> prop.state >> prop.properE;
|
||||
mapData.insert(prop.key, prop);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user