From ed6f4eed3e2eaed2d56983ee63f7492d9a837904 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sun, 22 Nov 2020 22:32:09 +1100 Subject: [PATCH] core: changed ortho node ID Fixes collision where transform and ortho nodes had the same ID. Renames ortho ID and automatically corrects old projects with the old ID. Bumps the project version as a result. --- app/core.cpp | 2 +- app/node/generator/matrix/matrix.cpp | 2 +- app/project/item/sequence/sequence.cpp | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/core.cpp b/app/core.cpp index 0d545f41f..c2b3b7860 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -71,7 +71,7 @@ namespace olive { Core* Core::instance_ = nullptr; -const uint Core::kProjectVersion = 201118; +const uint Core::kProjectVersion = 201122; Core::Core(const CoreParams& params) : main_window_(nullptr), diff --git a/app/node/generator/matrix/matrix.cpp b/app/node/generator/matrix/matrix.cpp index ec4ee6997..6f57a0bde 100644 --- a/app/node/generator/matrix/matrix.cpp +++ b/app/node/generator/matrix/matrix.cpp @@ -66,7 +66,7 @@ QString MatrixGenerator::ShortName() const QString MatrixGenerator::id() const { - return QStringLiteral("org.olivevideoeditor.Olive.transform"); + return QStringLiteral("org.olivevideoeditor.Olive.ortho"); } QVector MatrixGenerator::Category() const diff --git a/app/project/item/sequence/sequence.cpp b/app/project/item/sequence/sequence.cpp index d0a6d58c6..a24d93b85 100644 --- a/app/project/item/sequence/sequence.cpp +++ b/app/project/item/sequence/sequence.cpp @@ -139,6 +139,14 @@ void Sequence::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, uint v } } + if (version <= 201118) { + // After version 201118, the orthographic matrix node ID was changed from + // "org.olivevideoeditor.Olive.transform" to "org.olivevideoeditor.Olive.ortho" + if (id == QStringLiteral("org.olivevideoeditor.Olive.transform")) { + id = QStringLiteral("org.olivevideoeditor.Olive.ortho"); + } + } + node = NodeFactory::CreateFromID(id); break; }