fixed regression from switching folder from outputs to inputs

This commit is contained in:
itsmattkc
2021-03-14 21:51:47 +11:00
parent 2a9513e56a
commit fd6319b837
6 changed files with 22 additions and 19 deletions
+1 -1
View File
@@ -1293,7 +1293,7 @@ void Core::CacheActiveSequence(bool in_out_only)
bool Core::ValidateFootageInLoadedProject(Project* project, const QString& project_saved_url)
{
QVector<Footage*> project_footage = project->root()->ListOutputsOfType<Footage>();
QVector<Footage*> project_footage = project->root()->ListChildrenOfType<Footage>();
QVector<Footage*> footage_we_couldnt_validate;
foreach (Footage* footage, project_footage) {
+16 -13
View File
@@ -88,19 +88,6 @@ public:
return true;
}
/**
* @brief Returns a list of nodes that are of a certain type that this node outputs to
*/
template <typename T>
QVector<T*> ListOutputsOfType(bool recursive = true) const
{
QVector<T *> list;
ListOutputsOfTypeInternal(this, list, recursive);
return list;
}
int index_of_child(Node* item) const
{
return item_children_.indexOf(item);
@@ -108,6 +95,22 @@ public:
int index_of_child_in_array(Node* item) const;
template <typename T>
QVector<T*> ListChildrenOfType() const
{
QVector<T*> list;
foreach (Node* node, item_children_) {
T* cast_test = dynamic_cast<T*>(node);
if (cast_test) {
list.append(cast_test);
}
}
return list;
}
static const QString kChildInput;
signals:
+1 -1
View File
@@ -283,7 +283,7 @@ void Project::ColorManagerValueChanged(const NodeInput &input, const TimeRange &
{
Q_UNUSED(range)
QVector<Footage*> footage = root()->ListOutputsOfType<Footage>();
QVector<Footage*> footage = root()->ListChildrenOfType<Footage>();
foreach (Footage* item, footage) {
item->InvalidateAll(QString());
+1 -1
View File
@@ -38,7 +38,7 @@ SaveOTIOTask::SaveOTIOTask(Project *project) :
bool SaveOTIOTask::Run()
{
QVector<Sequence*> sequences = project_->root()->ListOutputsOfType<Sequence>();
QVector<Sequence*> sequences = project_->root()->ListChildrenOfType<Sequence>();
if (sequences.isEmpty()) {
SetError(tr("Project contains no sequences to export."));
@@ -319,7 +319,7 @@ void ProjectExplorer::ShowContextMenu()
Menu* proxy_menu = new Menu(tr("Pre-Cache"), &menu);
menu.addMenu(proxy_menu);
QVector<Sequence*> sequences = project()->root()->ListOutputsOfType<Sequence>();
QVector<Sequence*> sequences = project()->root()->ListChildrenOfType<Sequence>();
if (sequences.isEmpty()) {
QAction* a = proxy_menu->addAction(tr("No sequences exist in project"));
+2 -2
View File
@@ -329,7 +329,7 @@ void MainWindow::ProjectOpen(Project *p)
void MainWindow::ProjectClose(Project *p)
{
// Close any open sequences from project
QVector<Sequence*> open_sequences = p->root()->ListOutputsOfType<Sequence>();
QVector<Sequence*> open_sequences = p->root()->ListChildrenOfType<Sequence>();
foreach (Sequence* seq, open_sequences) {
if (IsSequenceOpen(seq)) {
@@ -338,7 +338,7 @@ void MainWindow::ProjectClose(Project *p)
}
// Close any open footage in footage viewer
QVector<Footage*> footage_in_project = p->root()->ListOutputsOfType<Footage>();
QVector<Footage*> footage_in_project = p->root()->ListChildrenOfType<Footage>();
QVector<Footage*> footage_in_viewer = footage_viewer_panel_->GetSelectedFootage();
if (!footage_in_viewer.isEmpty()) {