|
|
|
@ -310,6 +310,7 @@ int ExportDataThread::insertXMLNode(const char* xmlPath, _XMLExportDataInfo& dat
|
|
|
|
|
|
|
|
|
|
void ExportDataThread::run()
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
while (!b_quit || (b_quit && (!export_XMLData_Info_queue->isEmpty() || readyToSendZip || !tmpListToZip.isEmpty()))) {
|
|
|
|
|
_XMLExportDataInfo element;
|
|
|
|
|
if (!export_XMLData_Info_queue->isEmpty()) {
|
|
|
|
@ -359,14 +360,17 @@ void ExportDataThread::run()
|
|
|
|
|
|
|
|
|
|
QFile* file[2] = { NULL };
|
|
|
|
|
|
|
|
|
|
QFile fileNg(fileList[0]);
|
|
|
|
|
QFile fileOk(fileList[1]);
|
|
|
|
|
file[0] = new QFile(fileList[0]);
|
|
|
|
|
file[1] = new QFile(fileList[1]);
|
|
|
|
|
|
|
|
|
|
fileNg.open(QIODevice::WriteOnly);
|
|
|
|
|
fileOk.open(QIODevice::WriteOnly);
|
|
|
|
|
// QFile fileNg(fileList[0]);
|
|
|
|
|
// QFile fileOk(fileList[1]);
|
|
|
|
|
|
|
|
|
|
QTextStream ngStream(fileNg);
|
|
|
|
|
QTextStream okStream(fileOk);
|
|
|
|
|
file[0]->open(QIODevice::WriteOnly);
|
|
|
|
|
file[1]->open(QIODevice::WriteOnly);
|
|
|
|
|
|
|
|
|
|
QTextStream ngStream(file[0]);
|
|
|
|
|
QTextStream okStream(file[1]);
|
|
|
|
|
|
|
|
|
|
argsNg.append("a");
|
|
|
|
|
argsNg.append(zipFilePaths[0]);
|
|
|
|
@ -391,8 +395,8 @@ void ExportDataThread::run()
|
|
|
|
|
argsOk.append("-i@" + fileList[1]);
|
|
|
|
|
argsOk.append("-mx=3");
|
|
|
|
|
|
|
|
|
|
fileNg.close();
|
|
|
|
|
fileOk.close();
|
|
|
|
|
file[0]->close();
|
|
|
|
|
file[1]->close();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < zipFilePaths.size(); i++) {
|
|
|
|
|
if (file[i]->size() == 0) {
|
|
|
|
@ -409,8 +413,8 @@ void ExportDataThread::run()
|
|
|
|
|
QFile file(zipFilePaths[i]);
|
|
|
|
|
file.remove();
|
|
|
|
|
}
|
|
|
|
|
fileNg.remove();
|
|
|
|
|
fileOk.remove();
|
|
|
|
|
file[0]->remove();
|
|
|
|
|
file[1]->remove();
|
|
|
|
|
listToZip.clear();
|
|
|
|
|
readyToSendZip = false;
|
|
|
|
|
}
|
|
|
|
@ -430,6 +434,16 @@ void ExportDataThread::run()
|
|
|
|
|
hint = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (const std::exception& e) {
|
|
|
|
|
// 注意:std::exception通常不捕获由运行时错误引发的异常
|
|
|
|
|
// 但这里是为了演示catch块的结构
|
|
|
|
|
std::cerr << __FUNCTION__<<"捕获到异常: " << e.what() << std::endl;
|
|
|
|
|
}
|
|
|
|
|
catch (...) {
|
|
|
|
|
// 使用省略号(...)可以捕获所有类型的异常,这是一种通用的捕获方式
|
|
|
|
|
std::cerr << "捕获到未知类型的异常" << std::endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//*****************************************已经调试好,没有理清逻辑前不要动**********************
|
|
|
|
|
void ExportDataThread::check_save_dir(std::string dir_path)
|
|
|
|
|