[Uml-devel] KDE/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Jun 17 13:38:31 UTC 2007
SVN commit 676702 by okellogg:
EBN Krazy #5 (check for adding single char to a QString)
M +1 -0 codegenerators/codegenpolicyext.h
M +1 -1 codegenerators/csharpwriter.cpp
M +2 -2 codegenerators/dcodeoperation.cpp
M +12 -12 codegenerators/dwriter.cpp
M +2 -2 codegenerators/javawriter.cpp
M +2 -2 codeimport/nativeimportbase.cpp
M +2 -2 combinedfragmentwidget.cpp
M +1 -1 dialogs/codeeditor.cpp
M +2 -1 floatingdashlinewidget.cpp
M +1 -1 import_rose.cpp
M +2 -2 objectnodewidget.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codegenpolicyext.h #676701:676702
@@ -28,6 +28,7 @@
*/
class CodeGenPolicyExt : public QObject {
+ Q_OBJECT
public:
CodeGenPolicyExt() {}
virtual ~CodeGenPolicyExt() {}
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/csharpwriter.cpp #676701:676702
@@ -637,7 +637,7 @@
writeAttribute(roleDoc, a->getVisibility(Uml::B), false, typeName, roleName, "", ( a->getVisibility(Uml::B) != Uml::Visibility::Private), cs);
} else {
// array
- roleDoc += "\n(Array of " + typeName + ")";
+ roleDoc += "\n(Array of " + typeName + ')';
writeAttribute(roleDoc, a->getVisibility(Uml::B), false, "ArrayList", roleName, "", ( a->getVisibility(Uml::B) != Uml::Visibility::Private), cs);
}
}
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/dcodeoperation.cpp #676701:676702
@@ -77,7 +77,7 @@
startText += o->getName();
// (g) params
- startText += "(";
+ startText += '(';
// assemble parameters
QString paramStr = QString("");
@@ -95,7 +95,7 @@
startText += paramStr;
- startText += ")";
+ startText += ')';
// (h) function body
if(isInterface) {
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/dwriter.cpp #676701:676702
@@ -608,7 +608,7 @@
// ONLY IF changeability is NOT Frozen
if (changeType != Uml::chg_Frozen) {
writeDocumentation("Adds a " + fieldNameUP + " to the list of " +
- fieldName + ".", description, "", m_indentation, d);
+ fieldName + '.', description, "", m_indentation, d);
d << m_indentation << "void add" << fieldNameUC << "(";
d << fieldClassName << " new" << fieldNameUC << ") {";
@@ -619,7 +619,7 @@
// ONLY IF changeability is Changeable
if (changeType == Uml::chg_Changeable) {
writeDocumentation("Removes a " + fieldNameUP + " from the list of " +
- fieldName + ".", description, "", m_indentation, d);
+ fieldName + '.', description, "", m_indentation, d);
d << m_indentation << "void remove" << fieldNameUC << "(";
d << fieldClassName << " " << fieldNameUP << ") {" << startline;
@@ -635,8 +635,8 @@
}
// always allow getting the list of stuff
- writeDocumentation("Returns the list of " + fieldName + ".",
- description, "@return List of "+fieldName + ".",
+ writeDocumentation("Returns the list of " + fieldName + '.',
+ description, "@return List of " + fieldName + '.',
m_indentation, d);
d << m_indentation << fieldClassName << "[] get" << fieldName << "() {";
@@ -655,8 +655,8 @@
// set method
if (change == Uml::chg_Changeable && !isFinal) {
- writeDocumentation("Sets the value of " + fieldName + ".", description,
- "@param new" + fieldNameUC + " The new value of " + fieldName + ".",
+ writeDocumentation("Sets the value of " + fieldName + '.', description,
+ "@param new" + fieldNameUC + " The new value of " + fieldName + '.',
m_indentation, d);
d << m_indentation << fieldClassName << " " << fieldName << "(";
@@ -666,8 +666,8 @@
}
// get method
- writeDocumentation("Returns the value of " + fieldName + ".", description,
- "@return The value of " + fieldName + ".",
+ writeDocumentation("Returns the value of " + fieldName + '.', description,
+ "@return The value of " + fieldName + '.',
m_indentation, d);
d << m_indentation << fieldClassName << " " << fieldName << "() {";
@@ -881,7 +881,7 @@
if (op->getAbstract() && !isInterface) str += "abstract ";
if (op->getStatic()) str += "static ";
- str += methodReturnType + ' ' +cleanName(op->getName()) + "(";
+ str += methodReturnType + ' ' +cleanName(op->getName()) + '(';
atl = op->getParmList();
int i = atl.count();
@@ -897,13 +897,13 @@
returnStr += "@param " + atName+' '+at->getDoc() + m_endl;
}
- str+= ")";
+ str+= ')';
// method only gets a body IF its not abstract
if (op->getAbstract() || isInterface)
- str += ";"; // terminate now
+ str += ';'; // terminate now
else
- str += startline + "{" + startline + "}"; // empty method body
+ str += startline + '{' + startline + '}'; // empty method body
// write it out
writeDocumentation("", op->getDoc(), returnStr, m_indentation, d);
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/javawriter.cpp #676701:676702
@@ -856,7 +856,7 @@
QString methodReturnType = fixTypeName(op->getTypeName());
if(methodReturnType != "void")
- returnStr += "@return "+methodReturnType+"\n";
+ returnStr += "@return " + methodReturnType + '\n';
str = ""; // reset for next method
str += ((op->getAbstract() && !isInterface) ? "abstract ":"");
@@ -875,7 +875,7 @@
(QString(" = ")+at->getInitialValue()) :
QString(""))
+ ((j < i-1)?", ":"");
- returnStr += "@param "+atName+' '+at->getDoc()+"\n";
+ returnStr += "@param " + atName + ' ' + at->getDoc() + '\n';
}
str+= " )";
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/nativeimportbase.cpp #676701:676702
@@ -118,7 +118,7 @@
if (! m_multiLineAltCommentEnd.isEmpty())
pos = line.find(m_multiLineAltCommentEnd);
if (pos == -1) {
- m_comment += line + "\n";
+ m_comment += line + '\n';
return true; // done
}
delimiterLen = m_multiLineAltCommentEnd.length();
@@ -163,7 +163,7 @@
m_inComment = true;
if (pos + delimIntroLen < (int)line.length()) {
QString cmnt = line.mid(pos + delimIntroLen);
- m_comment += cmnt.trimmed() + "\n";
+ m_comment += cmnt.trimmed() + '\n';
}
if (pos == 0)
return true; // done
--- trunk/KDE/kdesdk/umbrello/umbrello/combinedfragmentwidget.cpp #676701:676702
@@ -91,7 +91,7 @@
case Loop :
if (combined_fragment_value != "-")
{
- temp += " [" + combined_fragment_value + "]";
+ temp += " [" + combined_fragment_value + ']';
line_width += (combined_fragment_value.size() + 2) * 8;
}
p.drawText(offsetX + COMBINED_FRAGMENT_MARGIN, offsetY ,w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, temp);
@@ -116,7 +116,7 @@
case Alt :
if (combined_fragment_value != "-")
{
- temp = "[" + combined_fragment_value + "]";
+ temp = '[' + combined_fragment_value + ']';
p.drawText(offsetX + COMBINED_FRAGMENT_MARGIN, offsetY + 20,w - COMBINED_FRAGMENT_MARGIN * 2, fontHeight, Qt::AlignLeft, temp);
if (m_dashLines.size() == 1 && m_dashLines.first()->getY() < offsetY + 20 + fontHeight )
m_dashLines.first()->setY(offsetY + h/2);
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/codeeditor.cpp #676701:676702
@@ -856,7 +856,7 @@
// \n are implicit in the editor (!) so we should put them
// back in, if there is any content from the line
if(!line.isEmpty() && para != lastLineToAddNewLine)
- content += "\n";
+ content += '\n';
}
}
}
--- trunk/KDE/kdesdk/umbrello/umbrello/floatingdashlinewidget.cpp #676701:676702
@@ -42,7 +42,8 @@
p.setPen(Qt::black);
p.setFont(UMLWidget::getFont());
p.drawText(getX() + FLOATING_DASH_LINE_TEXT_MARGIN, getY(),
- getWidth() - FLOATING_DASH_LINE_TEXT_MARGIN * 2, fontHeight, Qt::AlignLeft, "["+m_Text +"]");
+ getWidth() - FLOATING_DASH_LINE_TEXT_MARGIN * 2, fontHeight,
+ Qt::AlignLeft, '[' + m_Text + ']');
p.setPen(*(new QPen(UMLWidget::getLineColor(), 0, Qt::DashLine)));
p.drawLine(getX(), getY(), getX() + getWidth(), getY());
if(m_bSelected)
--- trunk/KDE/kdesdk/umbrello/umbrello/import_rose.cpp #676701:676702
@@ -176,7 +176,7 @@
kError() << loc() << "expecting '|' at start of verbatim text" << endl;
return QString();
} else {
- result += line.mid(1) + "\n";
+ result += line.mid(1) + '\n';
}
}
if (line.isNull()) {
--- trunk/KDE/kdesdk/umbrello/umbrello/objectnodewidget.cpp #676701:676702
@@ -96,7 +96,7 @@
}
else
{
- objectflow_value = "[" + getState() + "]";
+ objectflow_value = '[' + getState() + ']';
}
p.drawLine(offsetX + 10 , offsetY + h/2, (offsetX + w)-10, offsetY + h/2 );
@@ -141,7 +141,7 @@
} else if ( m_ObjectNodeType == Flow ) {
const QFontMetrics &fm = getFontMetrics(FT_NORMAL);
const int fontHeight = fm.lineSpacing();
- const int textWidth = fm.width("[" + getState() + "]");
+ const int textWidth = fm.width('[' + getState() + ']');
const int namewidth = fm.width(getName());
height = fontHeight * 2;
widthtmp = textWidth > OBJECTNODE_WIDTH ? textWidth : OBJECTNODE_WIDTH;
More information about the umbrello-devel
mailing list