Skip to content

Commit 8027889

Browse files
committed
Fix Issue #115 : weird behaviour of 7z if only one file (not happy with
the *...)
1 parent 9f5cadc commit 8027889

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/PostingJob.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ PostingJob::PostingJob(NgPost *ngPost,
6363

6464
_tmpPath(tmpPath), _rarPath(rarPath), _rarArgs(rarArgs), _rarSize(rarSize), _useRarMax(useRarMax), _par2Pct(par2Pct),
6565
_doCompress(doCompress), _doPar2(doPar2), _rarName(rarName), _rarPass(rarPass), _keepRar(keepRar),
66+
_splitArchive(false),
6667

6768
_nntpConnections(), _closedConnections(),
6869

@@ -964,6 +965,7 @@ bool PostingJob::startCompressFiles(const QString &cmdRar,
964965
_log(tr("postSize: %1 MB => volSize: %2").arg(postSize).arg(volSize));
965966
}
966967
args << QString("-v%1m").arg(volSize);
968+
_splitArchive = true;
967969
}
968970

969971
#if defined( Q_OS_WIN )
@@ -1122,7 +1124,7 @@ bool PostingJob::startGenPar2(const QString &tmpFolder,
11221124
else
11231125
{
11241126
if (_use7z)
1125-
args << QString("%1/%2.7z*").arg(archiveTmpFolder, archiveName);
1127+
args << QString("%1/%2.7z%3").arg(archiveTmpFolder, archiveName, _splitArchive ? "*": "");
11261128
else
11271129
args << QString("%1/%2*rar").arg(archiveTmpFolder, archiveName);
11281130

src/PostingJob.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class PostingJob : public QObject
8282
const QString _rarName;
8383
const QString _rarPass;
8484
const bool _keepRar;
85+
bool _splitArchive;
8586

8687

8788

0 commit comments

Comments
 (0)