Debugger: Move QT_DECLARATIVE_DEBUG handling out of qdeclarative.h
authorKai Koehne <kai.koehne@nokia.com>
Wed, 31 Aug 2011 08:01:19 +0000 (10:01 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 2 Sep 2011 11:13:21 +0000 (13:13 +0200)
Apps don't have to (directly or indirectly) include qdeclarative.h.
Instead, move the static instance to qdeclarativeengine.h, and
qdeclarativeview.h, qsgview.h (which instantiate their own engine).

Change-Id: I8b3e63ad4f134969734a2cc712395145d90e0dfa
Reviewed-on: http://codereview.qt.nokia.com/3941
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/declarative/debugger/debugger.pri
src/declarative/debugger/qdeclarativedebug.h [new file with mode: 0644]
src/declarative/items/qsgview.h
src/declarative/qml/qdeclarative.h
src/declarative/qml/qdeclarativeengine.h
src/qtquick1/util/qdeclarativeview.h

index f2790c4..a257da2 100644 (file)
@@ -27,4 +27,5 @@ HEADERS += \
     $$PWD/qdeclarativeinspectorservice_p.h \
     $$PWD/qdeclarativeinspectorinterface_p.h \
     $$PWD/qv8debugservice_p.h \
-    $$PWD/qdeclarativeenginedebugservice_p.h
+    $$PWD/qdeclarativeenginedebugservice_p.h \
+    $$PWD/qdeclarativedebug.h
diff --git a/src/declarative/debugger/qdeclarativedebug.h b/src/declarative/debugger/qdeclarativedebug.h
new file mode 100644 (file)
index 0000000..b7930b2
--- /dev/null
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEDEBUG_H
+#define QDECLARATIVEDEBUG_H
+
+#include <QtCore/qglobal.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+struct Q_DECLARATIVE_EXPORT QDeclarativeDebuggingEnabler
+{
+    QDeclarativeDebuggingEnabler();
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+#if defined(QT_DECLARATIVE_DEBUG)
+static QDeclarativeDebuggingEnabler qmlEnableDebuggingHelper;
+#endif
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QDECLARATIVEDEBUG_H
index 9b5ace1..ede488b 100644 (file)
@@ -43,8 +43,9 @@
 #ifndef QSGVIEW_H
 #define QSGVIEW_H
 
-#include <QtCore/qurl.h>
 #include <qsgcanvas.h>
+#include <QtCore/qurl.h>
+#include <QtDeclarative/qdeclarativedebug.h>
 
 QT_BEGIN_HEADER
 
index a0eb98d..312aecb 100644 (file)
@@ -552,17 +552,6 @@ inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMi
     return QDeclarativePrivate::qmlregister(QDeclarativePrivate::ModuleApiRegistration, &api);
 }
 
-// Enable debugging before any QDeclarativeEngine is created
-struct Q_DECLARATIVE_EXPORT QDeclarativeDebuggingEnabler
-{
-    QDeclarativeDebuggingEnabler();
-};
-
-// Execute code in constructor before first QDeclarativeEngine is instantiated
-#if defined(QT_DECLARATIVE_DEBUG)
-static QDeclarativeDebuggingEnabler qmlEnableDebuggingHelper;
-#endif
-
 QT_END_NAMESPACE
 
 QML_DECLARE_TYPE(QObject)
index 3f90296..74c3c6c 100644 (file)
@@ -48,6 +48,7 @@
 #include <QtDeclarative/qjsengine.h>
 #include <QtDeclarative/qjsvalue.h>
 #include <QtDeclarative/qdeclarativeerror.h>
+#include <QtDeclarative/qdeclarativedebug.h>
 
 QT_BEGIN_HEADER
 
index 39a2322..aafb464 100644 (file)
@@ -47,6 +47,7 @@
 #include <QtGui/qgraphicssceneevent.h>
 #include <QtGui/qgraphicsview.h>
 #include <QtGui/qwidget.h>
+#include <QtDeclarative/qdeclarativedebug.h>
 
 QT_BEGIN_HEADER