Working with progressbar very expensive. Trigger changing of status less

frequent.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-04-22 19:33:09 +03:00
parent 2c6c537d66
commit 58a2f42703

View File

@ -533,9 +533,7 @@ void VPattern::LiteParseIncrements()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int VPattern::ElementsToParse() const int VPattern::ElementsToParse() const
{ {
QVector<QString> tags({TagArc, TagDetail, TagElArc, TagLine, TagSpline, TagOperation, TagPath, TagPoint, QVector<QString> tags{TagCalculation, TagDetails, TagModeling, TagIncrements};
TagTools, TagIncrement
});
std::function<int (const QString &tagName)> TagsCount = [this](const QString &tagName) std::function<int (const QString &tagName)> TagsCount = [this](const QString &tagName)
{ {
@ -831,13 +829,13 @@ void VPattern::ParseDrawMode(const QDomNode &node, const Document &parse, const
VException e(tr("Wrong tag name '%1'.").arg(domElement.tagName())); VException e(tr("Wrong tag name '%1'.").arg(domElement.tagName()));
throw e; throw e;
} }
}
}
if (parse == Document::FullParse) if (parse == Document::FullParse)
{ {
emit MadeProgress(); emit MadeProgress();
} }
}
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -1113,16 +1111,16 @@ void VPattern::ParseDetails(const QDomElement &domElement, const Document &parse
if (domElement.tagName() == TagDetail) if (domElement.tagName() == TagDetail)
{ {
ParseDetailElement(domElement, parse); ParseDetailElement(domElement, parse);
if (parse == Document::FullParse)
{
emit MadeProgress();
}
} }
} }
} }
domNode = domNode.nextSibling(); domNode = domNode.nextSibling();
} }
if (parse == Document::FullParse)
{
emit MadeProgress();
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -3778,16 +3776,16 @@ void VPattern::ParseIncrementsElement(const QDomNode &node, const Document &pars
increment->SetPreviewCalculation(node.toElement().tagName() == TagPreviewCalculations); increment->SetPreviewCalculation(node.toElement().tagName() == TagPreviewCalculations);
data->AddVariable(name, increment); data->AddVariable(name, increment);
++index; ++index;
if (parse == Document::FullParse)
{
emit MadeProgress();
}
} }
} }
} }
domNode = domNode.nextSibling(); domNode = domNode.nextSibling();
} }
if (parse == Document::FullParse)
{
emit MadeProgress();
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------