]> git.sesse.net Git - kdenlive/blobdiff - src/trackview.cpp
Ask to change profile if first clip does not match project profile:
[kdenlive] / src / trackview.cpp
index 0e8a8c1857a34ac05f0c98ce3c9b4e2e837c9148..cb255cd597aa53de893d4c7b248e27b839066820 100644 (file)
@@ -117,7 +117,7 @@ TrackView::TrackView(KdenliveDoc *doc, bool *ok, QWidget *parent) :
     connect(m_trackview, SIGNAL(doTrackLock(int, bool)), this, SLOT(slotChangeTrackLock(int, bool)));
 
     slotChangeZoom(m_doc->zoom().x(), m_doc->zoom().y());
-    slotSetZone(m_doc->zone());
+    slotSetZone(m_doc->zone(), false);
 }
 
 TrackView::~TrackView()
@@ -173,9 +173,10 @@ int TrackView::outPoint() const
     return m_ruler->outPoint();
 }
 
-void TrackView::slotSetZone(QPoint p)
+void TrackView::slotSetZone(QPoint p, bool updateDocumentProperties)
 {
     m_ruler->setZone(p);
+    if (updateDocumentProperties) m_doc->setZone(p.x(), p.y());
 }
 
 void TrackView::setDuration(int dur)
@@ -833,8 +834,8 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
                             if (e.attribute("type") == "simplekeyframe") {
                                 QStringList kfrs = paramvalue.split(";");
                                 for (int l = 0; l < kfrs.count(); l++) {
-                                    QString fr = kfrs.at(l).section("=", 0, 0);
-                                    double val = kfrs.at(l).section("=", 1, 1).toDouble();
+                                    QString fr = kfrs.at(l).section('=', 0, 0);
+                                    double val = kfrs.at(l).section('=', 1, 1).toDouble();
                                     kfrs[l] = fr + ":" + QString::number((int)(val * fact));
                                 }
                                 e.setAttribute("keyframes", kfrs.join(";"));
@@ -991,7 +992,7 @@ void TrackView::slotShowTrackEffects(int ix)
 void TrackView::slotUpdateTrackEffectState(int ix)
 {
     QList<HeaderTrack *> widgets = findChildren<HeaderTrack *>();
-    if (ix >= widgets.count()) {
+    if (ix < 0 || ix >= widgets.count()) {
         kDebug() << "ERROR, Trying to access a non existant track: " << ix;
         return;
     }