From 9f6fd23fda43a5668d3fad398eb3e9d80cee9c44 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Tue, 18 Jan 2011 13:42:48 +1000 Subject: Fix QtDeclarative compilation warnings Task-number: Reviewed-by: Martin Jones --- src/declarative/graphicsitems/qdeclarativegridview.cpp | 8 -------- src/declarative/qml/qdeclarativeboundsignal.cpp | 2 +- src/declarative/qml/qdeclarativeenginedebug.cpp | 13 ++++++------- src/declarative/qml/qdeclarativescriptparser.cpp | 6 ------ src/declarative/util/qdeclarativeutilmodule.cpp | 2 +- 5 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 6e6e8c1..0bea638 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2618,12 +2618,8 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count) return; QHash moved; - bool removedBeforeVisible = false; FxGridItem *firstItem = d->firstVisibleItem(); - if (from < to && from < d->visibleIndex && to > d->visibleIndex) - removedBeforeVisible = true; - QList::Iterator it = d->visibleItems.begin(); while (it != d->visibleItems.end()) { FxGridItem *item = *it; @@ -2632,16 +2628,12 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count) item->index += (to-from); moved.insert(item->index, item); it = d->visibleItems.erase(it); - if (item->rowPos() < firstItem->rowPos()) - removedBeforeVisible = true; } else { if (item->index > from && item->index != -1) { // move everything after the moved items. item->index -= count; if (item->index < d->visibleIndex) d->visibleIndex = item->index; - } else if (item->index != -1) { - removedBeforeVisible = true; } ++it; } diff --git a/src/declarative/qml/qdeclarativeboundsignal.cpp b/src/declarative/qml/qdeclarativeboundsignal.cpp index 030fb2c..0ac3f64 100644 --- a/src/declarative/qml/qdeclarativeboundsignal.cpp +++ b/src/declarative/qml/qdeclarativeboundsignal.cpp @@ -167,7 +167,7 @@ int QDeclarativeBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) { if (c == QMetaObject::InvokeMetaMethod && id == evaluateIdx) { QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::HandlingSignal); - QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::HandlingSignal, QLatin1String(m_signal.signature()) + QLatin1String(": ") + (m_expression ? m_expression->expression() : "")); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::HandlingSignal, QLatin1String(m_signal.signature()) + QLatin1String(": ") + (m_expression ? m_expression->expression() : QLatin1String(""))); m_isEvaluating = true; if (!m_paramsValid) { if (!m_signal.parameterTypes().isEmpty()) diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index b6b4b49..0881003 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -539,7 +539,6 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, { QObject *object = objectForId(objectId); QDeclarativeContext *context = qmlContext(object); - QByteArray propertyNameArray = propertyName.toUtf8(); if (object && context) { QDeclarativeProperty property(object, propertyName, context); @@ -550,7 +549,7 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, foreach(QWeakPointer statePointer, m_allStates) { if (QDeclarativeState *state = statePointer.data()) { // here we assume that the revert list on itself defines the base state - if ( state->isStateActive() && state->containsPropertyInRevertList(object, propertyNameArray) ) { + if (state->isStateActive() && state->containsPropertyInRevertList(object, propertyName)) { inBaseState = false; QDeclarativeBinding *newBinding = 0; @@ -560,10 +559,10 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, newBinding->setNotifyOnValueChanged(true); } - state->changeBindingInRevertList(object,propertyNameArray, newBinding); + state->changeBindingInRevertList(object, propertyName, newBinding); if (isLiteralValue) - state->changeValueInRevertList(object, propertyNameArray, expression); + state->changeValueInRevertList(object, propertyName, expression); } } } @@ -592,9 +591,9 @@ void QDeclarativeEngineDebugServer::setBinding(int objectId, // not a valid property if (QDeclarativePropertyChanges *propertyChanges = dynamic_cast(object)) { if (isLiteralValue) { - propertyChanges->changeValue(propertyName.toUtf8(),expression); + propertyChanges->changeValue(propertyName, expression); } else { - propertyChanges->changeExpression(propertyName.toUtf8(),expression.toString()); + propertyChanges->changeExpression(propertyName, expression.toString()); } } else { qWarning() << "QDeclarativeEngineDebugServer::setBinding: unable to set property" << propertyName << "on object" << object; @@ -639,7 +638,7 @@ void QDeclarativeEngineDebugServer::resetBinding(int objectId, const QString &pr } } else { if (QDeclarativePropertyChanges *propertyChanges = dynamic_cast(object)) { - propertyChanges->removeProperty(propertyName.toUtf8()); + propertyChanges->removeProperty(propertyName); } } } diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index e32a3d2..ce6f943 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -170,12 +170,6 @@ private: StateStack _stateStack; QStringList _scope; QString _contents; - - inline bool isSignalProperty(const QByteArray &propertyName) const { - return (propertyName.length() >= 3 && propertyName.startsWith("on") && - ('A' <= propertyName.at(2) && 'Z' >= propertyName.at(2))); - } - }; ProcessAST::ProcessAST(QDeclarativeScriptParser *parser) diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp index 5abf085..f32f390 100644 --- a/src/declarative/util/qdeclarativeutilmodule.cpp +++ b/src/declarative/util/qdeclarativeutilmodule.cpp @@ -76,7 +76,7 @@ void QDeclarativeUtilModule::defineModule() { - qmlRegisterUncreatableType("QtQuick",1,1,"Application", "Application is an abstract class"); + qmlRegisterUncreatableType("QtQuick",1,1,"Application", QDeclarativeApplication::tr("Application is an abstract class")); qmlRegisterType("QtQuick",1,0,"AnchorAnimation"); qmlRegisterType("QtQuick",1,0,"AnchorChanges"); -- cgit v0.12