diff --git a/include/Song.h b/include/Song.h index ad644ed9f09..be7f9e5085c 100644 --- a/include/Song.h +++ b/include/Song.h @@ -97,6 +97,10 @@ class EXPORT Song : public TrackContainer void processNextBuffer(); + inline int getLoadingTrackCount() const + { + return m_nLoadingTrack; + } inline int getMilliseconds() const { return m_elapsedMilliSeconds; @@ -339,6 +343,7 @@ private slots: ControllerVector m_controllers; + int m_nLoadingTrack; QString m_fileName; QString m_oldFileName; diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 0732fd1d36e..af359a88159 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -1054,6 +1054,27 @@ void Song::loadProject( const QString & fileName ) } node = dataFile.content().firstChild(); + + QDomNodeList tclist=dataFile.content().elementsByTagName("trackcontainer"); + m_nLoadingTrack=0; + for( int i=0,n=tclist.count(); igetLoadingTrackCount(), gui->mainWindow() ); pd->setWindowModality( Qt::ApplicationModal ); pd->setWindowTitle( tr( "Please wait..." ) ); pd->show(); } - else - { - start_val = pd->value(); - pd->setMaximum( pd->maximum() + - _this.childNodes().count() ); - } } QDomNode node = _this.firstChild(); @@ -124,6 +117,14 @@ void TrackContainer::loadSettings( const QDomElement & _this ) if( node.isElement() && !node.toElement().attribute( "metadata" ).toInt() ) { + QString trackName = node.toElement().hasAttribute( "name" ) ? + node.toElement().attribute( "name" ) : + node.firstChild().toElement().attribute( "name" ); + if( pd != NULL ) + { + pd->setLabelText( tr("Loading Track %1 (%2/Total %3)").arg( trackName ). + arg( pd->value() + 1 ).arg( Engine::getSong()->getLoadingTrackCount() ) ); + } Track::create( node.toElement(), this ); } node = node.nextSibling(); @@ -131,7 +132,6 @@ void TrackContainer::loadSettings( const QDomElement & _this ) if( pd != NULL ) { - pd->setValue( start_val + _this.childNodes().count() ); if( was_null ) { delete pd;