[vlmc-devel] commit: Project loading: Simplification. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Jul 30 00:38:29 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Jul 30 00:38:36 2010 +0200| [2bf587b45681bb73fed2b3a2bae1a6d6aa75ec97] | committer: Hugo Beauzée-Luyssen 

Project loading: Simplification.

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

 src/Gui/timeline/Timeline.cpp     |    8 ++++----
 src/Library/Library.cpp           |    4 ++--
 src/Library/MediaContainer.cpp    |    6 +++---
 src/Renderer/WorkflowRenderer.cpp |    2 +-
 src/Settings/SettingsManager.cpp  |    4 ++--
 src/Workflow/MainWorkflow.cpp     |   10 +++++-----
 6 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/Gui/timeline/Timeline.cpp b/src/Gui/timeline/Timeline.cpp
index 31b46d5..dfdaf11 100644
--- a/src/Gui/timeline/Timeline.cpp
+++ b/src/Gui/timeline/Timeline.cpp
@@ -219,7 +219,7 @@ Timeline::load( const QDomElement &root )
         return ;
     }
 
-    QDomElement elem = project.firstChild().toElement();
+    QDomElement elem = project.firstChildElement();
     while ( elem.isNull() == false )
     {
         QString uuid = elem.attribute( "uuid" );
@@ -235,20 +235,20 @@ Timeline::load( const QDomElement &root )
             QDomElement links = elem.firstChildElement( "linkedTo" );
             if ( links.isNull() == false )
             {
-                QDomElement linkedItem = links.firstChild().toElement();
+                QDomElement linkedItem = links.firstChildElement();
                 while ( linkedItem.isNull() == false )
                 {
                     QString     linkedUuid = linkedItem.attribute( "uuid" );
                     AbstractGraphicsMediaItem   *li = tracksView()->item( linkedUuid );
                     if ( li != NULL )
                         item->group( li );
-                    linkedItem = linkedItem.nextSibling().toElement();
+                    linkedItem = linkedItem.nextSiblingElement();
                 }
             }
         }
         else
             qWarning() << "No such timeline item:" << uuid;
-        elem = elem.nextSibling().toElement();
+        elem = elem.nextSiblingElement();
     }
 }
 
diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index a88a3f7..b4dcd1f 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -54,7 +54,7 @@ Library::loadProject( const QDomElement& doc )
     //Add a virtual media, which represents all the clip.
     //This avoid emitting projectLoaded(); before all the clip are actually loaded.
     m_nbMediaToLoad = 1;
-    QDomElement media = medias.firstChild().toElement();
+    QDomElement media = medias.firstChildElement();
     while ( media.isNull() == false )
     {
         if ( media.hasAttribute( "mrl" ) == true )
@@ -74,7 +74,7 @@ Library::loadProject( const QDomElement& doc )
             m_medias[mrl] = m;
             m_nbMediaToLoad.fetchAndAddAcquire( 1 );
         }
-        media = media.nextSibling().toElement();
+        media = media.nextSiblingElement();
     }
     const QDomElement   clips = doc.firstChildElement( "clips" );
     if ( clips.isNull() == true )
diff --git a/src/Library/MediaContainer.cpp b/src/Library/MediaContainer.cpp
index fcd003f..6dc55c5 100644
--- a/src/Library/MediaContainer.cpp
+++ b/src/Library/MediaContainer.cpp
@@ -193,7 +193,7 @@ MediaContainer::save( QXmlStreamWriter &project )
 void
 MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
 {
-    QDomElement clip = clips.firstChild().toElement();
+    QDomElement clip = clips.firstChildElement();
 
     while ( clip.isNull() == false )
     {
@@ -219,7 +219,7 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
             else
             {
                 qWarning() << "Can't find parent media:" << media;
-                clip = clip.nextSibling().toElement();
+                clip = clip.nextSiblingElement();
                 continue ;
             }
         }
@@ -242,6 +242,6 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
         QDomElement subClips = clip.firstChildElement( "subClips" );
         if ( subClips.isNull() == false )
             c->getChilds()->load( subClips, this );
-        clip = clip.nextSibling().toElement();
+        clip = clip.nextSiblingElement();
     }
 }
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 5d19693..bb6ddce 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -432,7 +432,7 @@ WorkflowRenderer::loadProject( const QDomElement &project )
             else
                 qCritical() << "Renderer: Can't load effect" << effect.attribute( "name" );
         }
-        effect = effect.nextSibling().toElement();
+        effect = effect.nextSiblingElement();
     }
 }
 
diff --git a/src/Settings/SettingsManager.cpp b/src/Settings/SettingsManager.cpp
index 6f955a2..4b00f9f 100644
--- a/src/Settings/SettingsManager.cpp
+++ b/src/Settings/SettingsManager.cpp
@@ -212,7 +212,7 @@ SettingsManager::load( const QDomElement &root )
         return false ;
     }
     QWriteLocker    wLock( &m_rwLock );
-    QDomElement s = element.firstChild().toElement();
+    QDomElement s = element.firstChildElement();
     while ( s.isNull() == false )
     {
         QString     key = s.attribute( "key" );
@@ -222,7 +222,7 @@ SettingsManager::load( const QDomElement &root )
             qWarning() << "Invalid setting node.";
         else
             setValue( key, value, SettingsManager::Project );
-        s = s.nextSibling().toElement();
+        s = s.nextSiblingElement();
     }
     return true;
 }
diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index b0f8b90..1e12525 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -296,7 +296,7 @@ MainWorkflow::loadProject( const QDomElement &root )
     if ( project.isNull() == true )
         return ;
 
-    QDomElement elem = project.firstChild().toElement();
+    QDomElement elem = project.firstChildElement();
 
     while ( elem.isNull() == false )
     {
@@ -317,7 +317,7 @@ MainWorkflow::loadProject( const QDomElement &root )
         }
         type = static_cast<MainWorkflow::TrackType>( utype );
 
-        QDomElement clip = elem.firstChild().toElement();
+        QDomElement clip = elem.firstChildElement();
         while ( clip.isNull() == false )
         {
             //Iterate over clip fields:
@@ -363,13 +363,13 @@ MainWorkflow::loadProject( const QDomElement &root )
                         else
                             qCritical() << "Workflow: Can't load effect" << effect.attribute( "name" );
                     }
-                    effect = effect.nextSibling().toElement();
+                    effect = effect.nextSiblingElement();
                 }
             }
 
-            clip = clip.nextSibling().toElement();
+            clip = clip.nextSiblingElement();
         }
-        elem = elem.nextSibling().toElement();
+        elem = elem.nextSiblingElement();
     }
 }
 



More information about the Vlmc-devel mailing list