Fixed a regression in output file name generation.

This commit is contained in:
LoRd_MuldeR 2017-12-08 22:41:14 +01:00
parent 0012af66a7
commit c90c2fab0f

View File

@ -497,13 +497,13 @@ int ProcessThread::generateOutFileName(QString &outFileName)
}
//Generate final name
for (int n = 2; n <= 99999; ++n)
const QFileInfo origFileName(outFileName);
for (int n = 2; n <= 65534; ++n)
{
//Check file existence
QFileInfo outFileInfo(outFileName);
if (outFileInfo.exists())
if (QFileInfo(outFileName).exists())
{
outFileName = QString("%1/%2 (%3).%4").arg(outFileInfo.canonicalPath(), outFileInfo.completeBaseName(), QString::number(n), outFileInfo.suffix());
outFileName = origFileName.absoluteDir().filePath(QString("%1 (%2).%3").arg(origFileName.completeBaseName(), QString::number(n), origFileName.suffix()));
continue;
}