]> git.sesse.net Git - kdenlive/commitdiff
Fix timeline cursor position when opening a project
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 19 Nov 2012 19:24:15 +0000 (20:24 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 19 Nov 2012 19:24:15 +0000 (20:24 +0100)
src/mainwindow.cpp
src/trackview.cpp

index 78021b6c2d0c06b8d96bd2f308639af93f942012..f22a0e4412349016d55a043ffa039f8083b019eb 100644 (file)
@@ -2187,7 +2187,6 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
     }
     m_timelineArea->setTabToolTip(m_timelineArea->currentIndex(), doc->url().path());
     trackView->setDuration(trackView->duration());
-    trackView->projectView()->initCursorPos(m_projectMonitor->render->seekPosition().frames(doc->fps()));
 
     if (m_timelineArea->count() > 1) m_timelineArea->setTabBarHidden(false);
     slotGotProgressInfo(QString(), -1);
@@ -2577,7 +2576,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(trackView->projectView(), SIGNAL(forceClipProcessing(const QString &)), m_projectList, SLOT(slotForceProcessing(const QString &)));
 
     connect(trackView->projectView(), SIGNAL(importKeyframes(GRAPHICSRECTITEM, const QString&, int)), this, SLOT(slotProcessImportKeyframes(GRAPHICSRECTITEM, const QString&, int)));
-    
+
     connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
     connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
     connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), doc, SLOT(setModified()));
index b9df353dd99e288215eec4cbbd8c4cd7c8475ed8..e46a750b58f4e8b216f094429818b210de2aa381 100644 (file)
@@ -415,6 +415,12 @@ void TrackView::parseDocument(QDomDocument doc)
     }
     QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
 
+    QDomElement propsXml = infoXml.firstChildElement("documentproperties");
+    
+    int currentPos = propsXml.attribute("position").toInt();
+    if (currentPos > 0) m_trackview->initCursorPos(currentPos);
+    
+
     // Add guides
     QDomNodeList guides = infoXml.elementsByTagName("guide");
     for (int i = 0; i < guides.count(); i++) {