From be16119048bb21dcf01f8c816f7908469574f4e4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint <Friedemann.Kleint@nokia.com> Date: Thu, 4 Feb 2010 11:29:28 +0100 Subject: [PATCH] Code scanning (QString) issues in QmlDesigner. Reviewed-by: Thomas Hartmann <thartman@trolltech.com> --- .../components/formeditor/itemcreatortool.cpp | 2 +- .../propertyeditor/basicwidgets.cpp | 6 +-- .../propertyeditor/propertyeditor.cpp | 6 +-- .../propertyeditor/propertyeditorvalue.cpp | 2 +- .../propertyeditor/propertyeditorvalue.h | 2 +- .../stateseditor/stateseditormodel.cpp | 2 +- .../filemanager/addarraymembervisitor.cpp | 2 +- .../core/instances/objectnodeinstance.cpp | 6 +-- .../core/metainfo/nodemetainfo.cpp | 2 +- .../core/metainfo/subcomponentmanager.cpp | 2 +- .../core/model/abstractproperty.cpp | 4 +- .../core/model/bindingproperty.cpp | 12 +++--- .../qmldesigner/core/model/modelmerger.cpp | 8 ++-- .../qmldesigner/core/model/modelnode.cpp | 6 +-- .../qmldesigner/core/model/qmlanchors.cpp | 2 +- .../qmldesigner/core/model/qmlmodelview.cpp | 4 +- .../core/model/qmltextgenerator.cpp | 2 +- .../qmldesigner/core/model/rewriteaction.cpp | 40 +++++++++---------- .../core/model/texttomodelmerger.cpp | 2 +- .../core/model/variantproperty.cpp | 4 +- 20 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp b/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp index 9376ed18dc4..d69d3533e8e 100644 --- a/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp +++ b/src/plugins/qmldesigner/components/formeditor/itemcreatortool.cpp @@ -165,7 +165,7 @@ void ItemCreatorTool::createAtItem(const QRectF &rect) pos = parentItem->mapFromScene(pos); } - QStringList list = m_itemString.split("^"); + QStringList list = m_itemString.split(QLatin1Char('^')); if (list.count() != 2) return; if (list.first() == "item") { diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp index d988c1605a1..bdbbfa809f5 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp @@ -430,7 +430,7 @@ public: _styleSheetFile.setScheme("file"); //### todo QString fileName; if (!QFileInfo(_styleSheetFile.toLocalFile()).exists()) - fileName = (":" + _styleSheetFile.toLocalFile().split(":").last()); //try if it is a resource + fileName = (QLatin1Char(':') + _styleSheetFile.toLocalFile().split(QLatin1Char(':')).last()); //try if it is a resource else fileName = (_styleSheetFile.toLocalFile()); QFile file(fileName); @@ -550,7 +550,7 @@ private: QString path; if (_url.scheme() == QLatin1String("qrc")) { - path = ":" + _url.path(); + path = QLatin1Char(':') + _url.path(); } else { path = _url.toLocalFile(); } @@ -623,7 +623,7 @@ private: QString path; if (_url.scheme() == QLatin1String("qrc")) { - path = ":" + _url.path(); + path = QLatin1Char(':') + _url.path(); } else { path = _url.toLocalFile(); } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index 5e5cd134c34..a07a2b7f94c 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -77,7 +77,7 @@ PropertyEditor::NodeType::~NodeType() void createPropertyEditorValue(const QmlObjectNode &fxObjectNode, const QString &name, const QVariant &value, QmlPropertyMap *propertyMap, PropertyEditor *propertyEditor) { QString propertyName(name); - propertyName.replace(".", "_"); + propertyName.replace(QLatin1Char('.'), QLatin1Char('_')); PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QmlMetaType::toQObject(propertyMap->value(propertyName))); if (!valueObject) { valueObject = new PropertyEditorValue(propertyMap); @@ -206,7 +206,7 @@ void PropertyEditor::changeValue(const QString &name) } QString propertyName(name); - propertyName.replace("_", "."); + propertyName.replace(QLatin1Char('_'), QLatin1Char('.')); PropertyEditorValue *value = qobject_cast<PropertyEditorValue*>(QmlMetaType::toQObject(m_currentType->m_backendValuesPropertyMap.value(name))); @@ -528,7 +528,7 @@ QUrl PropertyEditor::fileToUrl(const QString &filePath) const { if (filePath.isEmpty()) return fileUrl; - if (filePath.startsWith(":")) { + if (filePath.startsWith(QLatin1Char(':'))) { fileUrl.setScheme("qrc"); QString path = filePath; path.remove(0, 1); // remove trailing ':' diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index b2191943042..4fa12cf2e06 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -239,7 +239,7 @@ void PropertyEditorNodeWrapper::add(const QString &type) QString propertyType = type; if ((m_editorValue && m_editorValue->modelNode().isValid())) { - if (propertyType == "") + if (propertyType.isEmpty()) propertyType = m_editorValue->modelNode().metaInfo().property(m_editorValue->name()).type(); while (propertyType.contains('*')) //strip star propertyType.chop(1); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h index 2ff94fac60b..22236f01582 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h @@ -57,7 +57,7 @@ public: QString propertyName() const; public slots: - void add(const QString &type = ""); + void add(const QString &type = QString()); void remove(); void changeValue(const QString &name); void update(); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index e9b43028995..42feb1e239b 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -71,7 +71,7 @@ QVariant StatesEditorModel::data(const QModelIndex &index, int role) const QVariant result; switch (role) { case StateNameRole: { - if ((index.row()==0) && (m_stateNames.at(index.row())=="")) + if ((index.row()==0) && m_stateNames.at(index.row()).isEmpty()) result = QString("base state"); else result = m_stateNames.at(index.row()); diff --git a/src/plugins/qmldesigner/core/filemanager/addarraymembervisitor.cpp b/src/plugins/qmldesigner/core/filemanager/addarraymembervisitor.cpp index f8ab6cb7bda..23c0bbea5c5 100644 --- a/src/plugins/qmldesigner/core/filemanager/addarraymembervisitor.cpp +++ b/src/plugins/qmldesigner/core/filemanager/addarraymembervisitor.cpp @@ -105,7 +105,7 @@ void AddArrayMemberVisitor::insertInto(QmlJS::AST::UiArrayBinding *arrayBinding) void AddArrayMemberVisitor::convertAndAdd(QmlJS::AST::UiObjectBinding *objectBinding) { const int indentDepth = calculateIndentDepth(objectBinding->firstSourceLocation()); - const QString arrayPrefix = QLatin1String("[\n") + addIndentation(QLatin1String(""), indentDepth); + const QString arrayPrefix = QLatin1String("[\n") + addIndentation(QString(), indentDepth); replace(objectBinding->qualifiedTypeNameId->identifierToken.offset, 0, arrayPrefix); const int insertionPoint = objectBinding->lastSourceLocation().end(); replace(insertionPoint, 0, diff --git a/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp b/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp index 68b8501eb92..5edac2bbe7b 100644 --- a/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp +++ b/src/plugins/qmldesigner/core/instances/objectnodeinstance.cpp @@ -489,7 +489,7 @@ QVariant ObjectNodeInstance::property(const QString &name) const return QVariant(); if (url.scheme() == "file") { - int basePathLength = nodeInstanceView()->model()->fileUrl().toLocalFile().lastIndexOf("/"); + int basePathLength = nodeInstanceView()->model()->fileUrl().toLocalFile().lastIndexOf('/'); return QUrl(url.toLocalFile().mid(basePathLength + 1)); } } @@ -612,11 +612,11 @@ QStringList propertyNameForWritableProperties(QObject *object, const QString &ba if (metaProperty.isReadable() && !metaProperty.isWritable()) { QObject *childObject = QmlMetaType::toQObject(metaProperty.read(object)); if (childObject) - propertyNameList.append(propertyNameForWritableProperties(childObject, baseName + QString::fromUtf8(metaProperty.name()) + ".")); + propertyNameList.append(propertyNameForWritableProperties(childObject, baseName + QString::fromUtf8(metaProperty.name()) + '.')); } else if (QmlValueTypeFactory::valueType(metaProperty.userType())) { QmlValueType *valueType = QmlValueTypeFactory::valueType(metaProperty.userType()); valueType->setValue(metaProperty.read(object)); - propertyNameList.append(propertyNameForWritableProperties(valueType, baseName + QString::fromUtf8(metaProperty.name()) + ".")); + propertyNameList.append(propertyNameForWritableProperties(valueType, baseName + QString::fromUtf8(metaProperty.name()) + '.')); } else if (metaProperty.isReadable() && metaProperty.isWritable()) { propertyNameList.append(baseName + QString::fromUtf8(metaProperty.name())); } diff --git a/src/plugins/qmldesigner/core/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/core/metainfo/nodemetainfo.cpp index 3498b5c4190..ce6e9a303a5 100644 --- a/src/plugins/qmldesigner/core/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/core/metainfo/nodemetainfo.cpp @@ -278,7 +278,7 @@ QHash<QString,PropertyMetaInfo> NodeMetaInfo::dotProperties() const while (iter.hasNext()) { iter.next(); if (!propertiesInfo.contains(iter.key()) && iter.key() != "objectName") - propertiesInfo.insert(propertyName + "." + iter.key(), iter.value()); + propertiesInfo.insert(propertyName + '.' + iter.key(), iter.value()); } } } diff --git a/src/plugins/qmldesigner/core/metainfo/subcomponentmanager.cpp b/src/plugins/qmldesigner/core/metainfo/subcomponentmanager.cpp index 2f0de684a3b..daa243d9098 100644 --- a/src/plugins/qmldesigner/core/metainfo/subcomponentmanager.cpp +++ b/src/plugins/qmldesigner/core/metainfo/subcomponentmanager.cpp @@ -223,7 +223,7 @@ void SubComponentManagerPrivate::parseDirectory(const QString &dirPath) while (newIter != newList.constEnd()) { parseFile(newIter->filePath()); if (debug) - qDebug() << "m_watcher.addPath(" << newIter->filePath() << ")"; + qDebug() << "m_watcher.addPath(" << newIter->filePath() << ')'; m_watcher.addPath(newIter->filePath()); ++newIter; } diff --git a/src/plugins/qmldesigner/core/model/abstractproperty.cpp b/src/plugins/qmldesigner/core/model/abstractproperty.cpp index 8cac43a3e74..4574f2b0462 100644 --- a/src/plugins/qmldesigner/core/model/abstractproperty.cpp +++ b/src/plugins/qmldesigner/core/model/abstractproperty.cpp @@ -415,12 +415,12 @@ uint qHash(const AbstractProperty &property) QDebug operator<<(QDebug debug, const AbstractProperty &property) { - return debug.nospace() << "AbstractProperty(" << (property.isValid() ? property.name() : QLatin1String("invalid")) << ")"; + return debug.nospace() << "AbstractProperty(" << (property.isValid() ? property.name() : QLatin1String("invalid")) << ')'; } QTextStream& operator<<(QTextStream &stream, const AbstractProperty &property) { - stream << "AbstractProperty(" << property.name() << ")"; + stream << "AbstractProperty(" << property.name() << ')'; return stream; } diff --git a/src/plugins/qmldesigner/core/model/bindingproperty.cpp b/src/plugins/qmldesigner/core/model/bindingproperty.cpp index e00f92f5e36..bbb68cba1fa 100644 --- a/src/plugins/qmldesigner/core/model/bindingproperty.cpp +++ b/src/plugins/qmldesigner/core/model/bindingproperty.cpp @@ -102,7 +102,7 @@ BindingProperty& BindingProperty::operator= (const QString &expression) static ModelNode resolveBinding(const QString &binding, ModelNode currentNode, AbstractView* view) { int i = 0; - QString element = binding.split(".").at(0); + QString element = binding.split(QLatin1Char('.')).at(0); while (!element.isEmpty()) { if (element == "parent") { @@ -119,10 +119,10 @@ static ModelNode resolveBinding(const QString &binding, ModelNode currentNode, A currentNode = view->modelNodeForId(element); //id } i++; - if (i < binding.split(".").count()) - element = binding.split(".").at(i); + if (i < binding.split(QLatin1Char('.')).count()) + element = binding.split(QLatin1Char('.')).at(i); else - element = ""; + element.clear(); } return currentNode; @@ -144,8 +144,8 @@ AbstractProperty BindingProperty::resolveToProperty() const QString binding = expression(); ModelNode node = parentModelNode(); QString element; - if (binding.contains(".")) { - element = binding.split(".").last(); + if (binding.contains(QLatin1Char('.'))) { + element = binding.split(QLatin1Char('.')).last(); QString nodeBinding = binding; nodeBinding.chop(element.length()); node = resolveBinding(nodeBinding, parentModelNode(), view()); diff --git a/src/plugins/qmldesigner/core/model/modelmerger.cpp b/src/plugins/qmldesigner/core/model/modelmerger.cpp index b680c37d16e..aad50b8120b 100644 --- a/src/plugins/qmldesigner/core/model/modelmerger.cpp +++ b/src/plugins/qmldesigner/core/model/modelmerger.cpp @@ -72,7 +72,7 @@ static void syncBindingProperties(ModelNode &outputNode, const ModelNode &inputN static void syncId(ModelNode &outputNode, const ModelNode &inputNode, const QHash<QString, QString> &idRenamingHash) { - if (!inputNode.id().isNull() && inputNode.id() != "") { + if (!inputNode.id().isNull() && !inputNode.id().isEmpty()) { outputNode.setId(idRenamingHash.value(inputNode.id())); } } @@ -82,7 +82,7 @@ static void setupIdRenamingHash(const ModelNode &modelNode, QHash<QString, QStri QList<ModelNode> allNodes(modelNode.allSubModelNodes()); allNodes.append(modelNode); foreach (const ModelNode &node, allNodes) { - if (!node.id().isNull() && node.id() != "") { + if (!node.id().isNull() && !node.id().isEmpty()) { QString newId = node.id(); int i = 1; while (view->hasId(newId) || idRenamingHash.contains(newId)) { @@ -96,7 +96,7 @@ static void setupIdRenamingHash(const ModelNode &modelNode, QHash<QString, QStri static void syncNodeProperties(ModelNode &outputNode, const ModelNode &inputNode, const QHash<QString, QString> &idRenamingHash, AbstractView *view) { - foreach (NodeProperty nodeProperty, inputNode.nodeProperties()) { + foreach (const NodeProperty &nodeProperty, inputNode.nodeProperties()) { ModelNode newNode = createNodeFromNode(nodeProperty.modelNode(), idRenamingHash, view); outputNode.nodeProperty(nodeProperty.name()).reparentHere(newNode); } @@ -104,7 +104,7 @@ static void syncNodeProperties(ModelNode &outputNode, const ModelNode &inputNode static void syncNodeListProperties(ModelNode &outputNode, const ModelNode &inputNode, const QHash<QString, QString> &idRenamingHash, AbstractView *view) { - foreach (NodeListProperty nodeListProperty, inputNode.nodeListProperties()) { + foreach (const NodeListProperty &nodeListProperty, inputNode.nodeListProperties()) { foreach (const ModelNode &node, nodeListProperty.toModelNodeList()) { ModelNode newNode = createNodeFromNode(node, idRenamingHash, view); outputNode.nodeListProperty(nodeListProperty.name()).reparentHere(newNode); diff --git a/src/plugins/qmldesigner/core/model/modelnode.cpp b/src/plugins/qmldesigner/core/model/modelnode.cpp index 3cf2621e5a0..0026a6566d4 100644 --- a/src/plugins/qmldesigner/core/model/modelnode.cpp +++ b/src/plugins/qmldesigner/core/model/modelnode.cpp @@ -249,7 +249,7 @@ QString ModelNode::simplifiedTypeName() const throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__); } - return type().split("/").last(); + return type().split(QLatin1Char('/')).last(); } /*! \brief Returns whether the node is valid @@ -842,7 +842,7 @@ QDebug operator<<(QDebug debug, const ModelNode &modelNode) debug.nospace() << "ModelNode(" << modelNode.internalNode().data() << ", " << modelNode.type() << ", " - << modelNode.id() <<")"; + << modelNode.id() << ')'; } else { debug.nospace() << "ModelNode(invalid)"; } @@ -855,7 +855,7 @@ QTextStream& operator<<(QTextStream &stream, const ModelNode &modelNode) if (modelNode.isValid()) { stream << "ModelNode(" << "type: " << modelNode.type() << ", " - << "id: " << modelNode.id() <<")"; + << "id: " << modelNode.id() << ')'; } else { stream << "ModelNode(invalid)"; } diff --git a/src/plugins/qmldesigner/core/model/qmlanchors.cpp b/src/plugins/qmldesigner/core/model/qmlanchors.cpp index 9cb00a5de06..8f8e0500599 100644 --- a/src/plugins/qmldesigner/core/model/qmlanchors.cpp +++ b/src/plugins/qmldesigner/core/model/qmlanchors.cpp @@ -145,7 +145,7 @@ void QmlAnchors::setAnchor(AnchorLine::Type sourceAnchorLine, QString targetExpression = targetQmlItemNode.modelNode().validId(); if (targetQmlItemNode.modelNode() == qmlItemNode().modelNode().parentProperty().parentModelNode()) targetExpression = "parent"; - targetExpression = targetExpression + "." + lineTypeToString(targetAnchorLine); + targetExpression = targetExpression + QLatin1Char('.') + lineTypeToString(targetAnchorLine); qmlItemNode().modelNode().bindingProperty(propertyName).setExpression(targetExpression); } } diff --git a/src/plugins/qmldesigner/core/model/qmlmodelview.cpp b/src/plugins/qmldesigner/core/model/qmlmodelview.cpp index d8103a8a5ce..535e5184e9a 100644 --- a/src/plugins/qmldesigner/core/model/qmlmodelview.cpp +++ b/src/plugins/qmldesigner/core/model/qmlmodelview.cpp @@ -115,7 +115,7 @@ QmlItemNode QmlModelView::createQmlItemNodeFromImage(const QString &imageName, c QString id; int i = 1; QString name("image"); - name.replace(" ", ""); + name.remove(QLatin1Char(' ')); do { id = name + QString::number(i); i++; @@ -159,7 +159,7 @@ QmlItemNode QmlModelView::createQmlItemNode(const ItemLibraryInfo &itemLibraryRe QString id; int i = 1; QString name(itemLibraryRepresentation.name()); - name.replace(" ", ""); + name.remove(QLatin1Char(' ')); do { id = name + QString::number(i); i++; diff --git a/src/plugins/qmldesigner/core/model/qmltextgenerator.cpp b/src/plugins/qmldesigner/core/model/qmltextgenerator.cpp index 32c6c00bf2a..4da1e2ad31e 100644 --- a/src/plugins/qmldesigner/core/model/qmltextgenerator.cpp +++ b/src/plugins/qmldesigner/core/model/qmltextgenerator.cpp @@ -72,7 +72,7 @@ QString QmlTextGenerator::toQml(const AbstractProperty &property, int indentDept result += arrayContentIndentation; result += toQml(nodes.at(i), arrayContentDepth); } - return result + QLatin1String("]"); + return result + QLatin1Char(']'); } } else if (property.isVariantProperty()) { const VariantProperty variantProperty = property.toVariantProperty(); diff --git a/src/plugins/qmldesigner/core/model/rewriteaction.cpp b/src/plugins/qmldesigner/core/model/rewriteaction.cpp index 37bc0219462..02012c89652 100644 --- a/src/plugins/qmldesigner/core/model/rewriteaction.cpp +++ b/src/plugins/qmldesigner/core/model/rewriteaction.cpp @@ -89,7 +89,7 @@ bool AddPropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePos if (!result) { qDebug() << "*** AddPropertyRewriteAction::execute failed in addToObjectMemberList(" - << nodeLocation << "," + << nodeLocation << ',' << m_valueText << ") **" << info(); } @@ -98,8 +98,8 @@ bool AddPropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePos if (!result) { qDebug() << "*** AddPropertyRewriteAction::execute failed in addProperty(" - << nodeLocation << "," - << m_property.name() << "," + << nodeLocation << ',' + << m_property.name() << ',' << m_valueText << ", ScriptBinding) **" << info(); } @@ -124,8 +124,8 @@ bool ChangeIdRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, Mo if (!result) { qDebug() << "*** ChangeIdRewriteAction::execute failed in addProperty(" - << nodeLocation << "," - << idPropertyName << "," + << nodeLocation << ',' + << idPropertyName << ',' << m_newId << ", ScriptBinding) **" << info(); } @@ -134,7 +134,7 @@ bool ChangeIdRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, Mo if (!result) { qDebug() << "*** ChangeIdRewriteAction::execute failed in removeProperty(" - << nodeLocation << "," + << nodeLocation << ',' << idPropertyName << ") **" << info(); } @@ -143,8 +143,8 @@ bool ChangeIdRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, Mo if (!result) { qDebug() << "*** ChangeIdRewriteAction::execute failed in changeProperty(" - << nodeLocation << "," - << idPropertyName << "," + << nodeLocation << ',' + << idPropertyName << ',' << m_newId << ", ScriptBinding) **" << info(); } @@ -168,7 +168,7 @@ bool ChangePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactori if (!result) { qDebug() << "*** ChangePropertyRewriteAction::execute failed in addToObjectMemberList(" - << nodeLocation << "," + << nodeLocation << ',' << m_valueText << ") **" << info(); } @@ -177,8 +177,8 @@ bool ChangePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactori if (!result) { qDebug() << "*** ChangePropertyRewriteAction::execute failed in addToArrayMemberList(" - << nodeLocation << "," - << m_property.name() << "," + << nodeLocation << ',' + << m_property.name() << ',' << m_valueText << ") **" << info(); } @@ -187,9 +187,9 @@ bool ChangePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactori if (!result) { qDebug() << "*** ChangePropertyRewriteAction::execute failed in changeProperty(" - << nodeLocation << "," - << m_property.name() << "," - << m_valueText << "," + << nodeLocation << ',' + << m_property.name() << ',' + << m_valueText << ',' << qPrintable(toString(m_propertyType)) << ") **" << info(); } @@ -221,7 +221,7 @@ bool ChangeTypeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring, result = refactoring.changeObjectType(nodeLocation, newNodeType); if (!result) { qDebug() << "*** ChangeTypeRewriteAction::execute failed in changeObjectType(" - << nodeLocation << "," + << nodeLocation << ',' << newNodeType << ") **" << info(); } @@ -258,7 +258,7 @@ bool RemovePropertyRewriteAction::execute(QmlDesigner::QmlRefactoring &refactori bool result = refactoring.removeProperty(nodeLocation, m_property.name()); if (!result) { qDebug() << "*** RemovePropertyRewriteAction::execute failed in removeProperty(" - << nodeLocation << "," + << nodeLocation << ',' << m_property.name() << ") **" << info(); } @@ -285,9 +285,9 @@ bool ReparentNodeRewriteAction::execute(QmlDesigner::QmlRefactoring &refactoring result = refactoring.moveObject(nodeLocation, targetPropertyName, isArrayBinding, targetParentObjectLocation); if (!result) { qDebug() << "*** ReparentNodeRewriteAction::execute failed in moveObject(" - << nodeLocation << "," - << targetPropertyName << "," - << isArrayBinding << "," + << nodeLocation << ',' + << targetPropertyName << ',' + << isArrayBinding << ',' << targetParentObjectLocation << ") **" << info(); } @@ -316,7 +316,7 @@ bool MoveNodeRewriteAction::execute(QmlRefactoring &refactoring, result = refactoring.moveObjectBeforeObject(movingNodeLocation, newTrailingNodeLocation); if (!result) { qDebug() << "*** MoveNodeRewriteAction::execute failed in moveObjectBeforeObject(" - << movingNodeLocation << "," + << movingNodeLocation << ',' << newTrailingNodeLocation << ") **" << info(); } diff --git a/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp index ca325c6f4b8..bf089454ecd 100644 --- a/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp @@ -590,7 +590,7 @@ void TextToModelMerger::setupComponent(const ModelNode &node) if (componentText.isEmpty()) return; - QString result = ""; + QString result; if (componentText.contains("Component")) { //explicit component FirstDefinitionFinder firstDefinitionFinder(componentText); int offset = firstDefinitionFinder(0); diff --git a/src/plugins/qmldesigner/core/model/variantproperty.cpp b/src/plugins/qmldesigner/core/model/variantproperty.cpp index 1c066ef4914..6d0bb15899b 100644 --- a/src/plugins/qmldesigner/core/model/variantproperty.cpp +++ b/src/plugins/qmldesigner/core/model/variantproperty.cpp @@ -133,11 +133,11 @@ VariantProperty& VariantProperty::operator= (const QPair<QString, QVariant> &typ QDebug operator<<(QDebug debug, const VariantProperty &VariantProperty) { - return debug.nospace() << "VariantProperty(" << VariantProperty.name() << ")"; + return debug.nospace() << "VariantProperty(" << VariantProperty.name() << ')'; } QTextStream& operator<<(QTextStream &stream, const VariantProperty &property) { - stream << "VariantProperty(" << property.name() << ")"; + stream << "VariantProperty(" << property.name() << ')'; return stream; } -- GitLab