diff --git a/Cigarette/exportData.cpp b/Cigarette/exportData.cpp index 9a2cb4f..95f5816 100644 --- a/Cigarette/exportData.cpp +++ b/Cigarette/exportData.cpp @@ -325,7 +325,7 @@ void ExportDataThread::run() } } - if (b_quit && (!tmpListToZip.isEmpty())) { + if ((b_quit || (!timer->isActive() && !readyToSendZip)) && (!tmpListToZip.isEmpty())) { listToZip += tmpListToZip; tmpListToZip.clear(); readyToSendZip = true; @@ -403,6 +403,7 @@ void ExportDataThread::run() } fileNg.remove(); fileOk.remove(); + listToZip.clear(); readyToSendZip = false; } } @@ -505,20 +506,23 @@ void ExportDataThread::GetDataFromSaveThread(QString filePath) { QString remotePath; if (timer->isActive()) { - if ((filePath.indexOf("ng_result") != -1) || (filePath.indexOf("ng") == -1)) { + if (filePath.indexOf("ng") == -1) { tmpListToZip.append(filePath); } } else { - listToZip = tmpListToZip; - tmpListToZip.clear(); - if ((filePath.indexOf("ng_result") != -1) || (filePath.indexOf("ng") == -1)) { - tmpListToZip.append(filePath); + if (!tmpListToZip.isEmpty()) { + listToZip = tmpListToZip; + tmpListToZip.clear(); } if (!listToZip.isEmpty()) { readyToSendZip = true; } + + if (filePath.indexOf("ng") == -1) { + tmpListToZip.append(filePath); + } //remotePath = filePath.mid(filePath.indexOf("image") - 1); //ConnectServer(filePath, remotePath); timer->start(1000 * 60 * 5); // 5min