From f828db056642ac2373c8592c11039e1c7f1b1046 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 15 Jul 2009 19:22:42 +1000 Subject: Remove pointless QmlCompiledComponent class --- src/declarative/qml/qml.pri | 2 - src/declarative/qml/qmlcompiledcomponent.cpp | 77 ---------------------- src/declarative/qml/qmlcompiledcomponent_p.h | 88 ------------------------- src/declarative/qml/qmlcompileddata.cpp | 37 +++++------ src/declarative/qml/qmlcompiler.cpp | 18 ++--- src/declarative/qml/qmlcompiler_p.h | 14 ++-- src/declarative/qml/qmlcomponent.cpp | 6 +- src/declarative/qml/qmlcomponent.h | 4 +- src/declarative/qml/qmlcomponent_p.h | 4 +- src/declarative/qml/qmlcompositetypemanager.cpp | 8 +-- src/declarative/qml/qmlcompositetypemanager_p.h | 8 +-- src/declarative/qml/qmlcontext_p.h | 1 - src/declarative/qml/qmldeclarativedata_p.h | 4 +- src/declarative/qml/qmldom.cpp | 3 +- src/declarative/qml/qmlengine.cpp | 2 +- src/declarative/qml/qmlinstruction.cpp | 8 +-- src/declarative/qml/qmlinstruction_p.h | 4 +- src/declarative/qml/qmlvme.cpp | 17 ++--- src/declarative/qml/qmlvme_p.h | 6 +- 19 files changed, 66 insertions(+), 245 deletions(-) delete mode 100644 src/declarative/qml/qmlcompiledcomponent.cpp delete mode 100644 src/declarative/qml/qmlcompiledcomponent_p.h diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index d8f0f7f..7f1c3f7 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -13,7 +13,6 @@ SOURCES += qml/qmlparser.cpp \ qml/qmlvme.cpp \ qml/qmlcompiler.cpp \ qml/qmlcompileddata.cpp \ - qml/qmlcompiledcomponent.cpp \ qml/qmlboundsignal.cpp \ qml/qmldom.cpp \ qml/qmlrefcount.cpp \ @@ -44,7 +43,6 @@ HEADERS += qml/qmlparser_p.h \ qml/qmlboundsignal_p.h \ qml/qmlparserstatus.h \ qml/qmlproxymetaobject_p.h \ - qml/qmlcompiledcomponent_p.h \ qml/qmlvme_p.h \ qml/qmlcompiler_p.h \ qml/qmlengine_p.h \ diff --git a/src/declarative/qml/qmlcompiledcomponent.cpp b/src/declarative/qml/qmlcompiledcomponent.cpp deleted file mode 100644 index 6ce89b7..0000000 --- a/src/declarative/qml/qmlcompiledcomponent.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, 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.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlcompiledcomponent_p.h" -#include "qmlparser_p.h" -#include -#include -using namespace QmlParser; - -QT_BEGIN_NAMESPACE - -DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP); - -QmlCompiledComponent::QmlCompiledComponent() -{ -} - -QmlCompiledComponent::~QmlCompiledComponent() -{ - for (int ii = 0; ii < synthesizedMetaObjects.count(); ++ii) - qFree(synthesizedMetaObjects.at(ii)); -} - -void QmlCompiledComponent::dumpInstructions() -{ - if (!compilerDump()) - return; - - if (!name.isEmpty()) - qWarning() << name; - qWarning() << "Index\tLine\tOperation\t\tData1\tData2\t\tComments"; - qWarning() << "-------------------------------------------------------------------------------"; - for (int ii = 0; ii < bytecode.count(); ++ii) { - dump(&bytecode[ii], ii); - } - qWarning() << "-------------------------------------------------------------------------------"; -} - -QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcompiledcomponent_p.h b/src/declarative/qml/qmlcompiledcomponent_p.h deleted file mode 100644 index ddc1124..0000000 --- a/src/declarative/qml/qmlcompiledcomponent_p.h +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, 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.0, 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. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLCOMPILEDCOMPONENT_P_H -#define QMLCOMPILEDCOMPONENT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -namespace QmlParser { - class Property; - class Object; - class Value; -}; - -class QmlCompiledComponent : public QmlRefCount, public QmlCompiledData -{ -public: - QmlCompiledComponent(); - ~QmlCompiledComponent(); - - void dumpInstructions(); -private: - void dump(QmlInstruction *, int idx = -1); - friend class QmlCompiler; - friend class QmlDomDocument; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif // QMLCOMPILEDCOMPONENT_P_H diff --git a/src/declarative/qml/qmlcompileddata.cpp b/src/declarative/qml/qmlcompileddata.cpp index 5c47d62..0834794 100644 --- a/src/declarative/qml/qmlcompileddata.cpp +++ b/src/declarative/qml/qmlcompileddata.cpp @@ -43,13 +43,15 @@ #include "qmlengine.h" #include "qmlcomponent.h" #include "qmlcomponent_p.h" -#include "qmlcompiledcomponent_p.h" #include "qmlcontext.h" #include "qmlcontext_p.h" #include +#include QT_BEGIN_NAMESPACE +DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP); + int QmlCompiledData::pack(const char *data, size_t size) { const char *p = packData.constData(); @@ -153,11 +155,6 @@ QmlCompiledData::QmlCompiledData() { } -QmlCompiledData::QmlCompiledData(const QmlCompiledData &other) -{ - *this = other; -} - QmlCompiledData::~QmlCompiledData() { for (int ii = 0; ii < types.count(); ++ii) { @@ -166,19 +163,6 @@ QmlCompiledData::~QmlCompiledData() } } -QmlCompiledData &QmlCompiledData::operator=(const QmlCompiledData &other) -{ - types = other.types; - root = other.root; - primitives = other.primitives; - floatData = other.floatData; - intData = other.intData; - customTypeData = other.customTypeData; - datas = other.datas; - bytecode = other.bytecode; - return *this; -} - QObject *QmlCompiledData::TypeReference::createInstance(QmlContext *ctxt) const { if (type) { @@ -207,5 +191,20 @@ const QMetaObject *QmlCompiledData::TypeReference::metaObject() const } } +void QmlCompiledData::dumpInstructions() +{ + if (!compilerDump()) + return; + + if (!name.isEmpty()) + qWarning() << name; + qWarning() << "Index\tLine\tOperation\t\tData1\tData2\t\tComments"; + qWarning() << "-------------------------------------------------------------------------------"; + for (int ii = 0; ii < bytecode.count(); ++ii) { + dump(&bytecode[ii], ii); + } + qWarning() << "-------------------------------------------------------------------------------"; +} + QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index dafc581..ed9df03 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -470,7 +469,7 @@ void QmlCompiler::genLiteralAssignment(const QMetaProperty &prop, output->bytecode << instr; } -void QmlCompiler::reset(QmlCompiledComponent *cc, bool deleteMemory) +void QmlCompiler::reset(QmlCompiledData *cc) { cc->types.clear(); cc->primitives.clear(); @@ -478,17 +477,12 @@ void QmlCompiler::reset(QmlCompiledComponent *cc, bool deleteMemory) cc->intData.clear(); cc->customTypeData.clear(); cc->datas.clear(); - if (deleteMemory) { - for (int ii = 0; ii < cc->synthesizedMetaObjects.count(); ++ii) - qFree(cc->synthesizedMetaObjects.at(ii)); - } - cc->synthesizedMetaObjects.clear(); cc->bytecode.clear(); } bool QmlCompiler::compile(QmlEngine *engine, QmlCompositeTypeData *unit, - QmlCompiledComponent *out) + QmlCompiledData *out) { #ifdef Q_ENABLE_PERFORMANCE_LOG QFxPerfTimer pc; @@ -496,14 +490,14 @@ bool QmlCompiler::compile(QmlEngine *engine, exceptions.clear(); Q_ASSERT(out); - reset(out, true); + reset(out); output = out; // Compile types for (int ii = 0; ii < unit->types.count(); ++ii) { QmlCompositeTypeData::TypeReference &tref = unit->types[ii]; - QmlCompiledComponent::TypeReference ref; + QmlCompiledData::TypeReference ref; if (tref.type) ref.type = tref.type; else if (tref.unit) { @@ -516,7 +510,7 @@ bool QmlCompiler::compile(QmlEngine *engine, unit->data.types().at(ii)); exceptions << error; exceptions << ref.component->errors(); - reset(out, true); + reset(out); return false; } ref.ref = tref.unit; @@ -534,7 +528,7 @@ bool QmlCompiler::compile(QmlEngine *engine, if (!isError()) { out->dumpInstructions(); } else { - reset(out, true); + reset(out); } output = 0; diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index b97de19..e09665f 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -65,15 +65,12 @@ QT_BEGIN_NAMESPACE class QmlEngine; class QmlComponent; -class QmlCompiledComponent; class QmlContext; -class QmlCompiledData +class QmlCompiledData : public QmlRefCount { public: QmlCompiledData(); - QmlCompiledData(const QmlCompiledData &other); - QmlCompiledData &operator=(const QmlCompiledData &other); virtual ~QmlCompiledData(); QByteArray name; @@ -104,11 +101,14 @@ public: QList intData; QList customTypeData; QList datas; - QList synthesizedMetaObjects; QList locations; QList bytecode; + void dumpInstructions(); private: + void dump(QmlInstruction *, int idx = -1); + QmlCompiledData(const QmlCompiledData &other); + QmlCompiledData &operator=(const QmlCompiledData &other); QByteArray packData; friend class QmlCompiler; int pack(const char *, size_t); @@ -127,7 +127,7 @@ class Q_DECLARATIVE_EXPORT QmlCompiler public: QmlCompiler(); - bool compile(QmlEngine *, QmlCompositeTypeData *, QmlCompiledComponent *); + bool compile(QmlEngine *, QmlCompositeTypeData *, QmlCompiledData *); bool isError() const; QList errors() const; @@ -137,7 +137,7 @@ public: static bool isSignalPropertyName(const QByteArray &); private: - void reset(QmlCompiledComponent *, bool); + void reset(QmlCompiledData *); struct BindingContext { BindingContext() diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 52315f9..0e68f8a 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -41,6 +41,7 @@ #include "qmlcomponent.h" #include "qmlcomponent_p.h" +#include "qmlcompiler_p.h" #include "private/qmlcontext_p.h" #include "private/qmlengine_p.h" #include "qmlvme_p.h" @@ -51,7 +52,6 @@ #include #include #include -#include "qmlcompiledcomponent_p.h" #include #include @@ -123,7 +123,7 @@ void QmlComponentPrivate::typeDataReady() void QmlComponentPrivate::fromTypeData(QmlCompositeTypeData *data) { url = data->imports.baseUrl(); - QmlCompiledComponent *c = data->toCompiledComponent(engine); + QmlCompiledData *c = data->toCompiledComponent(engine); if (!c) { Q_ASSERT(data->status == QmlCompositeTypeData::Error); @@ -303,7 +303,7 @@ QmlComponent::QmlComponent(QmlEngine *engine, const QByteArray &data, const QUrl /*! \internal */ -QmlComponent::QmlComponent(QmlEngine *engine, QmlCompiledComponent *cc, int start, int count, QObject *parent) +QmlComponent::QmlComponent(QmlEngine *engine, QmlCompiledData *cc, int start, int count, QObject *parent) : QObject(*(new QmlComponentPrivate), parent) { Q_D(QmlComponent); diff --git a/src/declarative/qml/qmlcomponent.h b/src/declarative/qml/qmlcomponent.h index 5e6dce9..9c712df 100644 --- a/src/declarative/qml/qmlcomponent.h +++ b/src/declarative/qml/qmlcomponent.h @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QmlCompiledComponent; +class QmlCompiledData; class QByteArray; class QmlComponentPrivate; class QmlEngine; @@ -102,7 +102,7 @@ protected: QmlComponent(QmlComponentPrivate &dd, QObject* parent); private: - QmlComponent(QmlEngine *, QmlCompiledComponent *, int, int, QObject *parent); + QmlComponent(QmlEngine *, QmlCompiledData *, int, int, QObject *parent); friend class QmlVME; friend struct QmlCompositeTypeData; diff --git a/src/declarative/qml/qmlcomponent_p.h b/src/declarative/qml/qmlcomponent_p.h index 0be3dc6..25af342 100644 --- a/src/declarative/qml/qmlcomponent_p.h +++ b/src/declarative/qml/qmlcomponent_p.h @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE class QmlComponent; class QmlEngine; -class QmlCompiledComponent; +class QmlCompiledData; class QmlComponentPrivate : public QObjectPrivate { @@ -86,7 +86,7 @@ public: int start; int count; - QmlCompiledComponent *cc; + QmlCompiledData *cc; QList > bindValues; QList > parserStatus; diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index c7f86ba..9af5c3c 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -41,7 +41,6 @@ #include #include -#include #include #include #include @@ -49,6 +48,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -83,7 +83,7 @@ QmlComponent *QmlCompositeTypeData::toComponent(QmlEngine *engine) { if (!component) { - QmlCompiledComponent *cc = toCompiledComponent(engine); + QmlCompiledData *cc = toCompiledComponent(engine); if (cc) { component = new QmlComponent(engine, cc, -1, -1, 0); } else { @@ -97,12 +97,12 @@ QmlComponent *QmlCompositeTypeData::toComponent(QmlEngine *engine) return component; } -QmlCompiledComponent * +QmlCompiledData * QmlCompositeTypeData::toCompiledComponent(QmlEngine *engine) { if (status == Complete && !compiledComponent) { - compiledComponent = new QmlCompiledComponent; + compiledComponent = new QmlCompiledData; compiledComponent->url = imports.baseUrl(); compiledComponent->name = compiledComponent->url.toString().toLatin1(); // ### diff --git a/src/declarative/qml/qmlcompositetypemanager_p.h b/src/declarative/qml/qmlcompositetypemanager_p.h index a393da4..0685b03 100644 --- a/src/declarative/qml/qmlcompositetypemanager_p.h +++ b/src/declarative/qml/qmlcompositetypemanager_p.h @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE -class QmlCompiledComponent; +class QmlCompiledData; class QmlComponentPrivate; class QmlComponent; class QmlDomDocument; @@ -94,9 +94,9 @@ struct QmlCompositeTypeData : public QmlRefCount // state. The QmlComponent is owned by the QmlCompositeTypeData, so a // reference should be kept to keep the QmlComponent alive. QmlComponent *toComponent(QmlEngine *); - // Return a QmlCompiledComponent if possible, or 0 if an error + // Return a QmlCompiledData if possible, or 0 if an error // occurs - QmlCompiledComponent *toCompiledComponent(QmlEngine *); + QmlCompiledData *toCompiledComponent(QmlEngine *); struct TypeReference { @@ -123,7 +123,7 @@ private: QmlScriptParser data; QList waiters; QmlComponent *component; - QmlCompiledComponent *compiledComponent; + QmlCompiledData *compiledComponent; }; class QmlCompositeTypeManager : public QObject diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index f896873..fc615b6 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -66,7 +66,6 @@ class QmlContext; class QmlExpression; class QmlEngine; class QmlExpression; -class QmlCompiledComponent; class QmlContextPrivate : public QObjectPrivate { diff --git a/src/declarative/qml/qmldeclarativedata_p.h b/src/declarative/qml/qmldeclarativedata_p.h index 559f0ee..b473e77 100644 --- a/src/declarative/qml/qmldeclarativedata_p.h +++ b/src/declarative/qml/qmldeclarativedata_p.h @@ -71,7 +71,7 @@ public: bool create = false); }; -class QmlCompiledComponent; +class QmlCompiledData; class QmlInstanceDeclarativeData : public QmlSimpleDeclarativeData { public: @@ -79,7 +79,7 @@ public: virtual void destroyed(QObject *); - QmlCompiledComponent *deferredComponent; + QmlCompiledData *deferredComponent; unsigned int deferredIdx; static inline QmlInstanceDeclarativeData *get(QObject *object, diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 467d2e9..e3cb563 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -43,7 +43,6 @@ #include "qmldom_p.h" #include "private/qmlcompiler_p.h" #include "private/qmlengine_p.h" -#include "qmlcompiledcomponent_p.h" #include #include #include @@ -165,7 +164,7 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl d->errors.clear(); d->imports.clear(); - QmlCompiledComponent component; + QmlCompiledData component; QmlCompiler compiler; QmlCompositeTypeData *td = ((QmlEnginePrivate *)QmlEnginePrivate::get(engine))->typeManager.getImmediate(data, url); diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 46c8b30..acbeb26 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #ifdef QT_SCRIPTTOOLS_LIB #include @@ -60,7 +61,6 @@ #include #include #include "private/qmlbasicscript_p.h" -#include "private/qmlcompiledcomponent_p.h" #include "qmlengine.h" #include "qmlcontext.h" #include "qmlexpression.h" diff --git a/src/declarative/qml/qmlinstruction.cpp b/src/declarative/qml/qmlinstruction.cpp index 863ff9a..83fb18b 100644 --- a/src/declarative/qml/qmlinstruction.cpp +++ b/src/declarative/qml/qmlinstruction.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ -#include "private/qmlinstruction_p.h" -#include "private/qmlcompiledcomponent_p.h" -#include +#include "qmlinstruction_p.h" +#include "qmlcompiler_p.h" +#include QT_BEGIN_NAMESPACE -void QmlCompiledComponent::dump(QmlInstruction *instr, int idx) +void QmlCompiledData::dump(QmlInstruction *instr, int idx) { QByteArray lineNumber = QByteArray::number(instr->line); if (instr->line == (unsigned short)-1) diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h index 39196a1..a7221c0 100644 --- a/src/declarative/qml/qmlinstruction_p.h +++ b/src/declarative/qml/qmlinstruction_p.h @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE -class QmlCompiledComponent; +class QmlCompiledData; class Q_DECLARATIVE_EXPORT QmlInstruction { public: @@ -272,7 +272,7 @@ public: } defer; }; - void dump(QmlCompiledComponent *); + void dump(QmlCompiledData *); }; QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index dfb066b..3b33686 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qmlvme_p.h" +#include "qmlcompiler_p.h" #include #include #include @@ -49,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -98,7 +98,7 @@ struct ListInstance QmlPrivate::ListInterface *qmlListInterface; }; -QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, int count) +QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledData *comp, int start, int count) { QStack stack; @@ -117,7 +117,7 @@ void QmlVME::runDeferred(QObject *object) QmlContext *ctxt = data->context; ctxt->activate(); - QmlCompiledComponent *comp = data->deferredComponent; + QmlCompiledData *comp = data->deferredComponent; int start = data->deferredIdx + 1; int count = data->deferredComponent->bytecode.at(data->deferredIdx).defer.deferCount; QStack stack; @@ -127,7 +127,7 @@ void QmlVME::runDeferred(QObject *object) ctxt->deactivate(); } -QObject *QmlVME::run(QStack &stack, QmlContext *ctxt, QmlCompiledComponent *comp, int start, int count) +QObject *QmlVME::run(QStack &stack, QmlContext *ctxt, QmlCompiledData *comp, int start, int count) { // XXX - All instances of QmlContext::activeContext() here should be // replaced with the use of ctxt. However, this cannot be done until @@ -137,10 +137,9 @@ QObject *QmlVME::run(QStack &stack, QmlContext *ctxt, QmlCompiledComp // sub-instances on that type. Q_ASSERT(comp); Q_ASSERT(ctxt); - const QList &types = comp->types; + const QList &types = comp->types; const QList &primitives = comp->primitives; const QList &datas = comp->datas; - const QList &synthesizedMetaObjects = comp->synthesizedMetaObjects;; const QList &customTypeData = comp->customTypeData; const QList &intData = comp->intData; const QList &floatData = comp->floatData; @@ -237,8 +236,6 @@ QObject *QmlVME::run(QStack &stack, QmlContext *ctxt, QmlCompiledComp const QmlVMEMetaData *data = (const QmlVMEMetaData *)datas.at(instr.storeMeta.aliasData).constData(); (void)new QmlVMEMetaObject(target, &mo, data, comp); - - // new QmlVMEMetaObject(target, synthesizedMetaObjects.at(instr.storeMeta.data), &comp->primitives, instr.storeMeta.slotData, (const QmlVMEMetaData *)datas.at(instr.storeMeta.aliasData).constData(), comp); } break; @@ -464,7 +461,7 @@ QObject *QmlVME::run(QStack &stack, QmlContext *ctxt, QmlCompiledComp { QObject *target = stack.top(); void *a[1]; - QmlCompiledComponent::CustomTypeData data = customTypeData.at(instr.assignCustomType.valueIndex); + QmlCompiledData::CustomTypeData data = customTypeData.at(instr.assignCustomType.valueIndex); const QString &primitive = primitives.at(data.index); QmlMetaType::StringConverter converter = QmlMetaType::customStringConverter(data.type); @@ -776,7 +773,7 @@ QObject *QmlVME::run(QStack &stack, QmlContext *ctxt, QmlCompiledComp break; default: - qFatal("QmlCompiledComponent: Internal error - unknown instruction %d", instr.type); + qFatal("QmlCompiledData: Internal error - unknown instruction %d", instr.type); break; } } diff --git a/src/declarative/qml/qmlvme_p.h b/src/declarative/qml/qmlvme_p.h index 2da7bb4..30a6e4f 100644 --- a/src/declarative/qml/qmlvme_p.h +++ b/src/declarative/qml/qmlvme_p.h @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE class QObject; class QmlInstruction; -class QmlCompiledComponent; +class QmlCompiledData; class QmlCompiledData; class QmlContext; @@ -70,14 +70,14 @@ class QmlVME public: QmlVME(); - QObject *run(QmlContext *, QmlCompiledComponent *, int start = -1, int count = -1); + QObject *run(QmlContext *, QmlCompiledData *, int start = -1, int count = -1); void runDeferred(QObject *); bool isError() const; QList errors() const; private: - QObject *run(QStack &, QmlContext *, QmlCompiledComponent *, int start, int count); + QObject *run(QStack &, QmlContext *, QmlCompiledData *, int start, int count); QList vmeErrors; }; -- cgit v0.12