Skip to content

Commit d6e12f7

Browse files
committed
Better Zip for USB drive targets.
1 parent 5fdfbc6 commit d6e12f7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

propside/mainspinwindow.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2896,7 +2896,13 @@ void MainSpinWindow::zipProject()
28962896
}
28972897

28982898
// zip folder
2899-
zipIt(dTmpPath, dstPath);
2899+
zipIt(dTmpPath, dTmpPath);
2900+
if(dstPath.endsWith("/"))
2901+
dstPath = dstPath.left(dstPath.lastIndexOf("/"));
2902+
if(dTmpPath.endsWith("/"))
2903+
dTmpPath = dTmpPath.left(dTmpPath.lastIndexOf("/"));
2904+
QFile::copy(dTmpPath+".zip", dstPath+".zip");
2905+
QFile::remove(dTmpPath+".zip");
29002906

29012907
#ifdef ENABLE_KEEP_ZIP_FOLDER
29022908
// and remove folder if save zip folder is not checked
@@ -2977,6 +2983,8 @@ void MainSpinWindow::zipIt(QString dir, QString dst)
29772983
while (inFile.getChar(&c) && outFile.putChar(c))
29782984
; // yes empty body
29792985

2986+
QApplication::processEvents();
2987+
29802988
if (outFile.getZipError() != UNZ_OK) {
29812989
QMessageBox::critical(this, tr("Zip Error"), QString("testCreate(): outFile.putChar(): %1").arg(outFile.getZipError()));
29822990
return;

0 commit comments

Comments
 (0)