summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/parser/qdeclarativejsast_p.h149
-rw-r--r--src/declarative/qml/qdeclarative.h2
-rw-r--r--src/declarative/qml/qdeclarativeclassfactory.cpp50
-rw-r--r--src/declarative/qml/qdeclarativeclassfactory_p.h74
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp10
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp4
-rw-r--r--src/declarative/qml/qdeclarativedom.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp34
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp2
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp1
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp25
-rw-r--r--src/declarative/qml/qdeclarativemetatype_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp4
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp2
-rw-r--r--src/declarative/qml/qdeclarativetypenotavailable.cpp4
-rw-r--r--src/declarative/qml/qdeclarativevaluetype.cpp12
-rw-r--r--src/declarative/qml/qml.pri2
-rw-r--r--src/declarative/qml/rewriter/rewriter.cpp102
-rw-r--r--src/declarative/qml/rewriter/rewriter.pri5
-rw-r--r--src/declarative/qml/rewriter/rewriter_p.h153
23 files changed, 77 insertions, 568 deletions
diff --git a/src/declarative/qml/parser/qdeclarativejsast_p.h b/src/declarative/qml/parser/qdeclarativejsast_p.h
index 0623a2a..541ea7f 100644
--- a/src/declarative/qml/parser/qdeclarativejsast_p.h
+++ b/src/declarative/qml/parser/qdeclarativejsast_p.h
@@ -224,6 +224,9 @@ public:
inline Node()
: kind(Kind_Undefined) {}
+ // NOTE: node destructors are never called,
+ // instead we block free the memory
+ // (see the NodePool class)
virtual ~Node() {}
virtual ExpressionNode *expressionCast();
@@ -247,7 +250,6 @@ class QML_PARSER_EXPORT ExpressionNode: public Node
{
public:
ExpressionNode() {}
- virtual ~ExpressionNode() {}
virtual ExpressionNode *expressionCast();
@@ -259,7 +261,6 @@ class QML_PARSER_EXPORT Statement: public Node
{
public:
Statement() {}
- virtual ~Statement() {}
virtual Statement *statementCast();
@@ -379,7 +380,6 @@ public:
QDECLARATIVEJS_DECLARE_AST_NODE(ThisExpression)
ThisExpression() { kind = K; }
- virtual ~ThisExpression() {}
virtual void accept0(Visitor *visitor);
@@ -401,8 +401,6 @@ public:
IdentifierExpression(NameId *n):
name (n) { kind = K; }
- virtual ~IdentifierExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -422,7 +420,6 @@ public:
QDECLARATIVEJS_DECLARE_AST_NODE(NullExpression)
NullExpression() { kind = K; }
- virtual ~NullExpression() {}
virtual void accept0(Visitor *visitor);
@@ -442,7 +439,6 @@ public:
QDECLARATIVEJS_DECLARE_AST_NODE(TrueLiteral)
TrueLiteral() { kind = K; }
- virtual ~TrueLiteral() {}
virtual void accept0(Visitor *visitor);
@@ -462,7 +458,6 @@ public:
QDECLARATIVEJS_DECLARE_AST_NODE(FalseLiteral)
FalseLiteral() { kind = K; }
- virtual ~FalseLiteral() {}
virtual void accept0(Visitor *visitor);
@@ -483,7 +478,6 @@ public:
NumericLiteral(double v):
value(v) { kind = K; }
- virtual ~NumericLiteral() {}
virtual void accept0(Visitor *visitor);
@@ -506,8 +500,6 @@ public:
StringLiteral(NameId *v):
value (v) { kind = K; }
- virtual ~StringLiteral() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -529,8 +521,6 @@ public:
RegExpLiteral(NameId *p, int f):
pattern (p), flags (f) { kind = K; }
- virtual ~RegExpLiteral() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -562,8 +552,6 @@ public:
elements (elts), elision (e)
{ kind = K; }
- virtual ~ArrayLiteral() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -591,8 +579,6 @@ public:
ObjectLiteral(PropertyNameAndValueList *plist):
properties (plist) { kind = K; }
- virtual ~ObjectLiteral() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -624,8 +610,6 @@ public:
previous->next = this;
}
- virtual ~ElementList() {}
-
inline ElementList *finish ()
{
ElementList *front = next;
@@ -657,8 +641,6 @@ public:
previous->next = this;
}
- virtual ~Elision() {}
-
virtual void accept0(Visitor *visitor);
inline Elision *finish ()
@@ -690,8 +672,6 @@ public:
previous->next = this;
}
- virtual ~PropertyNameAndValueList() {}
-
virtual void accept0(Visitor *visitor);
inline PropertyNameAndValueList *finish ()
@@ -715,7 +695,6 @@ public:
QDECLARATIVEJS_DECLARE_AST_NODE(PropertyName)
PropertyName() { kind = K; }
- virtual ~PropertyName() {}
// attributes
SourceLocation propertyNameToken;
@@ -729,8 +708,6 @@ public:
IdentifierPropertyName(NameId *n):
id (n) { kind = K; }
- virtual ~IdentifierPropertyName() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -744,7 +721,6 @@ public:
StringLiteralPropertyName(NameId *n):
id (n) { kind = K; }
- virtual ~StringLiteralPropertyName() {}
virtual void accept0(Visitor *visitor);
@@ -759,7 +735,6 @@ public:
NumericLiteralPropertyName(double n):
id (n) { kind = K; }
- virtual ~NumericLiteralPropertyName() {}
virtual void accept0(Visitor *visitor);
@@ -776,8 +751,6 @@ public:
base (b), expression (e)
{ kind = K; }
- virtual ~ArrayMemberExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -802,8 +775,6 @@ public:
base (b), name (n)
{ kind = K; }
- virtual ~FieldMemberExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -828,8 +799,6 @@ public:
base (b), arguments (a)
{ kind = K; }
- virtual ~NewMemberExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -854,8 +823,6 @@ public:
NewExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~NewExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -878,8 +845,6 @@ public:
base (b), arguments (a)
{ kind = K; }
- virtual ~CallExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -912,8 +877,6 @@ public:
previous->next = this;
}
- virtual ~ArgumentList() {}
-
virtual void accept0(Visitor *visitor);
inline ArgumentList *finish ()
@@ -937,8 +900,6 @@ public:
PostIncrementExpression(ExpressionNode *b):
base (b) { kind = K; }
- virtual ~PostIncrementExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -960,8 +921,6 @@ public:
PostDecrementExpression(ExpressionNode *b):
base (b) { kind = K; }
- virtual ~PostDecrementExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -982,7 +941,6 @@ public:
DeleteExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~DeleteExpression() {}
virtual void accept0(Visitor *visitor);
@@ -1005,8 +963,6 @@ public:
VoidExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~VoidExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1028,8 +984,6 @@ public:
TypeOfExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~TypeOfExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1051,8 +1005,6 @@ public:
PreIncrementExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~PreIncrementExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1074,8 +1026,6 @@ public:
PreDecrementExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~PreDecrementExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1097,8 +1047,6 @@ public:
UnaryPlusExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~UnaryPlusExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1120,8 +1068,6 @@ public:
UnaryMinusExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~UnaryMinusExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1143,8 +1089,6 @@ public:
TildeExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~TildeExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1166,8 +1110,6 @@ public:
NotExpression(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~NotExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1190,8 +1132,6 @@ public:
left (l), op (o), right (r)
{ kind = K; }
- virtual ~BinaryExpression() {}
-
virtual BinaryExpression *binaryExpressionCast();
virtual void accept0(Visitor *visitor);
@@ -1218,8 +1158,6 @@ public:
expression (e), ok (t), ko (f)
{ kind = K; }
- virtual ~ConditionalExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1244,8 +1182,6 @@ public:
Expression(ExpressionNode *l, ExpressionNode *r):
left (l), right (r) { kind = K; }
- virtual ~Expression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1268,8 +1204,6 @@ public:
Block(StatementList *slist):
statements (slist) { kind = K; }
- virtual ~Block() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1301,8 +1235,6 @@ public:
previous->next = this;
}
- virtual ~StatementList() {}
-
virtual void accept0(Visitor *visitor);
inline StatementList *finish ()
@@ -1326,8 +1258,6 @@ public:
declarations (vlist)
{ kind = K; }
- virtual ~VariableStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1351,8 +1281,6 @@ public:
name (n), expression (e), readOnly(false)
{ kind = K; }
- virtual ~VariableDeclaration() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -1379,8 +1307,6 @@ public:
previous->next = this;
}
- virtual ~VariableDeclarationList() {}
-
virtual void accept0(Visitor *visitor);
inline VariableDeclarationList *finish (bool readOnly)
@@ -1407,7 +1333,6 @@ public:
QDECLARATIVEJS_DECLARE_AST_NODE(EmptyStatement)
EmptyStatement() { kind = K; }
- virtual ~EmptyStatement() {}
virtual void accept0(Visitor *visitor);
@@ -1429,8 +1354,6 @@ public:
ExpressionStatement(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~ExpressionStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1453,8 +1376,6 @@ public:
expression (e), ok (t), ko (f)
{ kind = K; }
- virtual ~IfStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1487,8 +1408,6 @@ public:
statement (stmt), expression (e)
{ kind = K; }
- virtual ~DoWhileStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1516,8 +1435,6 @@ public:
expression (e), statement (stmt)
{ kind = K; }
- virtual ~WhileStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1543,8 +1460,6 @@ public:
initialiser (i), condition (c), expression (e), statement (stmt)
{ kind = K; }
- virtual ~ForStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1574,8 +1489,6 @@ public:
declarations (vlist), condition (c), expression (e), statement (stmt)
{ kind = K; }
- virtual ~LocalForStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1606,8 +1519,6 @@ public:
initialiser (i), expression (e), statement (stmt)
{ kind = K; }
- virtual ~ForEachStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1635,8 +1546,6 @@ public:
declaration (v), expression (e), statement (stmt)
{ kind = K; }
- virtual ~LocalForEachStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1664,8 +1573,6 @@ public:
ContinueStatement(NameId *l = 0):
label (l) { kind = K; }
- virtual ~ContinueStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1689,8 +1596,6 @@ public:
BreakStatement(NameId *l = 0):
label (l) { kind = K; }
- virtual ~BreakStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1714,8 +1619,6 @@ public:
ReturnStatement(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~ReturnStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1739,8 +1642,6 @@ public:
expression (e), statement (stmt)
{ kind = K; }
- virtual ~WithStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1766,8 +1667,6 @@ public:
clauses (c), defaultClause (d), moreClauses (r)
{ kind = K; }
- virtual ~CaseBlock() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -1787,8 +1686,6 @@ public:
expression (e), block (b)
{ kind = K; }
- virtual ~SwitchStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1822,8 +1719,6 @@ public:
previous->next = this;
}
- virtual ~CaseClauses() {}
-
virtual void accept0(Visitor *visitor);
inline CaseClauses *finish ()
@@ -1847,8 +1742,6 @@ public:
expression (e), statements (slist)
{ kind = K; }
- virtual ~CaseClause() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -1867,8 +1760,6 @@ public:
statements (slist)
{ kind = K; }
- virtual ~DefaultClause() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -1886,8 +1777,6 @@ public:
label (l), statement (stmt)
{ kind = K; }
- virtual ~LabelledStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1911,8 +1800,6 @@ public:
ThrowStatement(ExpressionNode *e):
expression (e) { kind = K; }
- virtual ~ThrowStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -1936,8 +1823,6 @@ public:
name (n), statement (stmt)
{ kind = K; }
- virtual ~Catch() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -1958,8 +1843,6 @@ public:
statement (stmt)
{ kind = K; }
- virtual ~Finally() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -1984,8 +1867,6 @@ public:
statement (stmt), catchExpression (c), finallyExpression (0)
{ kind = K; }
- virtual ~TryStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -2017,8 +1898,6 @@ public:
name (n), formals (f), body (b)
{ kind = K; }
- virtual ~FunctionExpression() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -2048,8 +1927,6 @@ public:
FunctionExpression(n, f, b)
{ kind = K; }
- virtual ~FunctionDeclaration() {}
-
virtual void accept0(Visitor *visitor);
};
@@ -2070,8 +1947,6 @@ public:
previous->next = this;
}
- virtual ~FormalParameterList() {}
-
virtual void accept0(Visitor *visitor);
inline FormalParameterList *finish ()
@@ -2097,8 +1972,6 @@ public:
elements (elts)
{ kind = K; }
- virtual ~FunctionBody() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -2114,8 +1987,6 @@ public:
elements (elts)
{ kind = K; }
- virtual ~Program() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -2139,8 +2010,6 @@ public:
previous->next = this;
}
- virtual ~SourceElements() {}
-
virtual void accept0(Visitor *visitor);
inline SourceElements *finish ()
@@ -2162,8 +2031,6 @@ public:
inline SourceElement()
{ kind = K; }
-
- virtual ~SourceElement() {}
};
class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
@@ -2175,8 +2042,6 @@ public:
declaration (f)
{ kind = K; }
- virtual ~FunctionSourceElement() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -2192,8 +2057,6 @@ public:
statement (stmt)
{ kind = K; }
- virtual ~StatementSourceElement() {}
-
virtual void accept0(Visitor *visitor);
// attributes
@@ -2208,8 +2071,6 @@ public:
DebuggerStatement()
{ kind = K; }
- virtual ~DebuggerStatement() {}
-
virtual void accept0(Visitor *visitor);
virtual SourceLocation firstSourceLocation() const
@@ -2256,8 +2117,6 @@ public:
previous->next = this;
}
- virtual ~UiQualifiedId() {}
-
UiQualifiedId *finish()
{
UiQualifiedId *head = next;
@@ -2459,8 +2318,6 @@ public:
previous->next = this;
}
- virtual ~UiParameterList() {}
-
virtual void accept0(Visitor *) {}
inline UiParameterList *finish ()
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index 985ab72..f0c62f4 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -119,7 +119,7 @@ int qmlRegisterType()
return QDeclarativePrivate::qmlregister(QDeclarativePrivate::TypeRegistration, &type);
}
-int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message);
+int Q_AUTOTEST_EXPORT qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message);
template<typename T>
int qmlRegisterUncreatableType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& reason)
diff --git a/src/declarative/qml/qdeclarativeclassfactory.cpp b/src/declarative/qml/qdeclarativeclassfactory.cpp
deleted file mode 100644
index 798eacd..0000000
--- a/src/declarative/qml/qdeclarativeclassfactory.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 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$
-** 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 Technology Preview License Agreement accompanying
-** this package.
-**
-** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "private/qdeclarativeclassfactory_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QDeclarativeClassFactory::~QDeclarativeClassFactory()
-{
-}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeclassfactory_p.h b/src/declarative/qml/qdeclarativeclassfactory_p.h
deleted file mode 100644
index 9f4a3de..0000000
--- a/src/declarative/qml/qdeclarativeclassfactory_p.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 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$
-** 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 Technology Preview License Agreement accompanying
-** this package.
-**
-** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVECLASSFACTORY_P_H
-#define QDECLARATIVECLASSFACTORY_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 <QtCore/qglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeEngine;
-class QByteArray;
-class QUrl;
-class QDeclarativeComponent;
-
-class QDeclarativeClassFactory
-{
-public:
- virtual ~QDeclarativeClassFactory();
- virtual QDeclarativeComponent *create(const QByteArray &, const QUrl& baseUrl, QDeclarativeEngine*) = 0;
-};
-
-QT_END_NAMESPACE
-
-#endif // QDECLARATIVECLASSFACTORY_P_H
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 9402596..5f0fd56 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -438,7 +438,7 @@ struct Instr {
qint8 output;
qint8 reg;
quint8 exceptionId;
- quint32 index;
+ quint32 id;
} attached;
struct {
QML_INSTR_HEADER
@@ -988,7 +988,7 @@ static void dumpInstruction(const Instr *instr)
qWarning().nospace() << "\t" << "LoadRoot" << "\t\t" << instr->load.index << "\t" << instr->load.reg;
break;
case Instr::LoadAttached:
- qWarning().nospace() << "\t" << "LoadAttached" << "\t\t" << instr->attached.output << "\t" << instr->attached.reg << "\t" << instr->attached.index;
+ qWarning().nospace() << "\t" << "LoadAttached" << "\t\t" << instr->attached.output << "\t" << instr->attached.reg << "\t" << instr->attached.id;
break;
case Instr::ConvertIntToReal:
qWarning().nospace() << "\t" << "ConvertIntToReal" << "\t" << instr->unaryop.output << "\t" << instr->unaryop.src;
@@ -1225,7 +1225,7 @@ void QDeclarativeCompiledBindingsPrivate::run(int instrIndex,
output.setUndefined();
} else {
QObject *attached =
- qmlAttachedPropertiesObjectById(instr->attached.index,
+ qmlAttachedPropertiesObjectById(instr->attached.id,
registers[instr->attached.reg].getQObject(),
true);
Q_ASSERT(attached);
@@ -1895,7 +1895,7 @@ bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type
attach.common.type = Instr::LoadAttached;
attach.attached.output = reg;
attach.attached.reg = reg;
- attach.attached.index = attachType->index();
+ attach.attached.id = attachType->attachedPropertiesId();
attach.attached.exceptionId = exceptionId(nameNodes.at(ii));
bytecode << attach;
@@ -2011,7 +2011,7 @@ bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type
attach.common.type = Instr::LoadAttached;
attach.attached.output = reg;
attach.attached.reg = reg;
- attach.attached.index = attachType->index();
+ attach.attached.id = attachType->attachedPropertiesId();
bytecode << attach;
absType = 0;
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index e55dc92..90d38b3 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -1286,7 +1286,7 @@ bool QDeclarativeCompiler::buildSubObject(Object *obj, const BindingContext &ctx
int QDeclarativeCompiler::componentTypeRef()
{
- QDeclarativeType *t = QDeclarativeMetaType::qmlType("Qt/Component",4,7);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType("QtQuick/Component",1,0);
for (int ii = output->types.count() - 1; ii >= 0; --ii) {
if (output->types.at(ii).type == t)
return ii;
@@ -1407,7 +1407,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
COMPILE_EXCEPTION(prop, tr("Invalid attached object assignment"));
Q_ASSERT(type->attachedPropertiesFunction());
- prop->index = type->index();
+ prop->index = type->attachedPropertiesId();
prop->value->metatype = type->attachedPropertiesType();
} else {
// Setup regular property data
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 7f58166..b532b0c 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -78,7 +78,7 @@ class QByteArray;
For example, if there is a \c main.qml file like this:
\qml
- import Qt 4.7
+ import QtQuick 1.0
Item {
width: 200
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index de45a95..59d5cfa 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -85,7 +85,7 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate()
context->setContextProperty("myModel", &modelData);
QDeclarativeComponent component(&engine);
- component.setData("import Qt 4.7\nListView { model: myModel }", QUrl());
+ component.setData("import QtQuick 1.0\nListView { model: myModel }", QUrl());
component.create(context);
\endcode
@@ -112,7 +112,7 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate()
context->setContextObject(&myDataSet);
QDeclarativeComponent component(&engine);
- component.setData("import Qt 4.7\nListView { model: myModel }", QUrl());
+ component.setData("import QtQuick 1.0\nListView { model: myModel }", QUrl());
component.create(context);
\endcode
diff --git a/src/declarative/qml/qdeclarativedom.cpp b/src/declarative/qml/qdeclarativedom.cpp
index 1a9b501..fa79425 100644
--- a/src/declarative/qml/qdeclarativedom.cpp
+++ b/src/declarative/qml/qdeclarativedom.cpp
@@ -896,7 +896,7 @@ QByteArray QDeclarativeDomObject::customTypeData() const
*/
bool QDeclarativeDomObject::isComponent() const
{
- return (d->object && d->object->typeName == "Qt/Component");
+ return (d->object && (d->object->typeName == "Qt/Component" || d->object->typeName == "QtQuick/Component"));
}
/*!
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 06b1ed3..9ca7858 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -141,7 +141,7 @@ QT_BEGIN_NAMESPACE
\qml
// MyRect.qml
- import Qt 4.7
+ import QtQuick 1.0
Item {
width: 200; height: 200
@@ -177,9 +177,15 @@ static bool qt_QmlQtModule_registered = false;
void QDeclarativeEnginePrivate::defineModule()
{
+ qmlRegisterType<QDeclarativeComponent>("QtQuick",1,0,"Component");
+ qmlRegisterType<QObject>("QtQuick",1,0,"QtObject");
+ qmlRegisterType<QDeclarativeWorkerScript>("QtQuick",1,0,"WorkerScript");
+
+#ifndef QT_NO_IMPORT_QT47_QML
qmlRegisterType<QDeclarativeComponent>("Qt",4,7,"Component");
qmlRegisterType<QObject>("Qt",4,7,"QtObject");
qmlRegisterType<QDeclarativeWorkerScript>("Qt",4,7,"WorkerScript");
+#endif
qmlRegisterType<QDeclarativeBinding>();
}
@@ -198,10 +204,10 @@ with enums and functions. To use it, call the members of the global \c Qt objec
For example:
\qml
-import Qt 4.7
+import QtQuick 1.0
Text {
- color: Qt.rgba(255, 0, 0, 1)
+ color: Qt.rgba(1, 0, 0, 1)
text: Qt.md5("hello, world")
}
\endqml
@@ -278,9 +284,11 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
QUrl QDeclarativeScriptEngine::resolvedUrl(QScriptContext *context, const QUrl& url)
{
if (p) {
- QDeclarativeContextData *ctxt = QDeclarativeEnginePrivate::get(this)->getContext(context);
- Q_ASSERT(ctxt);
- return ctxt->resolvedUrl(url);
+ QDeclarativeContextData *ctxt = p->getContext(context);
+ if (ctxt)
+ return ctxt->resolvedUrl(url);
+ else
+ return p->getUrl(context).resolved(url);
}
return baseUrl.resolved(url);
}
@@ -510,7 +518,7 @@ QDeclarativeWorkerScriptEngine *QDeclarativeEnginePrivate::getWorkerScriptEngine
\code
QDeclarativeEngine engine;
QDeclarativeComponent component(&engine);
- component.setData("import Qt 4.7\nText { text: \"Hello world!\" }", QUrl());
+ component.setData("import QtQuick 1.0\nText { text: \"Hello world!\" }", QUrl());
QDeclarativeItem *item = qobject_cast<QDeclarativeItem *>(component.create());
//add item to view, etc
@@ -1140,12 +1148,8 @@ QScriptValue QDeclarativeEnginePrivate::createComponent(QScriptContext *ctxt, QS
QString arg = ctxt->argument(0).toString();
if (arg.isEmpty())
return engine->nullValue();
- QUrl url;
+ QUrl url = QDeclarativeScriptEngine::get(engine)->resolvedUrl(ctxt, QUrl(arg));
QDeclarativeContextData* context = activeEnginePriv->getContext(ctxt);
- if (context)
- url = QUrl(context->resolvedUrl(QUrl(arg)));
- else
- url = activeEnginePriv->getUrl(ctxt).resolved(QUrl(arg));
QDeclarativeComponent *c = new QDeclarativeComponent(activeEngine, url, activeEngine);
QDeclarativeComponentPrivate::get(c)->creationContext = context;
QDeclarativeData::get(c, true)->setImplicitDestructible();
@@ -1629,7 +1633,7 @@ QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QSc
return QScriptValue(e, false);
bool ret = false;
#ifndef QT_NO_DESKTOPSERVICES
- ret = QDesktopServices::openUrl(QUrl(ctxt->argument(0).toString()));
+ ret = QDesktopServices::openUrl(QDeclarativeScriptEngine::get(e)->resolvedUrl(ctxt, QUrl(ctxt->argument(0).toString())));
#endif
return QScriptValue(e, ret);
}
@@ -1783,7 +1787,9 @@ void QDeclarativeEnginePrivate::warning(QDeclarativeEnginePrivate *engine, const
/*!
\qmlmethod Qt::quit()
This function causes the QDeclarativeEngine::quit() signal to be emitted.
-Within the \l {QML Viewer}, this causes the launcher application to exit.
+Within the \l {QML Viewer}, this causes the launcher application to exit;
+to quit a C++ application when this method is called, connect the
+QDeclarativeEngine::quit() signal to the QCoreApplication::quit() slot.
*/
QScriptValue QDeclarativeEnginePrivate::quit(QScriptContext * /*ctxt*/, QScriptEngine *e)
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index dc7315d..8539fbf 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -55,7 +55,6 @@
#include "qdeclarativeengine.h"
-#include "private/qdeclarativeclassfactory_p.h"
#include "private/qdeclarativetypeloader_p.h"
#include "private/qdeclarativeimport_p.h"
#include "private/qpodvector_p.h"
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index 6fc4df0..77a1ba4 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -202,7 +202,7 @@ QScriptValue QDeclarativeExpressionPrivate::evalInObjectScope(QDeclarativeContex
For example, given a file \c main.qml like this:
\qml
- import Qt 4.7
+ import QtQuick 1.0
Item {
width: 200; height: 200
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index 8f95e26..fe4ed48 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -876,6 +876,7 @@ void QDeclarativeImportDatabase::addImportPath(const QString& path)
cPath = dir.canonicalPath();
} else {
cPath = path;
+ cPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
}
if (!cPath.isEmpty()
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index a5c878f..7a78a1f 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -146,6 +146,7 @@ public:
const QMetaObject *m_baseMetaObject;
QDeclarativeAttachedPropertiesFunc m_attachedPropertiesFunc;
const QMetaObject *m_attachedPropertiesType;
+ int m_attachedPropertiesId;
int m_parserStatusCast;
int m_propertyValueSourceCast;
int m_propertyValueInterceptorCast;
@@ -155,8 +156,12 @@ public:
QDeclarativeCustomParser *m_customParser;
mutable volatile bool m_isSetup:1;
mutable QList<QDeclarativeProxyMetaObject::ProxyData> m_metaObjects;
+
+ static QHash<const QMetaObject *, int> m_attachedPropertyIds;
};
+QHash<const QMetaObject *, int> QDeclarativeTypePrivate::m_attachedPropertyIds;
+
QDeclarativeTypePrivate::QDeclarativeTypePrivate()
: m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0),
m_allocationSize(0), m_newFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), m_attachedPropertiesType(0),
@@ -198,6 +203,14 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe
d->m_baseMetaObject = type.metaObject;
d->m_attachedPropertiesFunc = type.attachedPropertiesFunction;
d->m_attachedPropertiesType = type.attachedPropertiesMetaObject;
+ if (d->m_attachedPropertiesType) {
+ QHash<const QMetaObject *, int>::Iterator iter = d->m_attachedPropertyIds.find(d->m_baseMetaObject);
+ if (iter == d->m_attachedPropertyIds.end())
+ iter = d->m_attachedPropertyIds.insert(d->m_baseMetaObject, index);
+ d->m_attachedPropertiesId = *iter;
+ } else {
+ d->m_attachedPropertiesId = -1;
+ }
d->m_parserStatusCast = type.parserStatusCast;
d->m_propertyValueSourceCast = type.valueSourceCast;
d->m_propertyValueInterceptorCast = type.valueInterceptorCast;
@@ -461,6 +474,16 @@ const QMetaObject *QDeclarativeType::attachedPropertiesType() const
return d->m_attachedPropertiesType;
}
+/*
+This is the id passed to qmlAttachedPropertiesById(). This is different from the index
+for the case that a single class is registered under two or more names (eg. Item in
+Qt 4.7 and QtQuick 1.0).
+*/
+int QDeclarativeType::attachedPropertiesId() const
+{
+ return d->m_attachedPropertiesId;
+}
+
int QDeclarativeType::parserStatusCast() const
{
return d->m_parserStatusCast;
@@ -662,7 +685,7 @@ int QDeclarativeMetaType::attachedPropertiesFuncId(const QMetaObject *mo)
QDeclarativeType *type = data->metaObjectToType.value(mo);
if (type && type->attachedPropertiesFunction())
- return type->index();
+ return type->attachedPropertiesId();
else
return -1;
}
diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h
index f410547..382abd2 100644
--- a/src/declarative/qml/qdeclarativemetatype_p.h
+++ b/src/declarative/qml/qdeclarativemetatype_p.h
@@ -137,6 +137,7 @@ public:
QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction() const;
const QMetaObject *attachedPropertiesType() const;
+ int attachedPropertiesId() const;
int parserStatusCast() const;
QVariant fromObject(QObject *) const;
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index d0dd2e8..bc20bff 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -220,7 +220,7 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name
QDeclarativeAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
if (!func) return; // Not an attachable type
- currentObject = qmlAttachedPropertiesObjectById(data->type->index(), currentObject);
+ currentObject = qmlAttachedPropertiesObjectById(data->type->attachedPropertiesId(), currentObject);
if (!currentObject) return; // Something is broken with the attachable type
} else {
Q_ASSERT(data->typeNamespace);
@@ -232,7 +232,7 @@ void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name
QDeclarativeAttachedPropertiesFunc func = data->type->attachedPropertiesFunction();
if (!func) return; // Not an attachable type
- currentObject = qmlAttachedPropertiesObjectById(data->type->index(), currentObject);
+ currentObject = qmlAttachedPropertiesObjectById(data->type->attachedPropertiesId(), currentObject);
if (!currentObject) return; // Something is broken with the attachable type
}
} else {
diff --git a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
index 764a8db..cba7b4a 100644
--- a/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
+++ b/src/declarative/qml/qdeclarativetypenamescriptclass.cpp
@@ -129,7 +129,7 @@ QDeclarativeTypeNameScriptClass::queryProperty(Object *obj, const Identifier &na
return 0;
} else if (data->object) {
// Must be an attached property
- object = qmlAttachedPropertiesObjectById(data->type->index(), data->object);
+ object = qmlAttachedPropertiesObjectById(data->type->attachedPropertiesId(), data->object);
if (!object) return 0;
return ep->objectClass->queryProperty(object, name, flags, 0);
}
diff --git a/src/declarative/qml/qdeclarativetypenotavailable.cpp b/src/declarative/qml/qdeclarativetypenotavailable.cpp
index 7a84732..9b79d70 100644
--- a/src/declarative/qml/qdeclarativetypenotavailable.cpp
+++ b/src/declarative/qml/qdeclarativetypenotavailable.cpp
@@ -41,9 +41,13 @@
#include "qdeclarativetypenotavailable_p.h"
+QT_BEGIN_NAMESPACE
+
int qmlRegisterTypeNotAvailable(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const QString& message)
{
return qmlRegisterUncreatableType<QDeclarativeTypeNotAvailable>(uri,versionMajor,versionMinor,qmlName,message);
}
QDeclarativeTypeNotAvailable::QDeclarativeTypeNotAvailable() { }
+
+QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
index fda62ee..b9e9cec 100644
--- a/src/declarative/qml/qdeclarativevaluetype.cpp
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
Q_GUI_EXPORT int qt_defaultDpi();
template<typename T>
-int qmlRegisterValueTypeEnums(const char *qmlName)
+int qmlRegisterValueTypeEnums(const char *uri, int versionMajor, int versionMinor, const char *qmlName)
{
QByteArray name(T::staticMetaObject.className());
@@ -63,7 +63,7 @@ int qmlRegisterValueTypeEnums(const char *qmlName)
QString(),
- "Qt", 4, 7, qmlName, &T::staticMetaObject,
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
0, 0,
@@ -99,8 +99,12 @@ bool QDeclarativeValueTypeFactory::isValueType(int idx)
void QDeclarativeValueTypeFactory::registerValueTypes()
{
- qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("Easing");
- qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("Font");
+ qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("QtQuick",1,0,"Easing");
+ qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("QtQuick",1,0,"Font");
+#ifndef QT_NO_IMPORT_QT47_QML
+ qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("Qt",4,7,"Easing");
+ qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("Qt",4,7,"Font");
+#endif
}
QDeclarativeValueType *QDeclarativeValueTypeFactory::valueType(int t)
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
index 687ff52..66b69f9 100644
--- a/src/declarative/qml/qml.pri
+++ b/src/declarative/qml/qml.pri
@@ -22,7 +22,6 @@ SOURCES += \
$$PWD/qdeclarativerefcount.cpp \
$$PWD/qdeclarativemetatype.cpp \
$$PWD/qdeclarativestringconverters.cpp \
- $$PWD/qdeclarativeclassfactory.cpp \
$$PWD/qdeclarativeparserstatus.cpp \
$$PWD/qdeclarativetypeloader.cpp \
$$PWD/qdeclarativeinfo.cpp \
@@ -89,7 +88,6 @@ HEADERS += \
$$PWD/qdeclarativecontext.h \
$$PWD/qdeclarativeexpression.h \
$$PWD/qdeclarativestringconverters_p.h \
- $$PWD/qdeclarativeclassfactory_p.h \
$$PWD/qdeclarativeinfo.h \
$$PWD/qdeclarativeproperty_p.h \
$$PWD/qdeclarativecontext_p.h \
diff --git a/src/declarative/qml/rewriter/rewriter.cpp b/src/declarative/qml/rewriter/rewriter.cpp
deleted file mode 100644
index 6d2ccfb..0000000
--- a/src/declarative/qml/rewriter/rewriter.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 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$
-** 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 Technology Preview License Agreement accompanying
-** this package.
-**
-** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "private/rewriter_p.h"
-
-#include <qdeclarativejsast_p.h>
-
-QT_QML_BEGIN_NAMESPACE
-
-using namespace QDeclarativeJS;
-
-void Rewriter::replace(const AST::SourceLocation &loc, const QString &text)
-{ replace(loc.offset, loc.length, text); }
-
-void Rewriter::remove(const AST::SourceLocation &loc)
-{ return replace(loc.offset, loc.length, QString()); }
-
-void Rewriter::remove(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc)
-{ return replace(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, QString()); }
-
-void Rewriter::insertTextBefore(const AST::SourceLocation &loc, const QString &text)
-{ replace(loc.offset, 0, text); }
-
-void Rewriter::insertTextAfter(const AST::SourceLocation &loc, const QString &text)
-{ replace(loc.offset + loc.length, 0, text); }
-
-void Rewriter::replace(int offset, int length, const QString &text)
-{ textWriter.replace(offset, length, text); }
-
-void Rewriter::insertText(int offset, const QString &text)
-{ replace(offset, 0, text); }
-
-void Rewriter::removeText(int offset, int length)
-{ replace(offset, length, QString()); }
-
-QString Rewriter::textAt(const AST::SourceLocation &loc) const
-{ return _code.mid(loc.offset, loc.length); }
-
-QString Rewriter::textAt(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc) const
-{ return _code.mid(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset); }
-
-void Rewriter::accept(QDeclarativeJS::AST::Node *node)
-{ QDeclarativeJS::AST::Node::acceptChild(node, this); }
-
-void Rewriter::moveTextBefore(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc,
- const AST::SourceLocation &loc)
-{
- move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset);
-}
-
-void Rewriter::moveTextAfter(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc,
- const AST::SourceLocation &loc)
-{
- move(firstLoc.offset, lastLoc.offset + lastLoc.length - firstLoc.offset, loc.offset + loc.length);
-}
-
-void Rewriter::move(int pos, int length, int to)
-{
- textWriter.move(pos, length, to);
-}
-
-QT_QML_END_NAMESPACE
diff --git a/src/declarative/qml/rewriter/rewriter.pri b/src/declarative/qml/rewriter/rewriter.pri
index 2c29061..a9fa1b5 100644
--- a/src/declarative/qml/rewriter/rewriter.pri
+++ b/src/declarative/qml/rewriter/rewriter.pri
@@ -2,8 +2,3 @@ INCLUDEPATH += $$PWD
HEADERS += $$PWD/textwriter_p.h
SOURCES += $$PWD/textwriter.cpp
-
-!no_ast_rewriter {
- HEADERS += $$PWD/rewriter_p.h
- SOURCES += $$PWD/rewriter.cpp
-}
diff --git a/src/declarative/qml/rewriter/rewriter_p.h b/src/declarative/qml/rewriter/rewriter_p.h
deleted file mode 100644
index 4799469..0000000
--- a/src/declarative/qml/rewriter/rewriter_p.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 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$
-** 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 Technology Preview License Agreement accompanying
-** this package.
-**
-** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef REWRITER_H
-#define REWRITER_H
-
-#include "private/textwriter_p.h"
-
-#include <qdeclarativejsastvisitor_p.h>
-
-#include <QtCore/QList>
-#include <QtCore/QString>
-
-QT_BEGIN_HEADER
-QT_QML_BEGIN_NAMESPACE
-
-namespace QDeclarativeJS {
-
-////////////////////////////////////////////////////////////////////////////////
-// Replacement
-////////////////////////////////////////////////////////////////////////////////
-class Replacement
-{
- int _offset;
- int _length;
- QString _text;
-
-public:
- Replacement(int offset = 0, int length = 0, const QString &text = QString())
- : _offset(offset), _length(length), _text(text)
- { }
-
- bool isNull() const { return _offset == _length; }
- operator bool() const { return ! isNull(); }
-
- int offset() const { return _offset; }
- int length() const { return _length; }
- QString text() const { return _text; }
-};
-
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Rewriter
-////////////////////////////////////////////////////////////////////////////////
-class Rewriter: public AST::Visitor
-{
-protected:
- TextWriter textWriter;
-public:
- //
- // Token based API
- //
-
- /// Returns the text of the token at the given \a location.
- QString textAt(const AST::SourceLocation &location) const;
-
- QString textAt(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc) const;
-
- /// Replace the token at \a loc with the given \a text.
- void replace(const AST::SourceLocation &loc, const QString &text);
-
- /// Remove the token at the given \a location.
- void remove(const AST::SourceLocation &location);
-
- /// Remove all tokens in the range [\a firstLoc, \a lastLoc].
- void remove(const AST::SourceLocation &firstLoc, const AST::SourceLocation &lastLoc);
-
- /// Insert \a text before the token at the given \a location.
- void insertTextBefore(const AST::SourceLocation &location, const QString &text);
-
- /// Insert \a text after the token at the given \a location.
- void insertTextAfter(const AST::SourceLocation &loc, const QString &text);
-
- void moveTextBefore(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc,
- const AST::SourceLocation &loc);
-
- void moveTextAfter(const AST::SourceLocation &firstLoc,
- const AST::SourceLocation &lastLoc,
- const AST::SourceLocation &loc);
-
- //
- // low-level offset based API
- //
- virtual void replace(int offset, int length, const QString &text);
- virtual void move(int pos, int length, int to);
- void insertText(int offset, const QString &text);
- void removeText(int offset, int length);
-
- /// Visit the given \a node.
- void accept(AST::Node *node);
-
- /// Returns the original unchanged source code.
- QString code() const { return _code; }
-
- /// Returns the list of replacements.
- QList<Replacement> replacementList() const { return _replacementList; }
-
-protected:
- /// \internal
- void setCode(const QString &code) { _code = code; }
-
-private:
- QString _code;
- QList<Replacement> _replacementList;
-};
-
-} // end of namespace QDeclarativeJS
-
-QT_QML_END_NAMESPACE
-QT_END_HEADER
-
-#endif // REWRITER_H