summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2010-12-02 12:13:07 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2010-12-02 12:13:07 (GMT)
commit655bae506d4d2743ed016c78a767afa2150057a9 (patch)
tree9ccc2b4a56792616a2c48045faa9bd7081126167 /src/declarative/qml
parent16252a59afa58b0cb4b0ffb02a330dcf002c9750 (diff)
parentf6f8ba94d5f82b8df723a217a3d0ecb50e570cbc (diff)
downloadQt-655bae506d4d2743ed016c78a767afa2150057a9.zip
Qt-655bae506d4d2743ed016c78a767afa2150057a9.tar.gz
Qt-655bae506d4d2743ed016c78a767afa2150057a9.tar.bz2
Merge remote branch 'origin/master' into file-engine-refactor
master's version of conflicting def files picked. Conflicts: src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtNetworku.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativecompileddata.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecompiler_p.h4
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp13
4 files changed, 16 insertions, 7 deletions
diff --git a/src/declarative/qml/qdeclarativecompileddata.cpp b/src/declarative/qml/qdeclarativecompileddata.cpp
index a4ecc77..690f499 100644
--- a/src/declarative/qml/qdeclarativecompileddata.cpp
+++ b/src/declarative/qml/qdeclarativecompileddata.cpp
@@ -169,8 +169,8 @@ QDeclarativeCompiledData::QDeclarativeCompiledData(QDeclarativeEngine *engine)
QDeclarativeCompiledData::~QDeclarativeCompiledData()
{
for (int ii = 0; ii < types.count(); ++ii) {
- if (types.at(ii).ref)
- types.at(ii).ref->release();
+ if (types.at(ii).component)
+ types.at(ii).component->release();
}
for (int ii = 0; ii < propertyCaches.count(); ++ii)
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index b2740b8..645402e 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -591,8 +591,6 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine,
}
} else if (tref.typeData) {
ref.component = tref.typeData->compiledData();
- ref.ref = tref.typeData;
- ref.ref->addref();
}
ref.className = parserRef->name.toUtf8();
out->types << ref;
diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h
index 43a0901..5cd1fd2 100644
--- a/src/declarative/qml/qdeclarativecompiler_p.h
+++ b/src/declarative/qml/qdeclarativecompiler_p.h
@@ -89,14 +89,12 @@ public:
struct TypeReference
{
TypeReference()
- : type(0), component(0), ref(0) {}
+ : type(0), component(0) {}
QByteArray className;
QDeclarativeType *type;
-// QDeclarativeComponent *component;
QDeclarativeCompiledData *component;
- QDeclarativeRefCount *ref;
QObject *createInstance(QDeclarativeContextData *, const QBitField &, QList<QDeclarativeError> *) const;
const QMetaObject *metaObject() const;
};
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index ae7a80d..75cc6f9 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -52,6 +52,7 @@
#include <QtCore/qwaitcondition.h>
#include <QtScript/qscriptvalueiterator.h>
#include <QtCore/qfile.h>
+#include <QtCore/qdatetime.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtDeclarative/qdeclarativeinfo.h>
#include "qdeclarativenetworkaccessmanagerfactory.h"
@@ -314,6 +315,12 @@ QVariant QDeclarativeWorkerScriptEnginePrivate::scriptValueToVariant(const QScri
return QVariant(value.toString());
} else if (value.isNumber()) {
return QVariant((qreal)value.toNumber());
+ } else if (value.isDate()) {
+ return QVariant(value.toDateTime());
+#ifndef QT_NO_REGEXP
+ } else if (value.isRegExp()) {
+ return QVariant(value.toRegExp());
+#endif
} else if (value.isArray()) {
QVariantList list;
@@ -364,6 +371,12 @@ QScriptValue QDeclarativeWorkerScriptEnginePrivate::variantToScriptValue(const Q
return QScriptValue(value.toString());
} else if (value.userType() == QMetaType::QReal) {
return QScriptValue(value.toReal());
+ } else if (value.userType() == QVariant::DateTime) {
+ return engine->newDate(value.toDateTime());
+#ifndef QT_NO_REGEXP
+ } else if (value.userType() == QVariant::RegExp) {
+ return engine->newRegExp(value.toRegExp());
+#endif
} else if (value.userType() == qMetaTypeId<QDeclarativeListModelWorkerAgent::VariantRef>()) {
QDeclarativeListModelWorkerAgent::VariantRef vr = qvariant_cast<QDeclarativeListModelWorkerAgent::VariantRef>(value);
if (vr.a->scriptEngine() == 0)