Always save a backup of original project file when archiving in case something goes wrong

parent f655c919
......@@ -28,6 +28,7 @@
#include "xml/xml.hpp"
#include "kdenlive_debug.h"
#include "doc/kdenlivedoc.h"
#include <KDiskFreeSpaceInfo>
#include <KGuiItem>
#include <KMessageBox>
......@@ -868,6 +869,11 @@ bool ArchiveWidget::processProjectFile()
return true;
// Make a copy of original project file for extra safety
QString backupPath = archive_url->url().toLocalFile() + QDir::separator() + m_name + QStringLiteral("-backup.kdenlive");
QFile source(pCore->currentDoc()->url().toLocalFile());
QString path = archive_url->url().toLocalFile() + QDir::separator() + m_name + QStringLiteral(".kdenlive");
QFile file(path);
if (file.exists() && KMessageBox::warningYesNo(this, i18n("Output file already exists. Do you want to overwrite it?")) != KMessageBox::Yes) {
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