diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-21 23:26:40 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-21 23:26:40 (GMT) |
commit | 5a506eefe1ca8f654dcfc354f8ac39547510becf (patch) | |
tree | 20d3eedfd42b89c6f2b7ae0ce4f9ecf71dbabcf3 /src | |
parent | cdd12bf1d4475ad23b49b5e27328bf6c738a0ab3 (diff) | |
download | Qt-5a506eefe1ca8f654dcfc354f8ac39547510becf.zip Qt-5a506eefe1ca8f654dcfc354f8ac39547510becf.tar.gz Qt-5a506eefe1ca8f654dcfc354f8ac39547510becf.tar.bz2 |
fix warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/qmlcanvasdebugger.cpp | 4 | ||||
-rw-r--r-- | src/declarative/debugger/qmldebugger.cpp | 20 | ||||
-rw-r--r-- | src/declarative/debugger/qmlobjecttree.cpp | 4 | ||||
-rw-r--r-- | src/declarative/debugger/qmlpropertyview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxpathview.cpp | 1 | ||||
-rw-r--r-- | src/declarative/fx/qfxtext.cpp | 1 | ||||
-rw-r--r-- | src/declarative/fx/qfxvisualitemmodel.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompositetypemanager.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlcontext.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcustomparser.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 13 |
12 files changed, 29 insertions, 27 deletions
diff --git a/src/declarative/debugger/qmlcanvasdebugger.cpp b/src/declarative/debugger/qmlcanvasdebugger.cpp index fe57bf4..21abd2d 100644 --- a/src/declarative/debugger/qmlcanvasdebugger.cpp +++ b/src/declarative/debugger/qmlcanvasdebugger.cpp @@ -76,7 +76,7 @@ QmlCanvasDebugger::QmlCanvasDebugger(QmlWatches *w, QWidget *parent) QObject::connect(y, SIGNAL(valueChanged(int)), this, SLOT(setY(int))); hlayout->addWidget(x); hlayout->addWidget(y); - QPushButton *pb = new QPushButton("Refresh", this); + QPushButton *pb = new QPushButton(tr("Refresh"), this); QObject::connect(pb, SIGNAL(clicked()), this, SLOT(refresh())); hlayout->addWidget(pb); @@ -233,7 +233,7 @@ void QmlCanvasDebugger::setCanvas(QSimpleCanvas *canvas) return; QTreeWidgetItem *root = new QmlCanvasDebuggerItem(m_tree); - root->setText(0, "Root"); + root->setText(0, tr("Root")); root->setExpanded(true); clone(root, m_canvasRoot, m_debugCanvas->root()); } diff --git a/src/declarative/debugger/qmldebugger.cpp b/src/declarative/debugger/qmldebugger.cpp index 49ad8d9..0bbcb2c 100644 --- a/src/declarative/debugger/qmldebugger.cpp +++ b/src/declarative/debugger/qmldebugger.cpp @@ -85,7 +85,7 @@ QmlDebugger::QmlDebugger(QWidget *parent) QObject::connect(m_tree, SIGNAL(addWatch(QObject*,QString)), this, SLOT(addWatch(QObject*,QString))); vlayout->addWidget(m_tree); - QPushButton *pb = new QPushButton("Refresh", treeWid); + QPushButton *pb = new QPushButton(tr("Refresh"), treeWid); QObject::connect(pb, SIGNAL(clicked()), this, SLOT(refresh())); vlayout->addWidget(pb); @@ -93,28 +93,28 @@ QmlDebugger::QmlDebugger(QWidget *parent) m_text = new QPlainTextEdit(this); m_text->setReadOnly(true); - tabs->addTab(m_text, "File"); + tabs->addTab(m_text, tr("File")); m_warnings = new QTreeWidget(this); m_warnings->setHeaderHidden(true); - tabs->addTab(m_warnings, "Warnings"); + tabs->addTab(m_warnings, tr("Warnings")); m_watches = new QmlWatches(this); m_watchTable = new QTableView(this); m_watchTable->setSelectionMode(QTableWidget::NoSelection); m_watchTable->setModel(m_watches); - tabs->addTab(m_watchTable, "Watches"); + tabs->addTab(m_watchTable, tr("Watches")); m_properties = new QmlPropertyView(m_watches, this); QObject::connect(m_properties, SIGNAL(objectClicked(quint32)), this, SLOT(highlightObject(quint32))); - tabs->addTab(m_properties, "Properties"); + tabs->addTab(m_properties, tr("Properties")); tabs->setCurrentWidget(m_properties); m_canvas = new QmlCanvasDebugger(m_watches, this); QObject::connect(m_canvas, SIGNAL(objectClicked(quint32)), this, SLOT(highlightObject(quint32))); - tabs->addTab(m_canvas, "Canvas"); + tabs->addTab(m_canvas, tr("Canvas")); splitter->addWidget(tabs); splitter->setStretchFactor(1, 2); @@ -229,7 +229,7 @@ bool QmlDebugger::makeItem(QObject *obj, QmlDebuggerItem *item) if(QmlBindableValue *bv = qobject_cast<QmlBindableValue *>(obj)) { QmlExpressionPrivate *p = bv->d; - text = bv->property().name() + ": " + bv->expression(); + text = bv->property().name() + QLatin1String(": ") + bv->expression(); item->setForeground(0, Qt::green); item->bindableValue = bv; @@ -281,13 +281,13 @@ bool QmlDebugger::makeItem(QObject *obj, QmlDebuggerItem *item) QString toolTipString; if(!p->url.toString().isEmpty()) { item->url = p->url; - toolTipString = "URL: " + p->url.toString(); + toolTipString = QLatin1String("URL: ") + p->url.toString(); } if(!p->typeName.isEmpty()) { if(!toolTipString.isEmpty()) - toolTipString.prepend("\n"); - toolTipString.prepend("Root type: " + text); + toolTipString.prepend(QLatin1Char('\n')); + toolTipString.prepend(tr("Root type: ") + text); text = p->typeName; } diff --git a/src/declarative/debugger/qmlobjecttree.cpp b/src/declarative/debugger/qmlobjecttree.cpp index fb6825a..27dc000 100644 --- a/src/declarative/debugger/qmlobjecttree.cpp +++ b/src/declarative/debugger/qmlobjecttree.cpp @@ -57,7 +57,7 @@ void QmlObjectTree::mousePressEvent(QMouseEvent *me) { QTreeWidget::mousePressEvent(me); if(me->button() == Qt::RightButton && me->type() == QEvent::MouseButtonPress) { - QAction action("Add watch...", 0); + QAction action(tr("Add watch..."), 0); QList<QAction *> actions; actions << &action; QmlDebuggerItem *item = static_cast<QmlDebuggerItem *>(currentItem()); @@ -65,7 +65,7 @@ void QmlObjectTree::mousePressEvent(QMouseEvent *me) QMenu::exec(actions, me->globalPos())) { bool ok = false; - QString watch = QInputDialog::getText(this, "Watch expression", "Expression:", QLineEdit::Normal, QString(), &ok); + QString watch = QInputDialog::getText(this, tr("Watch expression"), tr("Expression:"), QLineEdit::Normal, QString(), &ok); if(ok && !watch.isEmpty()) emit addWatch(item->object, watch); diff --git a/src/declarative/debugger/qmlpropertyview.cpp b/src/declarative/debugger/qmlpropertyview.cpp index e32393c..0d34fd9 100644 --- a/src/declarative/debugger/qmlpropertyview.cpp +++ b/src/declarative/debugger/qmlpropertyview.cpp @@ -56,7 +56,7 @@ QmlPropertyView::QmlPropertyView(QmlWatches *watches, QWidget *parent) setLayout(layout); m_tree = new QTreeWidget(this); - m_tree->setHeaderLabels(QStringList() << "Property" << "Value"); + m_tree->setHeaderLabels(QStringList() << tr("Property") << tr("Value")); QObject::connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem *))); QObject::connect(m_tree, SIGNAL(itemClicked(QTreeWidgetItem *, int)), diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 17fe36a..e5ede53 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -1674,6 +1674,7 @@ void QFxItem::setKeepMouseGrab(bool keep) */ void QFxItem::activeFocusChanged(bool flag) { + Q_UNUSED(flag); emit activeFocusChanged(); } @@ -1683,6 +1684,7 @@ void QFxItem::activeFocusChanged(bool flag) */ void QFxItem::focusChanged(bool flag) { + Q_UNUSED(flag); emit focusChanged(); } diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index e315547..3f2e77a 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -744,6 +744,7 @@ void QFxPathView::createdItem(int index, QFxItem *item) void QFxPathView::destroyingItem(QFxItem *item) { + Q_UNUSED(item); } void QFxPathView::ticked() diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index e84255d..be90723 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -607,7 +607,6 @@ QSize QFxTextPrivate::setupTextLayout(QTextLayout *layout) QImage QFxTextPrivate::wrappedTextImage(bool drawStyle) { //do layout - Q_Q(const QFxText); QFont f; if (_font) f = _font->font(); QSize size = cachedLayoutSize; diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp index b9ddcb9..039998a 100644 --- a/src/declarative/fx/qfxvisualitemmodel.cpp +++ b/src/declarative/fx/qfxvisualitemmodel.cpp @@ -621,7 +621,7 @@ QVariant QFxVisualItemModel::evaluate(int index, const QString &expression, QObj int QFxVisualItemModel::indexOf(QFxItem *item, QObject *objectContext) const { - QmlExpression e(qmlContext(item), "index", objectContext); + QmlExpression e(qmlContext(item), QLatin1String("index"), objectContext); e.setTrackChange(false); QVariant value = e.value(); if (value.isValid()) diff --git a/src/declarative/qml/qmlcompositetypemanager.cpp b/src/declarative/qml/qmlcompositetypemanager.cpp index e1124a6..0da1a92 100644 --- a/src/declarative/qml/qmlcompositetypemanager.cpp +++ b/src/declarative/qml/qmlcompositetypemanager.cpp @@ -315,7 +315,7 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit) continue; } - QUrl url = engine->componentUrl(QUrl(type + ".qml"), QUrl(unit->url)); + QUrl url = engine->componentUrl(QUrl(QLatin1String(type + ".qml")), QUrl(unit->url)); QmlCompositeTypeData *urlUnit = components.value(url.toString()); if (!urlUnit) { @@ -335,7 +335,7 @@ void QmlCompositeTypeManager::compile(QmlCompositeTypeData *unit) { QmlError error; error.setUrl(unit->url); - error.setDescription("Type " + type + " unavailable"); + error.setDescription(tr("Type %1 unavailable").arg(QLatin1String(type))); unit->errors << error; } if (urlUnit->errorType != QmlCompositeTypeData::AccessError) diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp index ea72ebf..e5016f2 100644 --- a/src/declarative/qml/qmlcontext.cpp +++ b/src/declarative/qml/qmlcontext.cpp @@ -73,8 +73,6 @@ void QmlContextPrivate::dump(int depth) void QmlContextPrivate::destroyed(QObject *obj) { - Q_Q(QmlContext); - defaultObjects.removeAll(obj); QVariant variantObject = QVariant::fromValue(obj); diff --git a/src/declarative/qml/qmlcustomparser.cpp b/src/declarative/qml/qmlcustomparser.cpp index a60f783..2e8c8f6 100644 --- a/src/declarative/qml/qmlcustomparser.cpp +++ b/src/declarative/qml/qmlcustomparser.cpp @@ -224,6 +224,7 @@ QList<QVariant> QmlCustomParserProperty::assignedValues() const QByteArray QmlCustomParser::compile(const QList<QmlCustomParserProperty> &, bool *ok) { + Q_UNUSED(ok); return QByteArray(); } diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 01600b9..5b3564f 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -10,6 +10,7 @@ #include "parser/javascriptast_p.h" #include <QStack> +#include <QCoreApplication> #include <QtDebug> #include <qfxperf.h> @@ -207,8 +208,8 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName, { int lastTypeDot = objectType.lastIndexOf(QLatin1Char('.')); bool isType = !objectType.isEmpty() && - (objectType.at(0).isUpper() | - lastTypeDot >= 0 && objectType.at(lastTypeDot+1).isUpper()); + (objectType.at(0).isUpper() || + (lastTypeDot >= 0 && objectType.at(lastTypeDot+1).isUpper())); int propertyCount = 0; for (; propertyName; propertyName = propertyName->next){ @@ -221,7 +222,7 @@ ProcessAST::defineObjectBinding_helper(AST::UiQualifiedId *propertyName, if(propertyCount || !currentObject()) { QmlError error; - error.setDescription("Expected type name"); + error.setDescription(QCoreApplication::translate("QmlParser","Expected type name")); error.setLine(typeLocation.startLine); error.setColumn(typeLocation.startColumn); _parser->_errors << error; @@ -427,7 +428,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) if(!typeFound) { QmlError error; - error.setDescription("Expected property type"); + error.setDescription(QCoreApplication::translate("QmlParser","Expected property type")); error.setLine(node->typeToken.startLine); error.setColumn(node->typeToken.startColumn); _parser->_errors << error; @@ -573,7 +574,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node) if(funDecl->formals) { QmlError error; - error.setDescription("Slot declarations must be parameterless"); + error.setDescription(QCoreApplication::translate("QmlParser","Slot declarations must be parameterless")); error.setLine(funDecl->lparenToken.startLine); error.setColumn(funDecl->lparenToken.startColumn); _parser->_errors << error; @@ -587,7 +588,7 @@ bool ProcessAST::visit(AST::UiSourceElement *node) obj->dynamicSlots << slot; } else { QmlError error; - error.setDescription("JavaScript declaration outside Script element"); + error.setDescription(QCoreApplication::translate("QmlParser","JavaScript declaration outside Script element")); error.setLine(node->firstSourceLocation().startLine); error.setColumn(node->firstSourceLocation().startColumn); _parser->_errors << error; |