Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/Song.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -339,6 +343,7 @@ private slots:

ControllerVector m_controllers;

int m_nLoadingTrack;

QString m_fileName;
QString m_oldFileName;
Expand Down
17 changes: 17 additions & 0 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,23 @@ 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(); i<n; ++i ){
QDomNode nd=tclist.at(i).firstChild();
while(!nd.isNull()){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the general idea is to put the braces on the same column/tab although I'm not 100% sure about the convention around this.


( .. )
{
  this
}

( .. ){
  not this
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also {

if( nd.isElement() && nd.nodeName() == "track" )
{
++m_nLoadingTrack;
if( nd.toElement().attribute("type").toInt() == Track::BBTrack ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here {

n += nd.toElement().elementsByTagName("bbtrack").at(0).toElement().firstChildElement().childNodes().count();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit too long line here.

}
nd=nd.nextSibling();
}
}
}

while( !node.isNull() )
{
if( node.isElement() )
Expand Down
4 changes: 1 addition & 3 deletions src/core/TrackContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void TrackContainer::loadSettings( const QDomElement & _this )
{
pd = new QProgressDialog( tr( "Loading project..." ),
tr( "Cancel" ), 0,
_this.childNodes().count(),
Engine::getSong()->getLoadingTrackCount(),
gui->mainWindow() );
pd->setWindowModality( Qt::ApplicationModal );
pd->setWindowTitle( tr( "Please wait..." ) );
Expand All @@ -102,8 +102,6 @@ void TrackContainer::loadSettings( const QDomElement & _this )
else
{
start_val = pd->value();
pd->setMaximum( pd->maximum() +
_this.childNodes().count() );
}
}

Expand Down