diff options
author | Bea Lam <bea.lam@nokia.com> | 2010-09-17 05:33:22 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2010-09-17 05:33:22 (GMT) |
commit | af29c555a29ebcdb1d962176912478212c9c7e65 (patch) | |
tree | 9c2129694e455d36725f5571c2864a4b9b0c92c5 | |
parent | c2bbef949126826f0330c69dff1a8c96919f69a5 (diff) | |
download | Qt-af29c555a29ebcdb1d962176912478212c9c7e65.zip Qt-af29c555a29ebcdb1d962176912478212c9c7e65.tar.gz Qt-af29c555a29ebcdb1d962176912478212c9c7e65.tar.bz2 |
Improve error messages
-rw-r--r-- | src/declarative/util/qdeclarativelistmodel.cpp | 6 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp index 68e97b0..2d8b946 100644 --- a/src/declarative/util/qdeclarativelistmodel.cpp +++ b/src/declarative/util/qdeclarativelistmodel.cpp @@ -292,7 +292,7 @@ QDeclarativeListModelWorkerAgent *QDeclarativeListModel::agent() return m_agent; if (!flatten()) { - qmlInfo(this) << "List contains nested list values and cannot be used from a worker script"; + qmlInfo(this) << "List contains list-type data and cannot be used from a worker script"; return 0; } @@ -1023,7 +1023,7 @@ bool FlatListModel::addValue(const QScriptValue &value, QHash<int, QVariant> *ro it.next(); QScriptValue value = it.value(); if (!value.isVariant() && !value.isRegExp() && !value.isDate() && value.isObject()) { - qmlInfo(m_listModel) << "Cannot add nested list values when modifying or after modification from a worker script"; + qmlInfo(m_listModel) << "Cannot add list-type data when modifying or after modification from a worker script"; return false; } @@ -1129,7 +1129,7 @@ QScriptDeclarativeClass::Value FlatListScriptClass::property(Object *obj, const void FlatListScriptClass::setProperty(Object *obj, const Identifier &name, const QScriptValue &value) { if (!value.isVariant() && !value.isRegExp() && !value.isDate() && value.isObject()) { - qmlInfo(m_model->m_listModel) << "Cannot add nested list values when modifying or after modification from a worker script"; + qmlInfo(m_model->m_listModel) << "Cannot add list-type data when modifying or after modification from a worker script"; return; } diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index 70ec416..f456778 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -406,7 +406,7 @@ void tst_qdeclarativelistmodel::dynamic_worker_sync() // execute a set of commands on the worker list model, then check the // changes are reflected in the list model in the main thread if (QByteArray(QTest::currentDataTag()).startsWith("nested")) - QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: Cannot add nested list values when modifying or after modification from a worker script"); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script"); QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, operations.mid(0, operations.length()-1)))); @@ -439,7 +439,7 @@ void tst_qdeclarativelistmodel::convertNestedToFlat_fail() model.append(nestedListValue(&s_eng)); QCOMPARE(model.count(), 2); - QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: List contains nested list values and cannot be used from a worker script"); + QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML ListModel: List contains list-type data and cannot be used from a worker script"); QVERIFY(QMetaObject::invokeMethod(item, "evalExpressionViaWorker", Q_ARG(QVariant, script))); waitForWorker(item); @@ -491,7 +491,7 @@ void tst_qdeclarativelistmodel::convertNestedToFlat_ok() QCOMPARE(model.count(), count+1); QScriptValue nested = nestedListValue(&s_eng); - const char *warning = "<Unknown File>: QML ListModel: Cannot add nested list values when modifying or after modification from a worker script"; + const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script"; QTest::ignoreMessage(QtWarningMsg, warning); model.append(nested); @@ -769,7 +769,7 @@ void tst_qdeclarativelistmodel::get_worker() model.append(sv); int role = roleFromName(&model, roleName); - const char *warning = "<Unknown File>: QML ListModel: Cannot add nested list values when modifying or after modification from a worker script"; + const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script"; if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map) QTest::ignoreMessage(QtWarningMsg, warning); QSignalSpy spy(&model, SIGNAL(itemsChanged(int, int, QList<int>))); |