diff --git a/Cigarette/exportData.cpp b/Cigarette/exportData.cpp index c99ef8a..7e829e4 100644 --- a/Cigarette/exportData.cpp +++ b/Cigarette/exportData.cpp @@ -359,18 +359,14 @@ void ExportDataThread::run() QFile* file[2] = { NULL }; - file[0] = new QFile(fileList[0]); - file[1] = new QFile(fileList[1]); + QFile fileNg(fileList[0]); + QFile fileOk(fileList[1]); + fileNg.open(QIODevice::WriteOnly); + fileOk.open(QIODevice::WriteOnly); - //QFile fileNg(fileList[0]); - // QFile fileOk(fileList[1]); - - file[0]->open(QIODevice::WriteOnly); - file[1]->open(QIODevice::WriteOnly); - - QTextStream ngStream(file[0]); - QTextStream okStream(file[1]); + QTextStream ngStream(fileNg); + QTextStream okStream(fileOk); argsNg.append("a"); argsNg.append(zipFilePaths[0]); @@ -395,8 +391,8 @@ void ExportDataThread::run() argsOk.append("-i@" + fileList[1]); argsOk.append("-mx=3"); - file[0]->close(); - file[1]->close(); + fileNg.close(); + fileOk.close(); for (int i = 0; i < zipFilePaths.size(); i++) { if (file[i]->size() == 0) { @@ -413,8 +409,8 @@ void ExportDataThread::run() QFile file(zipFilePaths[i]); file.remove(); } - file[0]->remove(); - file[1]->remove(); + fileNg.remove(); + fileOk.remove(); listToZip.clear(); readyToSendZip = false; }