diff options
author | Sami Lempinen <sami.lempinen@nokia.com> | 2011-10-14 06:18:15 (GMT) |
---|---|---|
committer | Sami Lempinen <sami.lempinen@nokia.com> | 2011-10-14 06:18:15 (GMT) |
commit | 01057867c3e5e97fc8b58601e3cee6dfef0df205 (patch) | |
tree | 96125e444f32691c73bc87f0bc938993b7737899 /src/declarative | |
parent | 138b9d7349d5daa1808d8bd891c5ecf817f98c52 (diff) | |
parent | 77563a2e63562e4e010e53dd79a707d9d7ed3f3d (diff) | |
download | Qt-01057867c3e5e97fc8b58601e3cee6dfef0df205.zip Qt-01057867c3e5e97fc8b58601e3cee6dfef0df205.tar.gz Qt-01057867c3e5e97fc8b58601e3cee6dfef0df205.tar.bz2 |
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'src/declarative')
16 files changed, 168 insertions, 90 deletions
diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 3134c79..c81968e 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -5,13 +5,14 @@ SOURCES += \ $$PWD/qpacketprotocol.cpp \ $$PWD/qdeclarativedebugservice.cpp \ $$PWD/qdeclarativedebugclient.cpp \ - $$PWD/qdeclarativedebug.cpp \ + $$PWD/qdeclarativeenginedebug.cpp \ $$PWD/qdeclarativedebugtrace.cpp \ $$PWD/qdeclarativedebughelper.cpp \ $$PWD/qdeclarativedebugserver.cpp \ $$PWD/qdeclarativeinspectorservice.cpp \ $$PWD/qjsdebuggeragent.cpp \ - $$PWD/qjsdebugservice.cpp + $$PWD/qjsdebugservice.cpp \ + $$PWD/qdeclarativeenginedebugservice.cpp HEADERS += \ $$PWD/qdeclarativedebuggerstatus_p.h \ @@ -19,7 +20,7 @@ HEADERS += \ $$PWD/qdeclarativedebugservice_p.h \ $$PWD/qdeclarativedebugservice_p_p.h \ $$PWD/qdeclarativedebugclient_p.h \ - $$PWD/qdeclarativedebug_p.h \ + $$PWD/qdeclarativeenginedebug_p.h \ $$PWD/qdeclarativedebugtrace_p.h \ $$PWD/qdeclarativedebughelper_p.h \ $$PWD/qdeclarativedebugserver_p.h \ @@ -27,4 +28,6 @@ HEADERS += \ $$PWD/qdeclarativeinspectorservice_p.h \ $$PWD/qdeclarativeinspectorinterface_p.h \ $$PWD/qjsdebuggeragent_p.h \ - $$PWD/qjsdebugservice_p.h + $$PWD/qjsdebugservice_p.h \ + $$PWD/qdeclarativedebug.h \ + $$PWD/qdeclarativeenginedebugservice_p.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 <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 diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp index 12691b2..3e0c326 100644 --- a/src/declarative/debugger/qdeclarativedebugserver.cpp +++ b/src/declarative/debugger/qdeclarativedebugserver.cpp @@ -91,6 +91,7 @@ public: QStringList clientPlugins; bool gotHello; QString waitingForMsgFromService; + bool waitingForMsgSucceeded; private: // private slot @@ -100,7 +101,8 @@ private: QDeclarativeDebugServerPrivate::QDeclarativeDebugServerPrivate() : connection(0), - gotHello(false) + gotHello(false), + waitingForMsgSucceeded(false) { } @@ -315,7 +317,7 @@ void QDeclarativeDebugServer::receiveMessage(const QByteArray &message) if (d->waitingForMsgFromService == name) { // deliver directly so that it is delivered before waitForMessage is returning. d->_q_deliverMessage(name, message); - d->waitingForMsgFromService.clear(); + d->waitingForMsgSucceeded = true; } else { // deliver message in next event loop run. // Fixes the case that the service does start it's own event loop ..., @@ -409,7 +411,9 @@ bool QDeclarativeDebugServer::waitForMessage(QDeclarativeDebugService *service) do { d->connection->waitForMessage(); - } while (!d->waitingForMsgFromService.isEmpty()); + } while (!d->waitingForMsgSucceeded); + d->waitingForMsgSucceeded = false; + d->waitingForMsgFromService.clear(); return true; } diff --git a/src/declarative/debugger/qdeclarativedebug.cpp b/src/declarative/debugger/qdeclarativeenginedebug.cpp index 620ee1d..85ce710 100644 --- a/src/declarative/debugger/qdeclarativedebug.cpp +++ b/src/declarative/debugger/qdeclarativeenginedebug.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "private/qdeclarativedebug_p.h" +#include "private/qdeclarativeenginedebug_p.h" #include "private/qdeclarativedebugclient_p.h" -#include <qdeclarativeenginedebug_p.h> +#include <qdeclarativeenginedebugservice_p.h> #include <private/qobject_p.h> @@ -207,7 +207,7 @@ void QDeclarativeEngineDebugPrivate::remove(QDeclarativeEngineDebug *c, QDeclara void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugObjectReference &o, bool simple) { - QDeclarativeEngineDebugServer::QDeclarativeObjectData data; + QDeclarativeEngineDebugService::QDeclarativeObjectData data; ds >> data; o.m_debugId = data.objectId; o.m_class = data.objectType; @@ -234,7 +234,7 @@ void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugOb ds >> propCount; for (int ii = 0; ii < propCount; ++ii) { - QDeclarativeEngineDebugServer::QDeclarativeObjectProperty data; + QDeclarativeEngineDebugService::QDeclarativeObjectProperty data; ds >> data; QDeclarativeDebugPropertyReference prop; prop.m_objectDebugId = o.m_debugId; @@ -243,21 +243,21 @@ void QDeclarativeEngineDebugPrivate::decode(QDataStream &ds, QDeclarativeDebugOb prop.m_hasNotifySignal = data.hasNotifySignal; prop.m_valueTypeName = data.valueTypeName; switch (data.type) { - case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Basic: - case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::List: - case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::SignalProperty: + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Basic: + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::List: + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::SignalProperty: { prop.m_value = data.value; break; } - case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Object: + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Object: { QDeclarativeDebugObjectReference obj; obj.m_debugId = prop.m_value.toInt(); prop.m_value = QVariant::fromValue(obj); break; } - case QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Unknown: + case QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Unknown: break; } o.m_properties << prop; diff --git a/src/declarative/debugger/qdeclarativedebug_p.h b/src/declarative/debugger/qdeclarativeenginedebug_p.h index f822637..9b70e1c 100644 --- a/src/declarative/debugger/qdeclarativedebug_p.h +++ b/src/declarative/debugger/qdeclarativeenginedebug_p.h @@ -38,8 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUG_H -#define QDECLARATIVEDEBUG_H +#ifndef QDECLARATIVEENGINEDEBUG_H +#define QDECLARATIVEENGINEDEBUG_H #include <QtCore/qobject.h> #include <QtCore/qurl.h> @@ -384,4 +384,4 @@ Q_DECLARE_METATYPE(QDeclarativeDebugPropertyReference) QT_END_HEADER -#endif // QDECLARATIVEDEBUG_H +#endif // QDECLARATIVEENGINEDEBUG_H diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/debugger/qdeclarativeenginedebugservice.cpp index 8707a7f..7683733 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/debugger/qdeclarativeenginedebugservice.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "private/qdeclarativeenginedebug_p.h" +#include "private/qdeclarativeenginedebugservice_p.h" #include "private/qdeclarativeboundsignal_p.h" #include "qdeclarativeengine.h" @@ -59,14 +59,14 @@ QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QDeclarativeEngineDebugServer, qmlEngineDebugServer); +Q_GLOBAL_STATIC(QDeclarativeEngineDebugService, qmlEngineDebugService); -QDeclarativeEngineDebugServer *QDeclarativeEngineDebugServer::instance() +QDeclarativeEngineDebugService *QDeclarativeEngineDebugService::instance() { - return qmlEngineDebugServer(); + return qmlEngineDebugService(); } -QDeclarativeEngineDebugServer::QDeclarativeEngineDebugServer(QObject *parent) +QDeclarativeEngineDebugService::QDeclarativeEngineDebugService(QObject *parent) : QDeclarativeDebugService(QLatin1String("QDeclarativeEngine"), parent), m_watch(new QDeclarativeWatcher(this)) { @@ -75,7 +75,7 @@ QDeclarativeEngineDebugServer::QDeclarativeEngineDebugServer(QObject *parent) } QDataStream &operator<<(QDataStream &ds, - const QDeclarativeEngineDebugServer::QDeclarativeObjectData &data) + const QDeclarativeEngineDebugService::QDeclarativeObjectData &data) { ds << data.url << data.lineNumber << data.columnNumber << data.idString << data.objectName << data.objectType << data.objectId << data.contextId; @@ -83,7 +83,7 @@ QDataStream &operator<<(QDataStream &ds, } QDataStream &operator>>(QDataStream &ds, - QDeclarativeEngineDebugServer::QDeclarativeObjectData &data) + QDeclarativeEngineDebugService::QDeclarativeObjectData &data) { ds >> data.url >> data.lineNumber >> data.columnNumber >> data.idString >> data.objectName >> data.objectType >> data.objectId >> data.contextId; @@ -91,7 +91,7 @@ QDataStream &operator>>(QDataStream &ds, } QDataStream &operator<<(QDataStream &ds, - const QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &data) + const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data) { ds << (int)data.type << data.name << data.value << data.valueTypeName << data.binding << data.hasNotifySignal; @@ -99,12 +99,12 @@ QDataStream &operator<<(QDataStream &ds, } QDataStream &operator>>(QDataStream &ds, - QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &data) + QDeclarativeEngineDebugService::QDeclarativeObjectProperty &data) { int type; ds >> type >> data.name >> data.value >> data.valueTypeName >> data.binding >> data.hasNotifySignal; - data.type = (QDeclarativeEngineDebugServer::QDeclarativeObjectProperty::Type)type; + data.type = (QDeclarativeEngineDebugService::QDeclarativeObjectProperty::Type)type; return ds; } @@ -131,8 +131,8 @@ static bool hasValidSignal(QObject *object, const QString &propertyName) return true; } -QDeclarativeEngineDebugServer::QDeclarativeObjectProperty -QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx) +QDeclarativeEngineDebugService::QDeclarativeObjectProperty +QDeclarativeEngineDebugService::propertyData(QObject *obj, int propIdx) { QDeclarativeObjectProperty rv; @@ -164,7 +164,7 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx) return rv; } -QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) const +QVariant QDeclarativeEngineDebugService::valueContents(const QVariant &value) const { int userType = value.userType(); @@ -193,7 +193,7 @@ QVariant QDeclarativeEngineDebugServer::valueContents(const QVariant &value) con return QLatin1String("<unknown value>"); } -void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message, +void QDeclarativeEngineDebugService::buildObjectDump(QDataStream &message, QObject *object, bool recur, bool dumpProperties) { message << objectData(object); @@ -264,7 +264,7 @@ void QDeclarativeEngineDebugServer::buildObjectDump(QDataStream &message, message << fakeProperties[ii]; } -void QDeclarativeEngineDebugServer::prepareDeferredObjects(QObject *obj) +void QDeclarativeEngineDebugService::prepareDeferredObjects(QObject *obj) { qmlExecuteDeferred(obj); @@ -276,7 +276,7 @@ void QDeclarativeEngineDebugServer::prepareDeferredObjects(QObject *obj) } -void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt) +void QDeclarativeEngineDebugService::buildObjectList(QDataStream &message, QDeclarativeContext *ctxt) { QDeclarativeContextData *p = QDeclarativeContextData::get(ctxt); @@ -316,7 +316,7 @@ void QDeclarativeEngineDebugServer::buildObjectList(QDataStream &message, QDecla } } -void QDeclarativeEngineDebugServer::buildStatesList(QDeclarativeContext *ctxt, bool cleanList=false) +void QDeclarativeEngineDebugService::buildStatesList(QDeclarativeContext *ctxt, bool cleanList=false) { if (cleanList) m_allStates.clear(); @@ -333,7 +333,7 @@ void QDeclarativeEngineDebugServer::buildStatesList(QDeclarativeContext *ctxt, b } } -void QDeclarativeEngineDebugServer::buildStatesList(QObject *obj) +void QDeclarativeEngineDebugService::buildStatesList(QObject *obj) { if (QDeclarativeState *state = qobject_cast<QDeclarativeState *>(obj)) { m_allStates.append(state); @@ -345,8 +345,8 @@ void QDeclarativeEngineDebugServer::buildStatesList(QObject *obj) } } -QDeclarativeEngineDebugServer::QDeclarativeObjectData -QDeclarativeEngineDebugServer::objectData(QObject *object) +QDeclarativeEngineDebugService::QDeclarativeObjectData +QDeclarativeEngineDebugService::objectData(QObject *object) { QDeclarativeData *ddata = QDeclarativeData::get(object); QDeclarativeObjectData rv; @@ -385,7 +385,7 @@ QDeclarativeEngineDebugServer::objectData(QObject *object) return rv; } -void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) +void QDeclarativeEngineDebugService::messageReceived(const QByteArray &message) { QDataStream ds(message); @@ -545,7 +545,7 @@ void QDeclarativeEngineDebugServer::messageReceived(const QByteArray &message) } } -void QDeclarativeEngineDebugServer::setBinding(int objectId, +void QDeclarativeEngineDebugService::setBinding(int objectId, const QString &propertyName, const QVariant &expression, bool isLiteralValue, @@ -600,7 +600,7 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, oldBinding->destroy(); binding->update(); } else { - qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object; + qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object; } } @@ -613,13 +613,13 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, propertyChanges->changeExpression(propertyName, expression.toString()); } } else { - qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object; + qWarning() << "QDeclarativeEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object; } } } } -void QDeclarativeEngineDebugServer::resetBinding(int objectId, const QString &propertyName) +void QDeclarativeEngineDebugService::resetBinding(int objectId, const QString &propertyName) { QObject *object = objectForId(objectId); QDeclarativeContext *context = qmlContext(object); @@ -664,7 +664,7 @@ void QDeclarativeEngineDebugServer::resetBinding(int objectId, const QString &pr } } -void QDeclarativeEngineDebugServer::setMethodBody(int objectId, const QString &method, const QString &body) +void QDeclarativeEngineDebugService::setMethodBody(int objectId, const QString &method, const QString &body) { QObject *object = objectForId(objectId); QDeclarativeContext *context = qmlContext(object); @@ -703,7 +703,7 @@ void QDeclarativeEngineDebugServer::setMethodBody(int objectId, const QString &m vmeMetaObject->setVmeMethod(prop->coreIndex, QDeclarativeExpressionPrivate::evalInObjectScope(contextData, object, jsfunction, contextData->url.toString(), lineNumber, 0)); } -void QDeclarativeEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) +void QDeclarativeEngineDebugService::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) { QByteArray reply; QDataStream rs(&reply, QIODevice::WriteOnly); @@ -713,7 +713,7 @@ void QDeclarativeEngineDebugServer::propertyChanged(int id, int objectId, const sendMessage(reply); } -void QDeclarativeEngineDebugServer::addEngine(QDeclarativeEngine *engine) +void QDeclarativeEngineDebugService::addEngine(QDeclarativeEngine *engine) { Q_ASSERT(engine); Q_ASSERT(!m_engines.contains(engine)); @@ -721,7 +721,7 @@ void QDeclarativeEngineDebugServer::addEngine(QDeclarativeEngine *engine) m_engines.append(engine); } -void QDeclarativeEngineDebugServer::remEngine(QDeclarativeEngine *engine) +void QDeclarativeEngineDebugService::remEngine(QDeclarativeEngine *engine) { Q_ASSERT(engine); Q_ASSERT(m_engines.contains(engine)); @@ -729,7 +729,7 @@ void QDeclarativeEngineDebugServer::remEngine(QDeclarativeEngine *engine) m_engines.removeAll(engine); } -void QDeclarativeEngineDebugServer::objectCreated(QDeclarativeEngine *engine, QObject *object) +void QDeclarativeEngineDebugService::objectCreated(QDeclarativeEngine *engine, QObject *object) { Q_ASSERT(engine); Q_ASSERT(m_engines.contains(engine)); diff --git a/src/declarative/qml/qdeclarativeenginedebug_p.h b/src/declarative/debugger/qdeclarativeenginedebugservice_p.h index 804a043..3674b83 100644 --- a/src/declarative/qml/qdeclarativeenginedebug_p.h +++ b/src/declarative/debugger/qdeclarativeenginedebugservice_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEENGINEDEBUG_P_H -#define QDECLARATIVEENGINEDEBUG_P_H +#ifndef QDECLARATIVEENGINEDEBUGSERVICE_P_H +#define QDECLARATIVEENGINEDEBUGSERVICE_P_H // // W A R N I N G @@ -67,11 +67,11 @@ class QDeclarativeWatcher; class QDataStream; class QDeclarativeState; -class QDeclarativeEngineDebugServer : public QDeclarativeDebugService +class QDeclarativeEngineDebugService : public QDeclarativeDebugService { Q_OBJECT public: - QDeclarativeEngineDebugServer(QObject * = 0); + QDeclarativeEngineDebugService(QObject * = 0); struct QDeclarativeObjectData { QUrl url; @@ -98,7 +98,7 @@ public: void remEngine(QDeclarativeEngine *); void objectCreated(QDeclarativeEngine *, QObject *); - static QDeclarativeEngineDebugServer *instance(); + static QDeclarativeEngineDebugService *instance(); protected: virtual void messageReceived(const QByteArray &); @@ -123,12 +123,12 @@ private: QDeclarativeWatcher *m_watch; QList<QWeakPointer<QDeclarativeState> > m_allStates; }; -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectData &); -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugServer::QDeclarativeObjectData &); -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &); -Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugServer::QDeclarativeObjectProperty &); +Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectData &); +Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectData &); +Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator<<(QDataStream &, const QDeclarativeEngineDebugService::QDeclarativeObjectProperty &); +Q_DECLARATIVE_PRIVATE_EXPORT QDataStream &operator>>(QDataStream &, QDeclarativeEngineDebugService::QDeclarativeObjectProperty &); QT_END_NAMESPACE -#endif // QDECLARATIVEENGINEDEBUG_P_H +#endif // QDECLARATIVEENGINEDEBUGSERVICE_P_H diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index 5e8d0f4..399c207 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -405,17 +405,6 @@ QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true) return qmlAttachedPropertiesObject(&idx, obj, &T::staticMetaObject, create); } -// 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/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index d9f291b..f423f50 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -53,7 +53,7 @@ #include "private/qdeclarativeglobal_p.h" #include "private/qdeclarativescriptparser_p.h" #include "private/qdeclarativedebugtrace_p.h" -#include "private/qdeclarativeenginedebug_p.h" +#include "private/qdeclarativeenginedebugservice_p.h" #include <QtScript/qscriptvalueiterator.h> #include <QStack> @@ -896,7 +896,7 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *parentCon if (enginePriv->isDebugging && rv) { if (!parentContext->isInternal) parentContext->asQDeclarativeContextPrivate()->instances.append(rv); - QDeclarativeEngineDebugServer::instance()->objectCreated(parentContext->engine, rv); + QDeclarativeEngineDebugService::instance()->objectCreated(parentContext->engine, rv); } return rv; diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 34014f7..1417b78 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -51,7 +51,7 @@ #include "qdeclarativecomponent.h" #include "private/qdeclarativebinding_p_p.h" #include "private/qdeclarativevme_p.h" -#include "private/qdeclarativeenginedebug_p.h" +#include "private/qdeclarativeenginedebugservice_p.h" #include "private/qdeclarativestringconverters_p.h" #include "private/qdeclarativexmlhttprequest_p.h" #include "private/qdeclarativesqldatabase_p.h" @@ -581,9 +581,9 @@ void QDeclarativeEnginePrivate::init() scriptEngine.globalObject().property(QLatin1String("Qt")).setProperty(QLatin1String("application"), applicationObject); if (QCoreApplication::instance()->thread() == q->thread() && - QDeclarativeEngineDebugServer::isDebuggingEnabled()) { + QDeclarativeEngineDebugService::isDebuggingEnabled()) { isDebugging = true; - QDeclarativeEngineDebugServer::instance()->addEngine(q); + QDeclarativeEngineDebugService::instance()->addEngine(q); QJSDebugService::instance()->addEngine(q); } } @@ -648,7 +648,7 @@ QDeclarativeEngine::~QDeclarativeEngine() { Q_D(QDeclarativeEngine); if (d->isDebugging) { - QDeclarativeEngineDebugServer::instance()->remEngine(this); + QDeclarativeEngineDebugService::instance()->remEngine(this); QJSDebugService::instance()->removeEngine(this); } } diff --git a/src/declarative/qml/qdeclarativeengine.h b/src/declarative/qml/qdeclarativeengine.h index 61ab2b2..4d6887f 100644 --- a/src/declarative/qml/qdeclarativeengine.h +++ b/src/declarative/qml/qdeclarativeengine.h @@ -47,6 +47,7 @@ #include <QtCore/qmap.h> #include <QtScript/qscriptvalue.h> #include <QtDeclarative/qdeclarativeerror.h> +#include <QtDeclarative/qdeclarativedebug.h> QT_BEGIN_HEADER diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp index bf261ef..c2f0086 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/declarative/qml/qdeclarativeimport.cpp @@ -46,6 +46,7 @@ #include <QtCore/qfileinfo.h> #include <QtCore/qpluginloader.h> #include <QtCore/qlibraryinfo.h> +#include <QtCore/qalgorithms.h> #include <QtDeclarative/qdeclarativeextensioninterface.h> #include <private/qdeclarativeglobal_p.h> #include <private/qdeclarativetypenamecache_p.h> @@ -734,8 +735,12 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) } RFs& fs = qt_s60GetRFs(); TPtrC tempPathPtr(reinterpret_cast<const TText*> (tempPath.constData())); + // Symbian searches should start from Y:. Fix start drive otherwise TFindFile starts from the session drive + _LIT(KStartDir, "Y:"); + TFileName dirPath(KStartDir); + dirPath.Append(tempPathPtr); TFindFile finder(fs); - TInt err = finder.FindByDir(tempPathPtr, tempPathPtr); + TInt err = finder.FindByDir(tempPathPtr, dirPath); while (err == KErrNone) { QString foundDir(reinterpret_cast<const QChar *>(finder.File().Ptr()), finder.File().Length()); @@ -743,6 +748,9 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e) addImportPath(foundDir); err = finder.Find(); } + // TFindFile found the directories in the order we want, but addImportPath reverses it. + // Reverse the order again to get it right. + QAlgorithmsPrivate::qReverse(fileImportPath.begin(), fileImportPath.end()); } else { addImportPath(installImportsPath); } diff --git a/src/declarative/qml/qdeclarativenotifier_p.h b/src/declarative/qml/qdeclarativenotifier_p.h index 5f70f7d..14a7f82 100644 --- a/src/declarative/qml/qdeclarativenotifier_p.h +++ b/src/declarative/qml/qdeclarativenotifier_p.h @@ -99,8 +99,15 @@ private: enum { InvalidType, SignalType, NotifierType } type; union { - char signalData[sizeof(Signal)]; - char notifierData[sizeof(Notifier)]; + struct { + Signal *signal; + union { + char signalData[sizeof(Signal)]; + qint64 q_for_alignment_1; + double q_for_alignment_2; + }; + } signal; + Notifier notifier; }; inline Notifier *toNotifier(); @@ -194,7 +201,7 @@ void QDeclarativeNotifierEndpoint::connect(QDeclarativeNotifier *notifier) void QDeclarativeNotifierEndpoint::disconnect() { if (type == SignalType) { - Signal *s = (Signal *)&signalData; + Signal *s = asSignal(); if (s->source) { QMetaObject::disconnectOne(s->source, s->sourceSignal, target, targetMethod); s->source = 0; @@ -223,18 +230,19 @@ QDeclarativeNotifierEndpoint::Notifier *QDeclarativeNotifierEndpoint::toNotifier s->~Signal(); } + type = NotifierType; Notifier *n = asNotifier(); n->next = 0; n->prev = 0; n->disconnected = 0; n->notifier = 0; - type = NotifierType; return n; } QDeclarativeNotifierEndpoint::Notifier *QDeclarativeNotifierEndpoint::asNotifier() { - return (Notifier *)(¬ifierData); + Q_ASSERT(type == NotifierType); + return ¬ifier; } QDeclarativeNotifierEndpoint::Signal *QDeclarativeNotifierEndpoint::toSignal() @@ -243,16 +251,15 @@ QDeclarativeNotifierEndpoint::Signal *QDeclarativeNotifierEndpoint::toSignal() return asSignal(); disconnect(); - Signal *s = asSignal(); - new (s) Signal; + signal.signal = new (&signal.signalData) Signal; type = SignalType; - - return s; + return signal.signal; } QDeclarativeNotifierEndpoint::Signal *QDeclarativeNotifierEndpoint::asSignal() { - return (Signal *)(&signalData); + Q_ASSERT(type == SignalType); + return signal.signal; } QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h index 581f519..c648d25 100644 --- a/src/declarative/qml/qdeclarativepropertycache_p.h +++ b/src/declarative/qml/qdeclarativepropertycache_p.h @@ -111,7 +111,7 @@ public: int relatedIndex; // When IsFunction }; uint overrideIndexIsProperty : 1; - int overrideIndex : 31; + signed int overrideIndex : 31; int revision; int metaObjectOffset; diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index bf9e54a..5d171bf 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -27,7 +27,6 @@ SOURCES += \ $$PWD/qdeclarativeinfo.cpp \ $$PWD/qdeclarativeerror.cpp \ $$PWD/qdeclarativescriptparser.cpp \ - $$PWD/qdeclarativeenginedebug.cpp \ $$PWD/qdeclarativerewrite.cpp \ $$PWD/qdeclarativevaluetype.cpp \ $$PWD/qdeclarativecompiledbindings.cpp \ @@ -99,7 +98,6 @@ HEADERS += \ $$PWD/qdeclarativedata_p.h \ $$PWD/qdeclarativeerror.h \ $$PWD/qdeclarativescriptparser_p.h \ - $$PWD/qdeclarativeenginedebug_p.h \ $$PWD/qdeclarativerewrite_p.h \ $$PWD/qpodvector_p.h \ $$PWD/qbitfield_p.h \ diff --git a/src/declarative/util/qdeclarativeview.h b/src/declarative/util/qdeclarativeview.h index b3854fc..ef51934 100644 --- a/src/declarative/util/qdeclarativeview.h +++ b/src/declarative/util/qdeclarativeview.h @@ -47,6 +47,7 @@ #include <QtGui/qgraphicssceneevent.h> #include <QtGui/qgraphicsview.h> #include <QtGui/qwidget.h> +#include <QtDeclarative/qdeclarativedebug.h> QT_BEGIN_HEADER |