Commit c0b3b54c authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Fix speed job overwrites without warning

Fixes #262
parent 4708ac10
Pipeline #4539 passed with stage
in 22 minutes and 21 seconds
......@@ -35,6 +35,7 @@
#include <QInputDialog>
#include <QScopedPointer>
#include <KIO/RenameDialog>
#include <mlt++/Mlt.h>
SpeedJob::SpeedJob(const QString &binId, double speed, QString destUrl)
......@@ -83,6 +84,17 @@ int SpeedJob::prepareJob(const std::shared_ptr<JobManager> &ptr, const std::vect
auto binClip = pCore->projectItemModel()->getClipByBinID(binId);
// Filter several clips, destination points to a folder
QString mltfile = QFileInfo(binClip->url()).absoluteFilePath() + QStringLiteral(".mlt");
if (QFile::exists(mltfile)) {
KIO::RenameDialog renameDialog(qApp->activeWindow(), QString(), /*i18n("File already exists"), */QUrl::fromLocalFile(mltfile), QUrl::fromLocalFile(mltfile), KIO::RenameDialog_Option::RenameDialog_Overwrite );
if (renameDialog.exec() == QDialog::Accepted) {
QUrl final = renameDialog.newDestUrl();
if (final.isValid()) {
mltfile = final.toLocalFile();
}
} else {
return -1;
}
}
destinations[binId] = mltfile;
}
// Now we have to create the jobs objects. This is trickier than usual, since the parameters are different for each job (each clip has its own
......
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