From 6cb39fb829b78b5f6e9751283c7cd50400821e2a Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 31 Aug 2011 10:01:19 +0200 Subject: [PATCH] Debugger: Move QT_DECLARATIVE_DEBUG handling out of qdeclarative.h 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 Reviewed-by: Aurindam Jana Reviewed-by: Martin Jones --- src/declarative/debugger/debugger.pri | 3 +- src/declarative/debugger/qdeclarativedebug.h | 67 ++++++++++++++++++++++++++ src/declarative/items/qsgview.h | 3 +- src/declarative/qml/qdeclarative.h | 11 ---- src/declarative/qml/qdeclarativeengine.h | 1 + src/qtquick1/util/qdeclarativeview.h | 1 + 6 files changed, 73 insertions(+), 13 deletions(-) create mode 100644 src/declarative/debugger/qdeclarativedebug.h diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index f2790c4..a257da2 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -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 index 0000000..b7930b2 --- /dev/null +++ b/src/declarative/debugger/qdeclarativedebug.h @@ -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 + +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 diff --git a/src/declarative/items/qsgview.h b/src/declarative/items/qsgview.h index 9b5ace1..ede488b 100644 --- a/src/declarative/items/qsgview.h +++ b/src/declarative/items/qsgview.h @@ -43,8 +43,9 @@ #ifndef QSGVIEW_H #define QSGVIEW_H -#include #include +#include +#include QT_BEGIN_HEADER diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index a0eb98d..312aecb 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -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) diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h index 3f90296..74c3c6c 100644 --- a/src/declarative/qml/qdeclarativeengine.h +++ b/src/declarative/qml/qdeclarativeengine.h @@ -48,6 +48,7 @@ #include #include #include +#include QT_BEGIN_HEADER diff --git a/src/qtquick1/util/qdeclarativeview.h b/src/qtquick1/util/qdeclarativeview.h index 39a2322..aafb464 100644 --- a/src/qtquick1/util/qdeclarativeview.h +++ b/src/qtquick1/util/qdeclarativeview.h @@ -47,6 +47,7 @@ #include #include #include +#include QT_BEGIN_HEADER -- 1.7.2.5