From 4d78b867314520537dd9185f49029ff8d4c49464 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 29 Aug 2012 13:37:49 +0200 Subject: Use QString() instead of "". Change-Id: I42c55344663808b8362e2c9185273a00fc1c70b0 Reviewed-by: Martin Smith --- src/tools/qdoc/cppcodemarker.cpp | 66 ++++++++++++++++++------------------- src/tools/qdoc/ditaxmlgenerator.cpp | 4 +-- src/tools/qdoc/doc.cpp | 8 ++--- src/tools/qdoc/htmlgenerator.cpp | 2 +- src/tools/qdoc/node.h | 10 +++--- src/tools/qdoc/qmlvisitor.cpp | 4 +-- src/tools/qdoc/tree.cpp | 22 ++++++------- 7 files changed, 58 insertions(+), 58 deletions(-) (limited to 'src/tools') diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index 80fb75a13b..61f1b76ede 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -486,66 +486,66 @@ QList
CppCodeMarker::sections(const InnerNode *inner, if (style == Summary) { FastSection privateFunctions(classe, "Private Functions", - "", + QString(), "private function", "private functions"); - FastSection privateSlots(classe, "Private Slots", "", "private slot", "private slots"); - FastSection privateTypes(classe, "Private Types", "", "private type", "private types"); + FastSection privateSlots(classe, "Private Slots", QString(), "private slot", "private slots"); + FastSection privateTypes(classe, "Private Types", QString(), "private type", "private types"); FastSection protectedFunctions(classe, "Protected Functions", - "", + QString(), "protected function", "protected functions"); FastSection protectedSlots(classe, "Protected Slots", - "", + QString(), "protected slot", "protected slots"); FastSection protectedTypes(classe, "Protected Types", - "", + QString(), "protected type", "protected types"); FastSection protectedVariables(classe, "Protected Variables", - "", + QString(), "protected type", "protected variables"); FastSection publicFunctions(classe, "Public Functions", - "", + QString(), "public function", "public functions"); - FastSection publicSignals(classe, "Signals", "", "signal", "signal"); - FastSection publicSlots(classe, "Public Slots", "", "public slot", "public slots"); - FastSection publicTypes(classe, "Public Types", "", "public type", "public types"); + FastSection publicSignals(classe, "Signals", QString(), "signal", "signal"); + FastSection publicSlots(classe, "Public Slots", QString(), "public slot", "public slots"); + FastSection publicTypes(classe, "Public Types", QString(), "public type", "public types"); FastSection publicVariables(classe, "Public Variables", - "", + QString(), "public variable", "public variables"); - FastSection properties(classe, "Properties", "", "property", "properties"); + FastSection properties(classe, "Properties", QString(), "property", "properties"); FastSection relatedNonMembers(classe, "Related Non-Members", - "", + QString(), "related non-member", "related non-members"); FastSection staticPrivateMembers(classe, "Static Private Members", - "", + QString(), "static private member", "static private members"); FastSection staticProtectedMembers(classe, "Static Protected Members", - "", + QString(), "static protected member", "static protected members"); FastSection staticPublicMembers(classe, "Static Public Members", - "", + QString(), "static public member", "static public members"); - FastSection macros(inner, "Macros", "", "macro", "macros"); + FastSection macros(inner, "Macros", QString(), "macro", "macros"); NodeList::ConstIterator r = classe->relatedNodes().constBegin(); while (r != classe->relatedNodes().constEnd()) { @@ -737,7 +737,7 @@ QList
CppCodeMarker::sections(const InnerNode *inner, append(sections, macros); } else { - FastSection all(classe,"","","member","members"); + FastSection all(classe,QString(),QString(),"member","members"); QStack stack; stack.push(classe); @@ -767,29 +767,29 @@ QList
CppCodeMarker::sections(const InnerNode *inner, if (style == Summary || style == Detailed) { FastSection namespaces(inner, "Namespaces", - style == Detailed ? "nmspace" : "", + style == Detailed ? "nmspace" : QString(), "namespace", "namespaces"); FastSection classes(inner, "Classes", - style == Detailed ? "classes" : "", + style == Detailed ? "classes" : QString(), "class", "classes"); FastSection types(inner, style == Summary ? "Types" : "Type Documentation", - style == Detailed ? "types" : "", + style == Detailed ? "types" : QString(), "type", "types"); FastSection functions(inner, style == Summary ? "Functions" : "Function Documentation", - style == Detailed ? "func" : "", + style == Detailed ? "func" : QString(), "function", "functions"); FastSection macros(inner, style == Summary ? "Macros" : "Macro Documentation", - style == Detailed ? "macros" : "", + style == Detailed ? "macros" : QString(), "macro", "macros"); @@ -928,7 +928,7 @@ QString CppCodeMarker::addMarkUp(const QString &in, j++; } - QString out(""); + QString out; int braceDepth = 0; int parenDepth = 0; int i = 0; @@ -1138,37 +1138,37 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno if (style == Summary) { FastSection qmlproperties(qmlClassNode, "Properties", - "", + QString(), "property", "properties"); FastSection qmlattachedproperties(qmlClassNode, "Attached Properties", - "", + QString(), "property", "properties"); FastSection qmlsignals(qmlClassNode, "Signals", - "", + QString(), "signal", "signals"); FastSection qmlsignalhandlers(qmlClassNode, "Signal Handlers", - "", + QString(), "signal handler", "signal handlers"); FastSection qmlattachedsignals(qmlClassNode, "Attached Signals", - "", + QString(), "signal", "signals"); FastSection qmlmethods(qmlClassNode, "Methods", - "", + QString(), "method", "methods"); FastSection qmlattachedmethods(qmlClassNode, "Attached Methods", - "", + QString(), "method", "methods"); @@ -1324,7 +1324,7 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno append(sections,qmlattachedmethods); } else { - FastSection all(qmlClassNode,"","","member","members"); + FastSection all(qmlClassNode,QString(),QString(),"member","members"); const QmlClassNode* current = qmlClassNode; while (current != 0) { diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index db713fcdf3..8c945a2683 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -2339,7 +2339,7 @@ void DitaXmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker) generateText(text, dn, marker); writeEndTag(); //

Doc::quoteFromFile(dn->doc().location(), quoter, dn->name()); - QString code = quoter.quoteTo(dn->location(), "", ""); + QString code = quoter.quoteTo(dn->location(), QString(), QString()); text.clear(); text << Atom(Atom::Code, code); generateText(text, dn, marker); @@ -2602,7 +2602,7 @@ void DitaXmlGenerator::generateTableOfContents(const Node* node, if (toc.isEmpty()) return; - QString nodeName = ""; + QString nodeName; if (node != relative) nodeName = node->name(); diff --git a/src/tools/qdoc/doc.cpp b/src/tools/qdoc/doc.cpp index c52b44f72b..dd6fb1d1ff 100644 --- a/src/tools/qdoc/doc.cpp +++ b/src/tools/qdoc/doc.cpp @@ -355,7 +355,7 @@ class DocPrivate : public Shared public: DocPrivate(const Location& start = Location::null, const Location& end = Location::null, - const QString& source = ""); + const QString& source = QString()); ~DocPrivate(); void addAlso(const Text& also); @@ -473,7 +473,7 @@ private: void startSection(Doc::Sections unit, int cmd); void endSection(int unit, int endCmd); void parseAlso(); - void append(Atom::Type type, const QString& string = ""); + void append(Atom::Type type, const QString& string = QString()); void append(Atom::Type type, const QString& p1, const QString& p2); void appendChar(QChar ch); void appendWord(const QString &word); @@ -482,7 +482,7 @@ private: void startNewPara(); void enterPara(Atom::Type leftType = Atom::ParaLeft, Atom::Type rightType = Atom::ParaRight, - const QString& string = ""); + const QString& string = QString()); void leavePara(); void leaveValue(); void leaveValueList(); @@ -1149,7 +1149,7 @@ void DocParser::parse(const QString& source, Doc::quoteFromFile(location(), quoter, fileName); if (!quoting) { append(Atom::Code, - quoter.quoteTo(location(), cmdStr, "")); + quoter.quoteTo(location(), cmdStr, QString())); quoter.reset(); } else { diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 0d3cbcdea3..bd4dc79f05 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -781,7 +781,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, << protectEnc(atom->string()) << "]"; } else { - QString prefix = ""; + QString prefix; if (!baseDir().isEmpty()) prefix = "../"; out() << " &baseClasses() const { return bases; } @@ -713,9 +713,9 @@ class Parameter public: Parameter() {} Parameter(const QString& leftType, - const QString& rightType = "", - const QString& name = "", - const QString& defaultValue = ""); + const QString& rightType = QString(), + const QString& name = QString(), + const QString& defaultValue = QString()); Parameter(const Parameter& p); Parameter& operator=(const Parameter& p); diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index 318ce1431a..14312df63a 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -472,7 +472,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) QList parameters; for (QQmlJS::AST::UiParameterList *it = member->parameters; it; it = it->next) { if (!it->type.isEmpty() && !it->name.isEmpty()) - parameters.append(Parameter(it->type.toString(), "", it->name.toString())); + parameters.append(Parameter(it->type.toString(), QString(), it->name.toString())); } qmlSignal->setParameters(parameters); @@ -545,7 +545,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd) if (formals) { QQmlJS::AST::FormalParameterList* fpl = formals; do { - parameters.append(Parameter(QString(""), QString(""), fpl->name.toString())); + parameters.append(Parameter(QString(), QString(), fpl->name.toString())); fpl = fpl->next; } while (fpl && fpl != formals); qmlMethod->setParameters(parameters); diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 9f7eb70705..d9851c5120 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -110,7 +110,7 @@ public: The default constructor is the only constructor. */ Tree::Tree() - : roo(0, "") + : roo(0, QString()) { priv = new TreePrivate; } @@ -945,7 +945,7 @@ void Tree::readIndexFile(const QString& path) // when the -installdir command line option is set. QString indexUrl; if (Config::installDir.isEmpty()) { - indexUrl = indexElement.attribute("url", ""); + indexUrl = indexElement.attribute("url", QString()); } else { // Use a fake directory, since we will copy the output to a sub directory of @@ -1011,7 +1011,7 @@ void Tree::readIndexSection(const QDomElement& element, QmlClassNode* qcn = new QmlClassNode(parent, name); qcn->setTitle(element.attribute("title")); if (element.hasAttribute("location")) - name = element.attribute("location", ""); + name = element.attribute("location", QString()); if (!indexUrl.isEmpty()) location = Location(indexUrl + QLatin1Char('/') + name); else if (!indexUrl.isNull()) @@ -1022,7 +1022,7 @@ void Tree::readIndexSection(const QDomElement& element, QmlBasicTypeNode* qbtn = new QmlBasicTypeNode(parent, name); qbtn->setTitle(element.attribute("title")); if (element.hasAttribute("location")) - name = element.attribute("location", ""); + name = element.attribute("location", QString()); if (!indexUrl.isEmpty()) location = Location(indexUrl + QLatin1Char('/') + name); else if (!indexUrl.isNull()) @@ -1079,7 +1079,7 @@ void Tree::readIndexSection(const QDomElement& element, docNode->setTitle(element.attribute("title")); if (element.hasAttribute("location")) - name = element.attribute("location", ""); + name = element.attribute("location", QString()); if (!indexUrl.isEmpty()) location = Location(indexUrl + QLatin1Char('/') + name); @@ -1179,7 +1179,7 @@ void Tree::readIndexSection(const QDomElement& element, Parameter parameter(child.attribute("left"), child.attribute("right"), child.attribute("name"), - ""); // child.attribute("default") + QString()); // child.attribute("default") functionNode->addParameter(parameter); child = child.nextSiblingElement("parameter"); } @@ -2189,7 +2189,7 @@ void Tree::generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inn QStringList pieces = gen_->fullDocumentLocation(node,true).split(QLatin1Char('#')); writer.writeTextElement("anchorfile", pieces[0]); writer.writeTextElement("anchor", pieces[1]); - writer.writeTextElement("arglist", ""); + writer.writeTextElement("arglist", QString()); } writer.writeEndElement(); // member break; @@ -2200,7 +2200,7 @@ void Tree::generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inn writer.writeTextElement("name", objName); QStringList pieces = gen_->fullDocumentLocation(node).split(QLatin1Char('#')); writer.writeTextElement("anchor", pieces[1]); - writer.writeTextElement("arglist", ""); + writer.writeTextElement("arglist", QString()); writer.writeEndElement(); // member for (int i = 0; i < enumNode->items().size(); ++i) { @@ -2208,7 +2208,7 @@ void Tree::generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inn writer.writeStartElement("member"); writer.writeAttribute("name", item.name()); writer.writeTextElement("anchor", pieces[1]); - writer.writeTextElement("arglist", ""); + writer.writeTextElement("arglist", QString()); writer.writeEndElement(); // member } } @@ -2220,12 +2220,12 @@ void Tree::generateTagFileMembers(QXmlStreamWriter& writer, const InnerNode* inn if (typedefNode->associatedEnum()) writer.writeAttribute("type", typedefNode->associatedEnum()->fullDocumentName()); else - writer.writeAttribute("type", ""); + writer.writeAttribute("type", QString()); writer.writeTextElement("name", objName); QStringList pieces = gen_->fullDocumentLocation(node,true).split(QLatin1Char('#')); writer.writeTextElement("anchorfile", pieces[0]); writer.writeTextElement("anchor", pieces[1]); - writer.writeTextElement("arglist", ""); + writer.writeTextElement("arglist", QString()); } writer.writeEndElement(); // member break; -- cgit v1.2.3