From 521c69a744b4f5969510489f0da1b51d965804d5 Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@nokia.com>
Date: Tue, 26 Jan 2010 12:06:44 +0100
Subject: [PATCH] Fix compilation without declarative backend

---
 src/libs/qmljs/qmljsinterpreter.cpp | 8 ++++++++
 src/libs/qmljs/qmljsinterpreter.h   | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp
index f8ee91ca442..149a56ccb1a 100644
--- a/src/libs/qmljs/qmljsinterpreter.cpp
+++ b/src/libs/qmljs/qmljsinterpreter.cpp
@@ -1214,7 +1214,9 @@ Engine::Engine()
       _regexpCtor(0),
       _globalObject(0),
       _mathObject(0),
+#ifndef NO_DECLARATIVE_BACKEND
       _qmlKeysObject(0),
+#endif
       _convertToNumber(this),
       _convertToString(this),
       _convertToObject(this)
@@ -1670,14 +1672,20 @@ void Engine::initializePrototypes()
     _globalObject->setProperty("Date", dateCtor());
     _globalObject->setProperty("RegExp", regexpCtor());
 
+#ifndef NO_DECLARATIVE_BACKEND
     _qmlKeysObject = new QmlAttachedKeys(this);
     _globalObject->setProperty("Keys", _qmlKeysObject); // ### attach it to the current scope, and not to the global object
     registerObject(_qmlKeysObject);
+#endif
 }
 
 const ObjectValue *Engine::qmlKeysObject()
 {
+#ifndef NO_DECLARATIVE_BACKEND
     return _qmlKeysObject;
+#else
+    return 0;
+#endif
 }
 
 const Value *Engine::defaultValueForBuiltinType(const QString &typeName) const
diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h
index ff4beffcf4c..59716961ba6 100644
--- a/src/libs/qmljs/qmljsinterpreter.h
+++ b/src/libs/qmljs/qmljsinterpreter.h
@@ -504,7 +504,9 @@ private:
 
     ObjectValue *_globalObject;
     ObjectValue *_mathObject;
+#ifndef NO_DECLARATIVE_BACKEND
     ObjectValue *_qmlKeysObject;
+#endif
 
     NullValue _nullValue;
     UndefinedValue _undefinedValue;
-- 
GitLab