nodes: fix serialized ID typos with backward compatibility

- ChromaKey tolerance inputs are now spelled "upper/lower_tolerance_in";
  old projects with the misspelled "tolerence" IDs keep loading (values
  and connections) via a new Node::GetInputIDForLegacyID() hook applied
  in LoadInput and connection deserialization
- flip/ripple/swirl/tile/wave node IDs moved to the consistent
  org.olivevideoeditor.Olive.* domain; NodeFactory::CreateFromID maps
  the old org.oliveeditor.* IDs so old projects still resolve
- Regression tests: legacy ChromaKey IDs (values + connections) and
  legacy factory IDs
This commit is contained in:
2026-07-17 08:38:25 +08:00
parent 2aa921b215
commit bec52b46b3
13 changed files with 139 additions and 18 deletions
+33
View File
@@ -587,3 +587,36 @@ TEST(NodeFactory, CreateMenuRestrictedToCategory)
olive::NodeFactory::Destroy();
}
TEST(NodeFactory, LegacyDistortIdsResolveToRenamedNodes)
{
olive::NodeFactory::Initialize();
const QList<QPair<QString, QString>> legacy_ids = {
{ QStringLiteral("org.oliveeditor.Olive.flip"),
QStringLiteral("org.olivevideoeditor.Olive.flip") },
{ QStringLiteral("org.oliveeditor.Olive.ripple"),
QStringLiteral("org.olivevideoeditor.Olive.ripple") },
{ QStringLiteral("org.oliveeditor.Olive.swirl"),
QStringLiteral("org.olivevideoeditor.Olive.swirl") },
{ QStringLiteral("org.oliveeditor.Olive.tile"),
QStringLiteral("org.olivevideoeditor.Olive.tile") },
{ QStringLiteral("org.oliveeditor.Olive.wave"),
QStringLiteral("org.olivevideoeditor.Olive.wave") },
};
for (const auto &pair : legacy_ids) {
std::unique_ptr<olive::Node> node(
olive::NodeFactory::CreateFromID(pair.first));
ASSERT_NE(node, nullptr) << pair.first.toStdString();
EXPECT_EQ(node->id(), pair.second);
// The current id resolves directly as well
std::unique_ptr<olive::Node> current(
olive::NodeFactory::CreateFromID(pair.second));
ASSERT_NE(current, nullptr) << pair.second.toStdString();
EXPECT_EQ(current->id(), pair.second);
}
olive::NodeFactory::Destroy();
}