fixed various issues with threading
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user