[vlmc-devel] commit: Timeline: Don't force the color to black ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Jun 11 15:14:13 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Jun 11 15:14:15 2010 +0200| [7f1df5732a7e0a480001db227acc4769bdafe6c2] | committer: Hugo Beauzée-Luyssen 

Timeline: Don't force the color to black

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=7f1df5732a7e0a480001db227acc4769bdafe6c2
---

 src/Gui/timeline/Timeline.cpp |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/Gui/timeline/Timeline.cpp b/src/Gui/timeline/Timeline.cpp
index a404791..67ff14a 100644
--- a/src/Gui/timeline/Timeline.cpp
+++ b/src/Gui/timeline/Timeline.cpp
@@ -194,7 +194,8 @@ Timeline::save( QXmlStreamWriter &project ) const
             continue ;
         project.writeStartElement( "item" );
         project.writeAttribute( "uuid", item->clipHelper()->uuid().toString() );
-        project.writeAttribute( "color", item->itemColor().name() );
+        if ( item->itemColor().isValid() == true )
+            project.writeAttribute( "color", item->itemColor().name() );
         if ( item->groupItem() != NULL )
         {
             project.writeStartElement( "linkedTo" );
@@ -226,9 +227,11 @@ Timeline::load( const QDomElement &root )
         AbstractGraphicsMediaItem   *item = tracksView()->item( uuid );
         if ( item != NULL )
         {
-            QString     color = elem.attribute( "color" );
-            item->setColor( color );
-
+            if ( elem.hasAttribute( "color" ) == true )
+            {
+                QString     color = elem.attribute( "color" );
+                item->setColor( color );
+            }
             QDomElement links = elem.firstChildElement( "linkedTo" );
             if ( links.isNull() == false )
             {



More information about the Vlmc-devel mailing list