Commit f1076c4d authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Parser: Decrement the number of "todo" operations when aborting a parsing due to error

This fixes the progress not going up to 100%
parent 93018e76
......@@ -102,19 +102,27 @@ void Parser::updateStats()
void Parser::done( std::unique_ptr<parser::Task> t, parser::Task::Status status )
{
++m_opDone;
updateStats();
auto serviceIdx = ++t->currentService;
if ( status == parser::Task::Status::TemporaryUnavailable ||
status == parser::Task::Status::Fatal )
{
if ( serviceIdx < m_services.size() )
{
// We won't process the next tasks, so we need to keep the number of "todo" operations coherent:
m_opToDo -= m_services.size() - serviceIdx;
updateStats();
}
return;
}
updateStats();
if ( status == parser::Task::Status::Success )
{
m_notifier->notifyMediaModification( t->media );
}
auto serviceIdx = ++t->currentService;
if ( serviceIdx == m_services.size() )
{
t->file->markParsed();
......
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