restrict backwards compat option to old projects only
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
namespace olive {
|
||||
|
||||
void XMLConnectNodes(const XMLNodeData &xml_node_data, MultiUndoCommand *command)
|
||||
void XMLConnectNodes(const XMLNodeData &xml_node_data, uint version, MultiUndoCommand *command)
|
||||
{
|
||||
foreach (const XMLNodeData::SerializedConnection& con, xml_node_data.desired_connections) {
|
||||
Node *out = xml_node_data.node_ptrs.value(con.output_node);
|
||||
@@ -39,13 +39,17 @@ void XMLConnectNodes(const XMLNodeData &xml_node_data, MultiUndoCommand *command
|
||||
if (command) {
|
||||
command->add_child(new NodeEdgeAddCommand(out, con.input));
|
||||
|
||||
/// Deprecated: backwards compatibility only
|
||||
command->add_child(new NodeSetValueHintCommand(con.input, hint));
|
||||
if (version < 210907) {
|
||||
/// Deprecated: backwards compatibility only
|
||||
command->add_child(new NodeSetValueHintCommand(con.input, hint));
|
||||
}
|
||||
} else {
|
||||
Node::ConnectEdge(out, con.input);
|
||||
|
||||
/// Deprecated: backwards compatibility only
|
||||
con.input.node()->SetValueHintForInput(con.input.input(), hint, con.input.element());
|
||||
if (version < 210907) {
|
||||
/// Deprecated: backwards compatibility only
|
||||
con.input.node()->SetValueHintForInput(con.input.input(), hint, con.input.element());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ struct XMLNodeData {
|
||||
|
||||
};
|
||||
|
||||
void XMLConnectNodes(const XMLNodeData& xml_node_data, MultiUndoCommand *command = nullptr);
|
||||
void XMLConnectNodes(const XMLNodeData& xml_node_data, uint version, MultiUndoCommand *command = nullptr);
|
||||
|
||||
/**
|
||||
* @brief Workaround for QXmlStreamReader::readNextStartElement not detecting the end of a document
|
||||
|
||||
@@ -206,7 +206,7 @@ QVector<Node *> NodeCopyPasteService::PasteNodesFromClipboard(NodeGraph *graph,
|
||||
|
||||
// Make connections
|
||||
if (!xml_node_data.desired_connections.isEmpty()) {
|
||||
XMLConnectNodes(xml_node_data, command);
|
||||
XMLConnectNodes(xml_node_data, data_version, command);
|
||||
}
|
||||
|
||||
// Link blocks
|
||||
|
||||
@@ -196,7 +196,7 @@ void Project::Load(QXmlStreamReader *reader, MainWindowLayoutInfo* layout, uint
|
||||
}
|
||||
|
||||
// Make connections
|
||||
XMLConnectNodes(xml_node_data);
|
||||
XMLConnectNodes(xml_node_data, version);
|
||||
|
||||
// Link blocks
|
||||
XMLLinkBlocks(xml_node_data);
|
||||
|
||||
Reference in New Issue
Block a user