Add warning for malformed XML data

This commit is contained in:
Thomas Wilshaw
2021-11-08 20:20:44 +00:00
parent 8e40e033b9
commit b4bfee1193
2 changed files with 14 additions and 0 deletions
+13
View File
@@ -15,6 +15,8 @@
#include "markercopypaste.h"
#include <QMessageBox>
#include "core.h"
#include "markerundo.h"
#include "widget/timebased/timebasedwidget.h"
@@ -120,6 +122,17 @@ void MarkerCopyPasteService::PasteMarkersFromClipboard(TimelineMarkerList* list,
}
}
if (reader.hasError()) {
// If this was NOT an internal error, we assume it's an XML error that the user needs to know about
QMessageBox::critical((QWidget*)Core::instance()->main_window(),
QCoreApplication::translate("MarkerCopyPasteWidget", "Error pasting markers"),
QCoreApplication::translate("MarkerCopyPasteWidget", "Failed to paste markers: %1").arg(reader.errorString()),
QMessageBox::Ok);
return;
}
Core::instance()->undo_stack()->pushIfHasChildren(command);
}
} //namespace olive
+1
View File
@@ -16,6 +16,7 @@
#ifndef MARKERCOPYPASTEWIDGET_H
#define MARKERCOPYPASTEWIDGET_H
#include <QWidget>
#include <QUndoCommand>
#include "widget/marker/marker.h"