fixed various issues with threading

This commit is contained in:
itsmattkc
2019-01-15 22:01:51 +11:00
parent 13d30ab06a
commit e1ec2f6fbe
16 changed files with 339 additions and 115 deletions
+8 -4
View File
@@ -7,14 +7,19 @@
#include "debug.h"
ProjectModel::ProjectModel(QObject *parent) : QAbstractItemModel(parent), root_item(nullptr) {
root_item = new Media(0);
root_item->root = true;
make_root();
}
ProjectModel::~ProjectModel() {
destroy_root();
}
void ProjectModel::make_root() {
root_item = new Media(nullptr);
root_item->temp_id = 0;
root_item->root = true;
}
void ProjectModel::destroy_root() {
if (panel_sequence_viewer != nullptr) panel_sequence_viewer->viewer_widget->delete_function();
if (panel_footage_viewer != nullptr) panel_footage_viewer->viewer_widget->delete_function();
@@ -27,8 +32,7 @@ void ProjectModel::destroy_root() {
void ProjectModel::clear() {
beginResetModel();
destroy_root();
root_item = new Media(0);
root_item->root = true;
make_root();
endResetModel();
}