aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Vogt <matthew.vogt@jollamobile.com>2013-05-17 10:14:26 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-19 02:31:27 +0200
commit91553ec97c28302707ed9ffecc74d248d3011e19 (patch)
tree41be107b95068dd2b04606215665f96d24e737f2 /src
parent4931f4078d7113bab73ca4ae1d9cedaa0e8712a6 (diff)
Prefer qFatal to assert for failure condition
Otherwise the explanatory message won't be seen in release mode. Change-Id: I5c9fbc86753ac5ecea3d0714b8f17207f6b713d6 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/v4/qv4irbuilder.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/qml/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp
index d217a01105..d217b5e2f5 100644
--- a/src/qml/qml/v4/qv4irbuilder.cpp
+++ b/src/qml/qml/v4/qv4irbuilder.cpp
@@ -638,11 +638,14 @@ bool QV4IRBuilder::visit(AST::FieldMemberExpression *ast)
QByteArray utf8Name = name.toUtf8();
const char *enumName = utf8Name.constData();
- //Happens in some cases where they make properties with uppercase names
- Q_ASSERT_X(baseName->meta.propertyCache(m_engine), "QML compiler",
- QString("Error resolving enum \"%1\"").arg(name).toLatin1().constData());
+ const QQmlPropertyCache *cache = baseName->meta.propertyCache(m_engine);
+ if (!cache) {
+ //Happens in some cases where they make properties with uppercase names
+ qFatal("QV4: Unable to resolve enum: '%s'",
+ QString(*baseName->id + QLatin1Char('.') + ast->name.toString()).toLatin1().constData());
+ }
- const QMetaObject *meta = baseName->meta.propertyCache(m_engine)->firstCppMetaObject();
+ const QMetaObject *meta = cache->firstCppMetaObject();
bool found = false;
for (int ii = 0; !found && ii < meta->enumeratorCount(); ++ii) {
QMetaEnum e = meta->enumerator(ii);