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:
@@ -1351,6 +1351,10 @@ bool Node::Load(QXmlStreamReader *reader, SerializedData *data)
|
||||
}
|
||||
}
|
||||
|
||||
// Translate IDs renamed after older project files were
|
||||
// written
|
||||
param_id = GetInputIDForLegacyID(param_id);
|
||||
|
||||
QString output_node_id;
|
||||
|
||||
while (XMLReadNextStartElement(reader)) {
|
||||
@@ -1573,6 +1577,11 @@ void Node::PostLoadEvent(SerializedData *data)
|
||||
}
|
||||
}
|
||||
|
||||
QString Node::GetInputIDForLegacyID(const QString &id) const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
bool Node::LoadInput(QXmlStreamReader *reader, SerializedData *data)
|
||||
{
|
||||
if (dynamic_cast<NodeGroup *>(this)) {
|
||||
@@ -1598,6 +1607,9 @@ bool Node::LoadInput(QXmlStreamReader *reader, SerializedData *data)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Translate IDs renamed after older project files were written
|
||||
param_id = GetInputIDForLegacyID(param_id);
|
||||
|
||||
if (!this->HasInputWithID(param_id)) {
|
||||
qWarning() << "Failed to load parameter that didn't exist:" << param_id;
|
||||
reader->skipCurrentElement();
|
||||
|
||||
Reference in New Issue
Block a user