From a59291393cc70a1f922e4796efbb72b29920da27 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 4 Nov 2009 15:32:26 +1000 Subject: less compile warnings --- src/declarative/qml/qmlcontextscriptclass.cpp | 1 + src/declarative/qml/qmlglobalscriptclass.cpp | 19 ++++++++++--------- src/declarative/qml/qmllistscriptclass.cpp | 15 ++++++++++----- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/declarative/qml/qmlcontextscriptclass.cpp b/src/declarative/qml/qmlcontextscriptclass.cpp index 4615764..fda284a 100644 --- a/src/declarative/qml/qmlcontextscriptclass.cpp +++ b/src/declarative/qml/qmlcontextscriptclass.cpp @@ -219,6 +219,7 @@ QScriptValue QmlContextScriptClass::property(Object *object, const Identifier &n void QmlContextScriptClass::setProperty(Object *object, const Identifier &name, const QScriptValue &value) { + Q_UNUSED(object); Q_ASSERT(lastScopeObject || lastDefaultObject != -1); QmlContext *bindContext = lastContext; diff --git a/src/declarative/qml/qmlglobalscriptclass.cpp b/src/declarative/qml/qmlglobalscriptclass.cpp index a9c5d3d..fd270e3 100644 --- a/src/declarative/qml/qmlglobalscriptclass.cpp +++ b/src/declarative/qml/qmlglobalscriptclass.cpp @@ -70,10 +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) + Q_UNUSED(object); + Q_UNUSED(name); + Q_UNUSED(flags); + Q_UNUSED(id); return HandlesReadAccess | HandlesWriteAccess; } @@ -82,9 +82,9 @@ QmlGlobalScriptClass::property(const QScriptValue &object, const QScriptString &name, uint id) { - Q_UNUSED(object) - Q_UNUSED(name) - Q_UNUSED(id) + Q_UNUSED(object); + Q_UNUSED(name); + Q_UNUSED(id); return engine()->undefinedValue(); } @@ -92,8 +92,9 @@ void QmlGlobalScriptClass::setProperty(QScriptValue &object, const QScriptString &name, uint id, const QScriptValue &value) { - Q_UNUSED(object) - Q_UNUSED(value) + Q_UNUSED(object); + Q_UNUSED(id); + Q_UNUSED(value); QString error = QLatin1String("Invalid write to global property \"") + name.toString() + QLatin1String("\""); engine()->currentContext()->throwError(error); diff --git a/src/declarative/qml/qmllistscriptclass.cpp b/src/declarative/qml/qmllistscriptclass.cpp index f067db6..a180e49 100644 --- a/src/declarative/qml/qmllistscriptclass.cpp +++ b/src/declarative/qml/qmllistscriptclass.cpp @@ -54,6 +54,7 @@ QmlListScriptClass::QmlListScriptClass(QmlEngine *e) : QScriptDeclarativeClass(QmlEnginePrivate::getScriptEngine(e)), engine(e) { QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); + Q_UNUSED(scriptEngine); m_lengthId = createPersistentIdentifier(QLatin1String("length")); } @@ -81,6 +82,8 @@ QScriptClass::QueryFlags QmlListScriptClass::queryProperty(Object *object, const Identifier &name, QScriptClass::QueryFlags flags) { + Q_UNUSED(object); + Q_UNUSED(flags); if (name == m_lengthId.identifier) return QScriptClass::HandlesReadAccess; @@ -115,9 +118,11 @@ QScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name) if (data->type == QListPtr) { const QList &qlist = *((QList*)list); - if (name == m_lengthId.identifier) - return qlist.count(); - else if (lastIndex < qlist.count()) + quint32 count = qlist.count(); + + if (name == m_lengthId.identifier) + return count; + else if (lastIndex < count) return enginePriv->objectClass->newQObject(qlist.at(lastIndex)); else return scriptEngine->undefinedValue(); @@ -126,9 +131,9 @@ QScriptValue QmlListScriptClass::property(Object *obj, const Identifier &name) Q_ASSERT(data->type == QmlListPtr); const QmlList &qmllist = *((QmlList*)list); - int count = qmllist.count(); + quint32 count = qmllist.count(); - if (name == m_lengthId.identifier) + if (name == m_lengthId.identifier) return count; else if (lastIndex < count) return enginePriv->objectClass->newQObject(qmllist.at(lastIndex)); -- cgit v0.12