Commit d65986c8 authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

Completion of commit 4f9c87d8 : Replace QString("") by QString()

parent 2743c1bb
......@@ -155,7 +155,7 @@ class Comment
}
public:
Comment(QString text = "", int line = -1) : m_text(text), m_line(line), m_formatted(false)
Comment(QString text = QString(), int line = -1) : m_text(text), m_line(line), m_formatted(false)
{
}
......
......@@ -159,7 +159,7 @@ void UMLAssociation::saveToXMI(QDomDocument & qDoc, QDomElement & qElement)
{
if (m_AssocType == Uml::AssociationType::Generalization) {
QDomElement assocElement = UMLObject::save("UML:Generalization", qDoc);
assocElement.setAttribute("discriminator", "");
assocElement.setAttribute("discriminator", QString());
assocElement.setAttribute("child", Uml::ID::toString(getObjectId(RoleType::A)));
assocElement.setAttribute("parent", Uml::ID::toString(getObjectId(RoleType::B)));
qElement.appendChild(assocElement);
......@@ -237,7 +237,7 @@ bool UMLAssociation::load(QDomElement & element)
const QString fetch = (m_AssocType == Uml::AssociationType::Generalization ?
r == RoleType::A ? "child" : "parent"
: r == RoleType::A ? "client" : "supplier");
QString roleIdStr = element.attribute(fetch, "");
QString roleIdStr = element.attribute(fetch);
if (roleIdStr.isEmpty()) {
// Might be given as a child node instead - see below.
continue;
......@@ -709,7 +709,7 @@ void UMLAssociation::init(Uml::AssociationType::Enum type, UMLObject *roleAObj,
{
m_AssocType = type;
m_BaseType = ot_Association;
m_Name = "";
m_Name = QString();
m_bOldLoadMode = false;
nrof_parent_widgets = -1;
if (!UMLApp::app()->document()->loading()) {
......
......@@ -4,7 +4,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* copyright (C) 2002-2013 *
* copyright (C) 2002-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -33,7 +33,7 @@ namespace Uml
m_umlRole->setMultiplicity(m_oldMulti);
}
else {
m_umlRole->setMultiplicity("");
m_umlRole->setMultiplicity(QString());
}
}
......
......@@ -755,7 +755,7 @@ void ASWriter::writeOperations(QString classname, UMLOperationList *opList, QTex
UMLAttribute* at = atlIt.next();
as << cleanName(at->name())
<< (!(at->getInitialValue().isEmpty()) ? (QString(" = ")+at->getInitialValue()) : QString())
<< ((j < i-1)?", ":"");
<< ((j < i-1) ? ", " : QString());
}
as << ")" << m_endl << "{" << m_endl;
QString sourceCode = op->getSourceCode();
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -29,7 +29,7 @@ public:
UserGenerated ///< the content was entered by the user
};
explicit CodeBlock(CodeDocument * parent, const QString & body = "");
explicit CodeBlock(CodeDocument * parent, const QString & body = QString());
virtual ~CodeBlock();
void setContentType(ContentType new_var);
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -25,7 +25,7 @@ class CodeBlockWithComments : public CodeBlock
{
public:
explicit CodeBlockWithComments (CodeDocument * parent, const QString & body = "", const QString & comment = "");
explicit CodeBlockWithComments (CodeDocument * parent, const QString & body = QString(), const QString & comment = QString());
/**
* Empty Destructor
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -24,7 +24,7 @@ class CodeComment : public TextBlock
{
public:
explicit CodeComment(CodeDocument * doc, const QString & comment = "");
explicit CodeComment(CodeDocument * doc, const QString & comment = QString());
virtual ~CodeComment();
virtual void saveToXMI(QDomDocument & doc, QDomElement & root);
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -51,7 +51,7 @@ public:
virtual CodeBlockWithComments * getCodeBlockWithComments(const QString &tag, const QString &comment, int indentLevel);
CodeComment * addOrUpdateTaggedCodeComment(const QString &tag = "", const QString &text = "", int indentationLevel = 0);
CodeComment * addOrUpdateTaggedCodeComment(const QString &tag = QString(), const QString &text = QString(), int indentationLevel = 0);
CodeBlockWithComments * addOrUpdateTaggedCodeBlockWithComments
(const QString &tag, const QString &text, const QString &ctext,
......@@ -63,7 +63,7 @@ public:
* @return QString
* @param prefix
*/
virtual QString getUniqueTag(const QString& prefix = "") = 0;
virtual QString getUniqueTag(const QString& prefix = QString()) = 0;
/**
* Virtual methods that return a new code document objects.
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -35,7 +35,7 @@ public:
* Constructors
*/
CodeMethodBlock (ClassifierCodeDocument * doc, UMLObject * parentObj,
const QString & body = "", const QString & comment = "");
const QString & body = QString(), const QString & comment = QString());
/**
* Empty Destructor
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -29,7 +29,7 @@ public:
* Constructors
*/
CodeOperation (ClassifierCodeDocument * doc, UMLOperation * parent,
const QString & body = "", const QString & comment = "");
const QString & body = QString(), const QString & comment = QString());
/**
* Empty Destructor
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -71,7 +71,7 @@ QString CPPCodeClassField::getInitialValue()
return fixInitialStringDeclValue(at->getInitialValue(), getTypeName());
} else {
uError() << "parent object is not a UMLAttribute";
return "";
return QString();
}
}
else
......@@ -79,7 +79,7 @@ QString CPPCodeClassField::getInitialValue()
if(fieldIsSingleValue()) {
// FIX : IF the multiplicity is "1" then we should init a new object here, if its 0 or 1,
// then we can just return 'empty' string (minor problem).
return "";
return QString();
} else {
return " new "+getListFieldClassName()+"()";
}
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -35,7 +35,7 @@ void CPPCodeComment::saveToXMI (QDomDocument & doc, QDomElement & root)
QString CPPCodeComment::toString () const
{
QString output = "";
QString output;
// simple output method
if(getWriteOutText())
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -28,7 +28,7 @@ public:
/**
* Constructors.
*/
explicit CPPCodeComment (CodeDocument * doc, const QString & text = "");
explicit CPPCodeComment (CodeDocument * doc, const QString & text = QString());
/**
* Empty Destructor.
......@@ -49,7 +49,7 @@ public:
* UnFormat a long text string. Typically, this means removing
* the indentaion (linePrefix) and/or newline chars from each line.
*/
virtual QString unformatText (const QString & text, const QString & indent = "");
virtual QString unformatText (const QString & text, const QString & indent = QString());
/**
* A special version here because we want to not only indent
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -46,7 +46,7 @@ void CPPCodeDocumentation::saveToXMI(QDomDocument & doc, QDomElement & root)
*/
QString CPPCodeDocumentation::toString() const
{
QString output = "";
QString output;
// simple output method
if(getWriteOutText())
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -31,7 +31,7 @@ public:
/**
* Constructors
*/
explicit CPPCodeDocumentation (CodeDocument * doc, const QString & text = "");
explicit CPPCodeDocumentation (CodeDocument * doc, const QString & text = QString());
/**
* Empty Destructor
......@@ -51,7 +51,7 @@ public:
/** UnFormat a long text string. Typically, this means removing
* the indentaion (linePrefix) and/or newline chars from each line.
*/
virtual QString unformatText (const QString & text, const QString & indent = "");
virtual QString unformatText (const QString & text, const QString & indent = QString());
/** a special version here because we want to not only indent
* the new line, but to add the " * " sequence as well.
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -26,7 +26,7 @@
const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_APPEND = "%VARNAME%.push_back(value);";
const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_REMOVE = "int size = %VARNAME%.size();\nfor (int i = 0; i < size; ++i) {\n\t%ITEMCLASS% item = %VARNAME%.at(i);\n\tif(item == value) {\n\t\tvector<%ITEMCLASS%>::iterator it = %VARNAME%.begin() + i;\n\t\t%VARNAME%.erase(it);\n\t\treturn;\n\t}\n }";
const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_INIT = ""; // nothing to do in std::vector
const char * CPPCodeGenerationPolicy::DEFAULT_VECTOR_METHOD_INIT = " "; // nothing to do in std::vector
const char * CPPCodeGenerationPolicy::DEFAULT_OBJECT_METHOD_INIT = "%VARNAME% = new %ITEMCLASS%();";
/**
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -77,11 +77,11 @@ public:
/** More flexible generation. We want to allow the user to specify how the
* bodies of the vector methods should be auto-generated.
*/
QString getVectorMethodAppend(const QString & variableName ="", const QString & itemClassName = "");
QString getVectorMethodRemove(const QString & variableName ="", const QString & itemClassName = "");
QString getVectorMethodInit(const QString & variableName ="", const QString & itemClassName = "");
QString getVectorMethodAppend(const QString & variableName = QString(), const QString & itemClassName = QString());
QString getVectorMethodRemove(const QString & variableName = QString(), const QString & itemClassName = QString());
QString getVectorMethodInit(const QString & variableName = QString(), const QString & itemClassName = QString());
QString getObjectMethodInit(const QString & variableName ="", const QString & itemClassName = "");
QString getObjectMethodInit(const QString & variableName = QString(), const QString & itemClassName = QString());
virtual void setDefaults (CPPCodeGenerationPolicy * cppclone, bool emitUpdateSignal = true);
virtual void setDefaults(bool emitUpdateSignal = true);
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -90,7 +90,7 @@ void CPPHeaderClassDeclarationBlock::updateContent ()
// Now set START/ENDING Text
QString startText = "";
QString startText;
/*
*/
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -25,7 +25,7 @@ public:
/**
* Empty Constructor
*/
explicit CPPHeaderClassDeclarationBlock (CPPHeaderCodeDocument * parentDoc, const QString &start = "", const QString &endText = "}", const QString &comment = "");
explicit CPPHeaderClassDeclarationBlock (CPPHeaderCodeDocument * parentDoc, const QString &start = QString(), const QString &endText = "}", const QString &comment = QString());
/**
* Empty Destructor
......
......@@ -5,7 +5,7 @@
* (at your option) any later version. *
* *
* copyright (C) 2003 Brian Thomas <thomas@mail630.gsfc.nasa.gov> *
* copyright (C) 2004-2013 *
* copyright (C) 2004-2014 *
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
......@@ -51,7 +51,7 @@ void CPPHeaderCodeAccessorMethod::updateContent()
// Uml::Visibility scope = parentField->getVisibility();
QString variableName = cppfield->getFieldName();
QString itemClassName = cppfield->getTypeName();
QString text = "";
QString text;
if(isInlineMethod) {
switch(getType()) {
......@@ -144,7 +144,7 @@ void CPPHeaderCodeAccessorMethod::updateMethodDeclaration()
startText += " {";
else
startText += ';';
QString endText = (isInlineMethod ? "}" : "");
QString endText = (isInlineMethod ? "}" : QString());
setStartMethodText(startText);
setEndMethodText(endText);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment