timeline: avoid duplicate items or item dependencies when pasting

God damn this was a big oof. Pasting was inadvertently making duplicates of the footage node(s) every single time. Worst case was if the clip was connected to a nested sequence. Every time someone copy/pasted in my large-scale project, it would add another 1000 nodes to the project. It's about fucking time this was fixed.
This commit is contained in:
itsmattkc
2023-02-28 22:28:32 -08:00
parent 43e4e78378
commit 066a10e6a0
5 changed files with 108 additions and 13 deletions
+2 -2
View File
@@ -136,7 +136,7 @@ ProjectSerializer::Result ProjectSerializer::Load(Project *project, QXmlStreamRe
return res;
}
ProjectSerializer::Result ProjectSerializer::Paste(LoadType load_type)
ProjectSerializer::Result ProjectSerializer::Paste(LoadType load_type, Project *project)
{
QString clipboard = Core::PasteStringFromClipboard();
if (clipboard.isEmpty()) {
@@ -145,7 +145,7 @@ ProjectSerializer::Result ProjectSerializer::Paste(LoadType load_type)
QXmlStreamReader reader(clipboard);
return ProjectSerializer::Load(nullptr, &reader, load_type);
return ProjectSerializer::Load(project, &reader, load_type);
}
ProjectSerializer::Result ProjectSerializer::Save(const SaveData &data, bool compress)