diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-01-09 17:29:00 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2017-01-10 10:52:13 +0000 |
commit | 17362f3ca028a44c020314acabec1fe4206c0266 (patch) | |
tree | 057fe3e0932c0c891813e80d2e67964905a80431 /src/lib/corelib/buildgraph/rulesevaluationcontext.cpp | |
parent | 4004e5688b49e0c7e97e9f4773c3d3c76c0059ee (diff) |
Add ScriptEngine::isActive()
Move the isActive flag from RulesEvaluationContext to ScriptEngine,
because we will need in other places as well.
This is a preparation for using the same fix for QBS-932 and QBS-782.
Change-Id: Ifa003856f663c26f4e997a80fa660fd5aa758114
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/rulesevaluationcontext.cpp')
-rw-r--r-- | src/lib/corelib/buildgraph/rulesevaluationcontext.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp b/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp index 1afaea9ce..78e5b4b29 100644 --- a/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp +++ b/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp @@ -71,11 +71,6 @@ RulesEvaluationContext::~RulesEvaluationContext() delete m_engine; } -bool RulesEvaluationContext::isActive() const -{ - return m_initScopeCalls > 0; -} - void RulesEvaluationContext::initializeObserver(const QString &description, int maximumProgress) { if (m_observer) @@ -99,6 +94,7 @@ void RulesEvaluationContext::initScope() if (m_initScopeCalls++ > 0) return; + m_engine->setActive(true); m_scope = m_engine->newObject(); m_scope.setPrototype(m_prepareScriptScope); m_engine->setGlobalObject(m_scope); @@ -112,6 +108,7 @@ void RulesEvaluationContext::cleanupScope() m_scope = QScriptValue(); m_engine->setGlobalObject(m_prepareScriptScope.prototype()); + m_engine->setActive(false); } RulesEvaluationContext::Scope::Scope(RulesEvaluationContext *evalContext) |