-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for project loading progress display #3672
Changes from 2 commits
f76cb6f
aee0f2b
cf90bb7
c1d24df
135f65c
097feb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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()){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() ) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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..." ) ); | ||
|
@@ -102,8 +102,6 @@ void TrackContainer::loadSettings( const QDomElement & _this ) | |
else | ||
{ | ||
start_val = pd->value(); | ||
pd->setMaximum( pd->maximum() + | ||
_this.childNodes().count() ); | ||
} | ||
} | ||
|
||
|
@@ -124,6 +122,9 @@ 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" ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 125 and 126 too long lines. The coding conventions suggestion for ternary operators is something like this:
|
||
pd->setLabelText( tr("Loading Track %1 (%2/Total %3)").arg( trackName ).arg( pd->value() ).arg( Engine::getSong()->getLoadingTrackCount() ) ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It crashes here on command line render. If you wrap it in an
that should fix it. Also. The line is much too long and wraps badly. Please try and use more lines. |
||
Track::create( node.toElement(), this ); | ||
} | ||
node = node.nextSibling(); | ||
|
There was a problem hiding this comment.
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.