代码拉取完成,页面将自动刷新
同步操作将从 Acreate/gamePlanTool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include "LoadSettingFileData.h"
#include <qfile.h>
#include <QTextStream>
#include <qxml.h>
#include <QtXml/QtXml>
#include "dXml.h"
#include <XmlDataUnit.h>
#include <XmlDataDoc.h>
int* lThread::LoadSettingFileData::threadRunStatus(int* status) {
static int runStatus = 0;
if( status != Q_NULLPTR )
runStatus = *status;
return &runStatus;
}
void lThread::LoadSettingFileData::releaseResources( ) {
int status = 0xf1;
while( true ) {
QMutexLocker locker(q_mutex);
bool isRunning = this->isRunning( );
if( !isRunning )
break;
int runStatus = *threadRunStatus( );
if( !runStatus )
threadRunStatus(&status);
}
this->quit( );
}
lThread::LoadSettingFileData::LoadSettingFileData(const SigInstance* sigInstance
, QWidget* paren): QThread(paren),
m_sigInstance(sigInstance) {
q_mutex = new QMutex;
}
lThread::LoadSettingFileData::~LoadSettingFileData( ) {
this->releaseResources( );
delete q_mutex;
}
void lThread::LoadSettingFileData::stopTask( ) {
// 释放资源
this->releaseResources( );
}
void lThread::LoadSettingFileData::startTask( ) {
// 释放资源
this->releaseResources( );
this->start( );
}
void lThread::LoadSettingFileData::setTask(LoadSettingType taskType
, QString path
, dXml::XmlDataUnit* obj) {
this->taskType = taskType;
this->taskDir = path;
this->taskPath = path + "/" + QFileInfo(path).baseName( ) + "setting.xml";
this->taskDoc = obj;
}
void lThread::LoadSettingFileData::runReadTask(dXml::XmlDataUnit* saveToData
, QString& outPITarget
, QString& outPIData
, const QString& file) {
dXml::readXmlFile(saveToData, outPITarget, outPIData, file);
}
void lThread::LoadSettingFileData::runWriteTask(dXml::XmlDataUnit* saveToData
, const QString& file) {
saveToData->save(file);
}
void lThread::LoadSettingFileData::run( ) {
if( taskType == NONE || taskPath.isEmpty( ) ) {
return;
} else {
QString outPITarget, outPIData;
switch( this->taskType ) {
case READ:
runReadTask(taskDoc, outPITarget, outPIData, taskPath);
emit readOverTask(this->taskDoc);
break;
case WRITE:
runWriteTask(taskDoc, taskPath);
emit writeOverTask(this->taskDoc);
break;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。