forked from qt-creator/qt-creator
QmlDesigner: Allow to disable semantic checks in transaction
The semantic checks are slow and sometimes we knoe that they are not required. Change-Id: I43cae131e4c5f47d2a61d34975913dd8cb6370fc Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -72,12 +72,23 @@ bool RewriterTransaction::isValid() const
|
|||||||
return m_valid;
|
return m_valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RewriterTransaction::ignoreSemanticChecks()
|
||||||
|
{
|
||||||
|
m_ignoreSemanticChecks = true;
|
||||||
|
}
|
||||||
|
|
||||||
void RewriterTransaction::commit()
|
void RewriterTransaction::commit()
|
||||||
{
|
{
|
||||||
if (m_valid) {
|
if (m_valid) {
|
||||||
m_valid = false;
|
m_valid = false;
|
||||||
|
bool oldSemanticChecks = view()->rewriterView()->checkSemanticErrors();
|
||||||
|
if (m_ignoreSemanticChecks)
|
||||||
|
view()->rewriterView()->setCheckSemanticErrors(false);
|
||||||
|
|
||||||
view()->emitRewriterEndTransaction();
|
view()->emitRewriterEndTransaction();
|
||||||
|
|
||||||
|
view()->rewriterView()->setCheckSemanticErrors(oldSemanticChecks);
|
||||||
|
|
||||||
if (m_activeIdentifier) {
|
if (m_activeIdentifier) {
|
||||||
qDebug() << "Commit RewriterTransaction:" << m_identifier << m_identifierNumber;
|
qDebug() << "Commit RewriterTransaction:" << m_identifier << m_identifierNumber;
|
||||||
bool success = m_identifierList.removeOne(m_identifier + QByteArrayLiteral("-") + QByteArray::number(m_identifierNumber));
|
bool success = m_identifierList.removeOne(m_identifier + QByteArrayLiteral("-") + QByteArray::number(m_identifierNumber));
|
||||||
|
@@ -46,6 +46,8 @@ public:
|
|||||||
|
|
||||||
bool isValid() const;
|
bool isValid() const;
|
||||||
|
|
||||||
|
void ignoreSemanticChecks();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AbstractView *view();
|
AbstractView *view();
|
||||||
private:
|
private:
|
||||||
@@ -55,6 +57,7 @@ private:
|
|||||||
int m_identifierNumber;
|
int m_identifierNumber;
|
||||||
static QList<QByteArray> m_identifierList;
|
static QList<QByteArray> m_identifierList;
|
||||||
static bool m_activeIdentifier;
|
static bool m_activeIdentifier;
|
||||||
|
bool m_ignoreSemanticChecks = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //QmlDesigner
|
} //QmlDesigner
|
||||||
|
Reference in New Issue
Block a user