Commit b0f67182 authored by Sashmita Raghav's avatar Sashmita Raghav Committed by Jean-Baptiste Mardelle
Browse files

Delete all subtitles when subtitle track is collapsed

parent feb19c83
Pipeline #39738 passed with stage
in 12 minutes and 2 seconds
......@@ -1792,4 +1792,9 @@ void KdenliveDoc::initializeSubtitles(const std::shared_ptr<SubtitleModel> m_sub
connect(m_subtitleModel.get(), &SubtitleModel::modelChanged, this, &KdenliveDoc::subtitlesChanged);
m_subtitleModel->parseSubtitle();
//QMetaObject::invokeMethod(m_subtitle.get(), "parseSubtitle", Qt::QueuedConnection);
}
void KdenliveDoc::removeSubtitles()
{
m_subtitleModel->removeAllSubtitles();
}
\ No newline at end of file
......@@ -174,6 +174,8 @@ public:
std::shared_ptr<SubtitleModel> getSubtitleModel() const;
/** @brief Initialize and connect subtitle model */
void initializeSubtitles(const std::shared_ptr<SubtitleModel> m_subtitle);
/** @brief Delete all subtitles from subtitle model */
void removeSubtitles();
private:
QUrl m_url;
......
......@@ -4175,8 +4175,12 @@ void MainWindow::slotActivateTarget()
void MainWindow::slotEditSubtitle()
{
std::shared_ptr<SubtitleModel> m_subtitleModel;
m_subtitleModel.reset(new SubtitleModel(getMainTimeline()->controller()->tractor(),this));
pCore->currentDoc()->initializeSubtitles(m_subtitleModel);
if (!getMainTimeline()->showSubtitles) {
m_subtitleModel.reset(new SubtitleModel(getMainTimeline()->controller()->tractor(),this));
pCore->currentDoc()->initializeSubtitles(m_subtitleModel);
} else {
pCore->currentDoc()->removeSubtitles();
}
getMainTimeline()->connectSubtitleModel();
}
......
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