Add Delete functionality. Still buggy.

This commit is contained in:
Thomas Wilshaw
2020-09-29 00:06:38 +01:00
parent 602f96b2b6
commit 92db735022
3 changed files with 76 additions and 0 deletions
@@ -37,6 +37,7 @@
#include "widget/menu/menu.h"
#include "widget/menu/menushared.h"
#include "window/mainwindow/mainwindow.h"
#include "widget/timelinewidget/timelinewidget.h"
OLIVE_NAMESPACE_ENTER
@@ -633,6 +634,24 @@ void ProjectExplorer::DeleteSelected()
// Get all sequences.
QList<ItemPtr> sequences = model_.project()->get_items_of_type(Item::kSequence);
QList<Block*> blocks;
foreach(ItemPtr seq, sequences) {
Sequence* s = static_cast<Sequence*>(seq.get());
// Loop through nodes in sequence
foreach(Node* node, s->nodes()) {
// For each Block see if it is linked to one of the Footage nodes add it to the delete list
if (node->IsBlock()) {
foreach(Node* input, nodes.keys()) {
if(node->GetExclusiveDependencies().contains(input))
blocks.append(static_cast<Block*>(node));
}
}
}
}
new ProjectViewModel::DeleteFootageCommand(&model_, item_ptr, blocks, command);
}
if (response == kCancel) {
delete command;