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 loading of bin thumbnails on project opening

parent 6d0d0887
......@@ -310,25 +310,13 @@ Mlt::Producer *KdenliveDoc::getProjectProducer()
return new Mlt::Producer(pCore->getCurrentProfile()->profile(), "xml-string", m_document.toString().toUtf8().constData());
}
int KdenliveDoc::setSceneList()
void KdenliveDoc::loadThumbs()
{
// m_render->resetProfile(m_profile);
pCore->bin()->isLoading = true;
pCore->producerQueue()->abortOperations();
/*if (m_render->setSceneList(m_document.toString(), m_documentProperties.value(QStringLiteral("position")).toInt()) == -1) {
// INVALID MLT Consumer, something is wrong
return -1;
}*/
pCore->bin()->isLoading = false;
bool ok = false;
QDir thumbsFolder = getCacheDir(CacheThumbs, &ok);
if (ok) {
pCore->binController()->checkThumbnails(thumbsFolder);
}
m_documentProperties.remove(QStringLiteral("position"));
pCore->monitorManager()->activateMonitor(Kdenlive::ClipMonitor, true);
return 0;
}
QDomDocument KdenliveDoc::createEmptyDocument(int videotracks, int audiotracks)
......
......@@ -117,7 +117,6 @@ public:
void setProjectFolder(const QUrl &url);
void setZone(int start, int end);
QPoint zone() const;
int setSceneList();
void setDocumentProperty(const QString &name, const QString &value);
const QString getDocumentProperty(const QString &name, const QString &defaultValue = QString()) const;
......@@ -171,6 +170,8 @@ public:
/** @brief Edit timeline guide */
void addGuides(QList<CommentedTime> &markers);
/** @brief Load bin thumbnails after document opening */
void loadThumbs();
// TODO REFAC: delete */
Render *renderer();
......
......@@ -863,6 +863,7 @@ void ProjectManager::slotMoveFinished(KJob *job)
void ProjectManager::updateTimeline(Mlt::Tractor tractor)
{
pCore->producerQueue()->abortOperations();
pCore->binController()->loadBinPlaylist(tractor);
const QStringList ids = pCore->binController()->getClipIds();
for (const QString &id : ids) {
......@@ -883,6 +884,7 @@ void ProjectManager::updateTimeline(Mlt::Tractor tractor)
// TODO this is for testing purposes, remove.
m_project->getGuideModel()->addMarker(GenTime(10.), "Guide 1", 0);
m_project->getGuideModel()->addMarker(GenTime(15.), "Guide 2", 2);
m_project->loadThumbs();
pCore->monitorManager()->projectMonitor()->setProducer(m_mainTimelineModel->producer());
pCore->window()->getMainTimeline()->setModel(m_mainTimelineModel);
......
......@@ -89,11 +89,11 @@ Timeline::Timeline(KdenliveDoc *doc, const QList<QAction *> &actions, const QLis
m_scene = new CustomTrackScene(this);
m_trackview = new CustomTrackView(doc, this, m_scene, parent);
setFocusProxy(m_trackview);
if (m_doc->setSceneList() == -1) {
/*if (m_doc->setSceneList() == -1) {
*ok = false;
} else {
*ok = true;
}
}*/
Mlt::Service s(m_doc->renderer()->getProducer()->parent().get_service());
m_tractor = new Mlt::Tractor(s);
......
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