Commit 3f0ee4cb authored by Sashmita Raghav's avatar Sashmita Raghav

Connect Subtitle Model signals with respective slots

parent d7dfcab1
......@@ -84,6 +84,8 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, QString projectFolder, QUndoGroup *und
{
m_guideModel.reset(new MarkerListModel(m_commandStack, this));
connect(m_guideModel.get(), &MarkerListModel::modelChanged, this, &KdenliveDoc::guidesChanged);
m_subtitleModel.reset(new SubtitleModel (m_commandStack, this));
connect(m_subtitleModel.get(), &SubtitleModel::modelChanged, this, &KdenliveDoc::subtitlesChanged);
connect(this, SIGNAL(updateCompositionMode(int)), parent, SLOT(slotUpdateCompositeAction(int)));
bool success = false;
connect(m_commandStack.get(), &QUndoStack::indexChanged, this, &KdenliveDoc::slotModified);
......@@ -1296,6 +1298,7 @@ void KdenliveDoc::loadDocumentProperties()
if (pl.isNull()) {
return;
}
QMetaObject::invokeMethod(m_subtitleModel.get(), "parseSubtitle", Qt::QueuedConnection);
QDomNodeList props = pl.elementsByTagName(QStringLiteral("property"));
QString name;
QDomElement e;
......@@ -1776,4 +1779,10 @@ QString& KdenliveDoc::modifiedDecimalPoint() {
std::shared_ptr<SubtitleModel> KdenliveDoc::getSubtitleModel() const
{
return m_subtitleModel;
}
void KdenliveDoc::subtitlesChanged()
{
m_subtitleModel->parseSubtitle();
return;
}
\ No newline at end of file
......@@ -246,6 +246,7 @@ private slots:
void checkPreviewStack(int ix);
/** @brief Guides were changed, save to MLT. */
void guidesChanged();
void subtitlesChanged();
signals:
void resetProjectList();
......
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