Don't delete timeline preview files on project close

parent 1900cc33
Pipeline #3393 passed with stage
in 20 minutes and 56 seconds
......@@ -240,6 +240,7 @@ bool ProjectManager::closeCurrentDocument(bool saveChanges, bool quit)
}
}
pCore->window()->getMainTimeline()->controller()->clipActions.clear();
pCore->window()->getMainTimeline()->controller()->prepareClose();
if (m_mainTimelineModel) {
m_mainTimelineModel->prepareClose();
}
......
......@@ -546,7 +546,6 @@ void PreviewManager::doPreviewRender(const QString &scene)
m_consumerParams.join(QLatin1Char(' '))};
qDebug() << " - - -STARTING PREVIEW JOBS: " << args;
pCore->currentDoc()->previewProgress(0);
m_previewProcess.start(m_renderer, args);
QObject::connect(&m_previewProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), [this, scene](int, QProcess::ExitStatus status) {
qDebug() << "// PROCESS IS FINISHED!!!";
QFile::remove(scene);
......@@ -565,6 +564,7 @@ void PreviewManager::doPreviewRender(const QString &scene)
workingPreview = -1;
m_controller->workingPreviewChanged();
});
m_previewProcess.start(m_renderer, args);
if (m_previewProcess.waitForStarted()) {
qDebug() << " - - -STARTING PREVIEW JOBS . . . STARTED";
}
......
......@@ -82,6 +82,12 @@ TimelineController::TimelineController(QObject *parent)
TimelineController::~TimelineController()
{
prepareClose();
}
void TimelineController::prepareClose()
{
// Delete timeline preview before resetting model so that removing clips from timeline doesn't invalidate
delete m_timelinePreview;
m_timelinePreview = nullptr;
}
......
......@@ -450,6 +450,8 @@ public:
QStringList getThumbKeys();
/** @brief Returns true if a drag operation is currently running in timeline */
bool dragOperationRunning();
/** @brief Disconnect some stuff before closing project */
void prepareClose();
public slots:
void resetView();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment