Commit f1cd744c authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Transcode job: don't silently overwrite exported files.

BUG: 433623
parent 32c27894
......@@ -63,19 +63,18 @@ bool TranscodeJob::startJob()
QFileInfo finfo(source);
QString fileName = finfo.fileName().section(QLatin1Char('.'), 0, -2);
QDir dir = finfo.absoluteDir();
QString path = fileName + transcoderExt;
int fileCount = 1;
QString num = QString::number(fileCount).rightJustified(4, '0', false);
QString path = fileName + num + transcoderExt;
bool updatedPath = false;
while (dir.exists(path)) {
QString num = QString::number(fileCount).rightJustified(4, '0', false);
path = fileName + num + transcoderExt;
++fileCount;
num = QString::number(fileCount).rightJustified(4, '0', false);
path = fileName + num + transcoderExt;
updatedPath = true;
}
m_destUrl = dir.absoluteFilePath(fileName);
if (updatedPath) {
m_destUrl.append(QString::number(fileCount).rightJustified(4, '0', false));
}
m_destUrl.append(QString::number(fileCount).rightJustified(4, '0', false));
bool result;
if (type == ClipType::Playlist || type == ClipType::SlideShow) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment