[vlmc-devel] Workflow: Don't save all tracks including ones that have no clips

Yikai Lu git at videolan.org
Sat Jul 23 17:45:16 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Jul 24 00:43:52 2016 +0900| [8091060d81c62dbc259bb10f8e8c78d6bf09c11f] | committer: Yikai Lu

Workflow: Don't save all tracks including ones that have no clips

> https://code.videolan.org/videolan/vlmc/commit/8091060d81c62dbc259bb10f8e8c78d6bf09c11f
---

 src/Workflow/MainWorkflow.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index 3b6b0a1..0a8348a 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -361,9 +361,14 @@ MainWorkflow::canRender()
 void
 MainWorkflow::preSave()
 {
+    int maxTrackId = 0;
+    for ( auto it = m_clips.cbegin(); it != m_clips.cend(); ++it )
+        maxTrackId = qMax( it.key(), maxTrackId );
+
     QVariantList l;
-    for ( auto track : m_tracks )
-        l << track->toVariant();
+    for ( int i = 0; i < maxTrackId + 1; ++i )
+        l << m_tracks[i]->toVariant();
+
     m_settings->value( "tracks" )->set( l );
 }
 



More information about the Vlmc-devel mailing list