timeline/project: block serializations to and from xml now include links
Fixes issue where blocks would become unlinked after copy/paste or save/load.
This commit is contained in:
@@ -198,6 +198,22 @@ rational Block::MediaToSequenceTime(const rational &media_time) const
|
||||
return (media_time - media_in()) / speed() + in();
|
||||
}
|
||||
|
||||
void Block::LoadInternal(QXmlStreamReader *reader, XMLNodeData &xml_node_data)
|
||||
{
|
||||
if (reader->name() == QStringLiteral("link")) {
|
||||
xml_node_data.block_links.append({this, reader->readElementText().toULongLong()});
|
||||
} else {
|
||||
Node::LoadInternal(reader, xml_node_data);
|
||||
}
|
||||
}
|
||||
|
||||
void Block::SaveInternal(QXmlStreamWriter *writer) const
|
||||
{
|
||||
foreach (Block* link, linked_clips_) {
|
||||
writer->writeTextElement(QStringLiteral("link"), QString::number(reinterpret_cast<quintptr>(link)));
|
||||
}
|
||||
}
|
||||
|
||||
void Block::LengthInputChanged()
|
||||
{
|
||||
emit LengthChanged(length());
|
||||
|
||||
Reference in New Issue
Block a user