Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix resetting all preview zones. Fixes #56

parent 1205b31c
Pipeline #2158 passed with stage
in 16 minutes and 27 seconds
......@@ -1622,7 +1622,7 @@ void MainWindow::slotEditProjectSettings()
modified = true;
project->setDocumentProperty(QStringLiteral("previewparameters"), w->previewParams());
project->setDocumentProperty(QStringLiteral("previewextension"), w->previewExtension());
slotClearPreviewRender();
slotClearPreviewRender(false);
}
if (project->getDocumentProperty(QStringLiteral("proxyparams")) != w->proxyParams() ||
project->getDocumentProperty(QStringLiteral("proxyextension")) != w->proxyExtension()) {
......@@ -2487,10 +2487,10 @@ void MainWindow::slotRemovePreviewRender()
}
}
void MainWindow::slotClearPreviewRender()
void MainWindow::slotClearPreviewRender(bool resetZones)
{
if (pCore->currentDoc()) {
getCurrentTimeline()->controller()->clearPreviewRange();
getCurrentTimeline()->controller()->clearPreviewRange(resetZones);
}
}
......
......@@ -337,7 +337,7 @@ private slots:
void slotStopPreviewRender();
void slotDefinePreviewRender();
void slotRemovePreviewRender();
void slotClearPreviewRender();
void slotClearPreviewRender(bool resetZones = true);
void slotSelectTimelineClip();
void slotSelectTimelineTransition();
void slotDeselectTimelineClip();
......
......@@ -374,7 +374,7 @@ void PreviewManager::doCleanupOldPreviews()
}
}
void PreviewManager::clearPreviewRange()
void PreviewManager::clearPreviewRange(bool resetZones)
{
m_previewGatherTimer.stop();
abortRendering();
......@@ -382,6 +382,7 @@ void PreviewManager::clearPreviewRange()
bool hasPreview = m_previewTrack != nullptr;
for (const auto &ix : m_renderedChunks) {
m_cacheDir.remove(QStringLiteral("%1.%2").arg(ix.toInt()).arg(m_extension));
m_dirtyChunks << ix;
if (!hasPreview) {
continue;
}
......@@ -398,7 +399,11 @@ void PreviewManager::clearPreviewRange()
m_renderedChunks.clear();
// Reload preview params
loadParams();
if (resetZones) {
m_dirtyChunks.clear();
}
m_controller->renderedChunksChanged();
m_controller->dirtyChunksChanged();
}
void PreviewManager::addPreviewRange(const QPoint zone, bool add)
......
......@@ -65,7 +65,7 @@ public:
/** @brief: user adds current timeline zone to the preview zone. */
void addPreviewRange(const QPoint zone, bool add);
/** @brief: Remove all existing previews. */
void clearPreviewRange();
void clearPreviewRange(bool resetZones);
/** @brief: stops current rendering process. */
void abortRendering();
/** @brief: rendering parameters have changed, reload them. */
......
......@@ -1041,10 +1041,10 @@ void TimelineController::addPreviewRange(bool add)
}
}
void TimelineController::clearPreviewRange()
void TimelineController::clearPreviewRange(bool resetZones)
{
if (m_timelinePreview) {
m_timelinePreview->clearPreviewRange();
m_timelinePreview->clearPreviewRange(resetZones);
}
}
......@@ -1150,7 +1150,7 @@ bool TimelineController::useRuler() const
void TimelineController::resetPreview()
{
if (m_timelinePreview) {
m_timelinePreview->clearPreviewRange();
m_timelinePreview->clearPreviewRange(true);
initializePreview();
}
}
......
......@@ -376,7 +376,7 @@ public:
void addPreviewRange(bool add);
/* @brief Clear current timeline zone from preview rendering
*/
void clearPreviewRange();
void clearPreviewRange(bool resetZones);
void startPreviewRender();
void stopPreviewRender();
QVariantList dirtyChunks() const;
......
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