Commit 2bf587b4 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Project loading: Simplification.

parent 60046966
......@@ -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();
}
}
......
......@@ -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 )
......
......@@ -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();
}
}
......@@ -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();
}
}
......
......@@ -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;
}
......
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment