From 1927af29ab140d9964aba337f218d87d9ce8c896 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Thu, 21 Jan 2010 13:17:15 +0100 Subject: Remove unused variable. --- src/declarative/qml/qmlcompiler.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index fedc1ee..1368324 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -2388,7 +2388,6 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) } for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) { - const Object::DynamicSlot &s = obj->dynamicSlots.at(ii); const QString &funcScript = funcScripts.at(ii); QmlVMEMetaData::MethodData *data = ((QmlVMEMetaData *)dynamicData.data())->methodData() + ii; -- cgit v0.12 From 38c0ed9870fc6bd8ba759c283eaf2bffb61c2e3f Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 21 Jan 2010 16:45:05 +0100 Subject: Fixed possible array index-out-of-bounds crash in error reporting. --- src/declarative/qml/parser/qmljs.g | 7 ++++++- src/declarative/qml/parser/qmljsparser.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/parser/qmljs.g b/src/declarative/qml/parser/qmljs.g index 7fbb3f6..90949d5 100644 --- a/src/declarative/qml/parser/qmljs.g +++ b/src/declarative/qml/parser/qmljs.g @@ -2985,7 +2985,12 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); + QString msg; + int token = token_buffer[0].token; + if (token < 0 || token >= TERMINAL_COUNT) + msg = qApp->translate("QmlParser", "Syntax error"); + else + msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; diff --git a/src/declarative/qml/parser/qmljsparser.cpp b/src/declarative/qml/parser/qmljsparser.cpp index c2788f4..856d06d 100644 --- a/src/declarative/qml/parser/qmljsparser.cpp +++ b/src/declarative/qml/parser/qmljsparser.cpp @@ -1761,7 +1761,12 @@ case 340: { token_buffer[1].loc = yylloc = location(lexer); if (t_action(errorState, yytoken)) { - const QString msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token])); + QString msg; + int token = token_buffer[0].token; + if (token < 0 || token >= TERMINAL_COUNT) + msg = qApp->translate("QmlParser", "Syntax error"); + else + msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token])); diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg)); action = errorState; -- cgit v0.12 From 1e4d40aaf71469255409227d3c7105b199effcdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 19 Jan 2010 11:28:54 +0100 Subject: Speed up QmlGraphicsItem construction. It's much faster to just initalize the flags in the constructor of QmlGraphicsItemPrivate than doing a full blown QGraphicsItem::setFlags. We can perfectly do this because QmlGraphicsItem does not listen to any itemChange events related to those flags. Reviewed-by: Aaron Kennedy --- src/declarative/graphicsitems/qmlgraphicsitem_p.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsitem_p.h b/src/declarative/graphicsitems/qmlgraphicsitem_p.h index ca850f3..91d2119 100644 --- a/src/declarative/graphicsitems/qmlgraphicsitem_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsitem_p.h @@ -116,6 +116,12 @@ public: smooth(false), keyHandler(0), width(0), height(0), implicitWidth(0), implicitHeight(0) { + QGraphicsItemPrivate::acceptedMouseButtons = 0; + QGraphicsItemPrivate::flags = QGraphicsItem::GraphicsItemFlags( + QGraphicsItem::ItemHasNoContents + | QGraphicsItem::ItemIsFocusable + | QGraphicsItem::ItemNegativeZStacksBehindParent); + } void init(QmlGraphicsItem *parent) @@ -125,10 +131,6 @@ public: if (parent) q->setParentItem(parent); _baselineOffset.invalidate(); - q->setAcceptedMouseButtons(Qt::NoButton); - q->setFlags(QGraphicsItem::ItemHasNoContents | - QGraphicsItem::ItemIsFocusable | - QGraphicsItem::ItemNegativeZStacksBehindParent); mouseSetsFocus = false; } -- cgit v0.12