diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-10-26 05:47:12 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-10-26 05:48:03 (GMT) |
commit | ee0c9c7003dc020113886070b5c04dc0a7529bf4 (patch) | |
tree | 4bcb10b46991161a59a784db65c13b9dfe34ce0a /src/declarative/qml | |
parent | 7eddab2dc75c79b05d86e2e4b48ac9f4cf102406 (diff) | |
download | Qt-ee0c9c7003dc020113886070b5c04dc0a7529bf4.zip Qt-ee0c9c7003dc020113886070b5c04dc0a7529bf4.tar.gz Qt-ee0c9c7003dc020113886070b5c04dc0a7529bf4.tar.bz2 |
Fix more warnings.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlcontext.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlcontext_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlenginedebug.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlglobalscriptclass.cpp | 9 | ||||
-rw-r--r-- | src/declarative/qml/qmlobjectscriptclass.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qmlpropertycache.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlrewrite.cpp | 12 | ||||
-rw-r--r-- | src/declarative/qml/qmlvme.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlvmemetaobject.cpp | 2 |
9 files changed, 22 insertions, 16 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index 31d4e1f..7ba3544 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -396,8 +396,7 @@ void QmlContext::setContextProperty(const QString &name, const QVariant &value) } } -void QmlContextPrivate::setIdProperty(const QString &name, int idx, - QObject *obj) +void QmlContextPrivate::setIdProperty(int idx, QObject *obj) { if (notifyIndex == -1) { Q_Q(QmlContext); @@ -487,7 +486,6 @@ void QmlContext::setBaseUrl(const QUrl &baseUrl) */ QUrl QmlContext::baseUrl() const { - Q_D(const QmlContext); const QmlContext* p = this; while (p && p->d_func()->url.isEmpty()) { p = p->parentContext(); diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index 9a77e94..be7bf1d 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -129,7 +129,7 @@ public: }; ContextGuard *idValues; int idValueCount; - void setIdProperty(const QString &, int, QObject *); + void setIdProperty(int, QObject *); void setIdPropertyData(QmlIntegerCache *); void destroyed(ContextGuard *); diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 7178e6c..664ca3f 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -104,7 +104,7 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) rv.type = QmlObjectProperty::Unknown; rv.valueTypeName = QString::fromUtf8(prop.typeName()); - rv.name = prop.name(); + rv.name = QString::fromUtf8(prop.name()); rv.hasNotifySignal = prop.hasNotifySignal(); QmlAbstractBinding *binding = QmlMetaProperty(obj, rv.name).binding(); if (binding) @@ -229,7 +229,7 @@ QmlEngineDebugServer::objectData(QObject *object) } rv.objectName = object->objectName(); - rv.objectType = object->metaObject()->className(); + rv.objectType = QString::fromUtf8(object->metaObject()->className()); rv.objectId = QmlDebugService::idForObject(object); rv.contextId = QmlDebugService::idForObject(qmlContext(object)); diff --git a/src/declarative/qml/qmlglobalscriptclass.cpp b/src/declarative/qml/qmlglobalscriptclass.cpp index 0ade5ee..91187c7 100644 --- a/src/declarative/qml/qmlglobalscriptclass.cpp +++ b/src/declarative/qml/qmlglobalscriptclass.cpp @@ -70,6 +70,10 @@ QmlGlobalScriptClass::queryProperty(const QScriptValue &object, const QScriptString &name, QueryFlags flags, uint *id) { + Q_UNUSED(object) + Q_UNUSED(name) + Q_UNUSED(flags) + Q_UNUSED(id) return HandlesReadAccess | HandlesWriteAccess; } @@ -78,6 +82,9 @@ QmlGlobalScriptClass::property(const QScriptValue &object, const QScriptString &name, uint id) { + Q_UNUSED(object) + Q_UNUSED(name) + Q_UNUSED(id) return engine()->undefinedValue(); } @@ -85,6 +92,8 @@ void QmlGlobalScriptClass::setProperty(QScriptValue &object, const QScriptString &name, uint id, const QScriptValue &value) { + Q_UNUSED(object) + Q_UNUSED(value) QString error = QLatin1String("Invalid write to global property \"") + name.toString() + QLatin1String("\""); engine()->currentContext()->throwError(error); diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp index a6edd3b..eac354d 100644 --- a/src/declarative/qml/qmlobjectscriptclass.cpp +++ b/src/declarative/qml/qmlobjectscriptclass.cpp @@ -134,7 +134,6 @@ QmlObjectScriptClass::queryProperty(QObject *obj, const Identifier &name, return 0; QmlEnginePrivate *enginePrivate = QmlEnginePrivate::get(engine); - QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); QmlPropertyCache *cache = 0; QmlDeclarativeData *ddata = QmlDeclarativeData::get(obj); diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp index 3ede341..4c24cdd 100644 --- a/src/declarative/qml/qmlpropertycache.cpp +++ b/src/declarative/qml/qmlpropertycache.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE void QmlPropertyCache::Data::load(const QMetaProperty &p) { propType = p.userType(); - if (propType == QVariant::LastType) + if (QVariant::Type(propType) == QVariant::LastType) propType = qMetaTypeId<QVariant>(); coreIndex = p.propertyIndex(); notifyIndex = p.notifySignalIndex(); diff --git a/src/declarative/qml/qmlrewrite.cpp b/src/declarative/qml/qmlrewrite.cpp index 43b2529..7cf8888 100644 --- a/src/declarative/qml/qmlrewrite.cpp +++ b/src/declarative/qml/qmlrewrite.cpp @@ -120,7 +120,7 @@ bool RewriteBinding::visit(AST::ExpressionStatement *ast) return false; } -bool RewriteBinding::visit(AST::DoWhileStatement *ast) +bool RewriteBinding::visit(AST::DoWhileStatement *) { ++_inLoop; return true; @@ -131,7 +131,7 @@ void RewriteBinding::endVisit(AST::DoWhileStatement *) --_inLoop; } -bool RewriteBinding::visit(AST::WhileStatement *ast) +bool RewriteBinding::visit(AST::WhileStatement *) { ++_inLoop; return true; @@ -142,7 +142,7 @@ void RewriteBinding::endVisit(AST::WhileStatement *) --_inLoop; } -bool RewriteBinding::visit(AST::ForStatement *ast) +bool RewriteBinding::visit(AST::ForStatement *) { ++_inLoop; return true; @@ -153,7 +153,7 @@ void RewriteBinding::endVisit(AST::ForStatement *) --_inLoop; } -bool RewriteBinding::visit(AST::LocalForStatement *ast) +bool RewriteBinding::visit(AST::LocalForStatement *) { ++_inLoop; return true; @@ -164,7 +164,7 @@ void RewriteBinding::endVisit(AST::LocalForStatement *) --_inLoop; } -bool RewriteBinding::visit(AST::ForEachStatement *ast) +bool RewriteBinding::visit(AST::ForEachStatement *) { ++_inLoop; return true; @@ -175,7 +175,7 @@ void RewriteBinding::endVisit(AST::ForEachStatement *) --_inLoop; } -bool RewriteBinding::visit(AST::LocalForEachStatement *ast) +bool RewriteBinding::visit(AST::LocalForEachStatement *) { ++_inLoop; return true; diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 802a78f..b986b60 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -225,7 +225,7 @@ QObject *QmlVME::run(QStack<QObject *> &stack, QmlContext *ctxt, { QObject *target = stack.top(); // ctxt->setContextProperty(primitives.at(instr.setId.value), target); - cp->setIdProperty(primitives.at(instr.setId.value), instr.setId.index, target); + cp->setIdProperty(instr.setId.index, target); } break; diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp index a627bf9..3e1d931 100644 --- a/src/declarative/qml/qmlvmemetaobject.cpp +++ b/src/declarative/qml/qmlvmemetaobject.cpp @@ -278,7 +278,7 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) QMetaMethod m = method(_id); QList<QByteArray> names = m.parameterNames(); for (int ii = 0; ii < names.count(); ++ii) - newCtxt.setContextProperty(names.at(ii), *(QVariant *)a[ii + 1]); + newCtxt.setContextProperty(QString::fromLatin1(names.at(ii)), *(QVariant *)a[ii + 1]); QmlExpression expr(&newCtxt, code, object); expr.setTrackChange(false); expr.value(); |