[Uml-devel] KDE/kdesdk/umbrello/umbrello

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Tue Oct 16 17:44:11 UTC 2007


SVN commit 725952 by chehrlic:

"" -> QString() or even nothing
some more const fixes

sorry for the uncompilable state - I forgot to check in linepath.cpp/.h ... :(

 M  +2 -2      association.cpp  
 M  +1 -1      association.h  
 M  +2 -2      codeclassfield.cpp  
 M  +3 -3      codedocument.cpp  
 M  +3 -3      codegenerationpolicy.cpp  
 M  +1 -1      codegenerator.cpp  
 M  +1 -1      codegenerators/cppsourcecodedocument.cpp  
 M  +1 -1      codegenerators/cppsourcecodeoperation.cpp  
 M  +1 -1      codegenerators/xmlelementcodeblock.cpp  
 M  +1 -1      codeimport/import_utils.cpp  
 M  +3 -3      codemethodblock.cpp  
 M  +1 -1      codeparameter.cpp  
 M  +1 -1      dialogs/classgenpage.cpp  
 M  +2 -2      dialogs/classifierlistpage.cpp  
 M  +1 -1      dialogs/classwizard.cpp  
 M  +3 -3      dialogs/codeeditor.cpp  
 M  +1 -3      dialogs/parmpropdlg.cpp  
 M  +1 -1      dialogs/umloperationdialog.cpp  
 M  +1 -1      docgenerators/docbookgenerator.cpp  
 M  +1 -1      docgenerators/xhtmlgenerator.cpp  
 M  +1 -1      floatingtextwidget.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/association.cpp #725951:725952
@@ -67,7 +67,7 @@
     }
 }
 
-bool UMLAssociation::operator==(UMLAssociation &rhs) {
+bool UMLAssociation::operator==(const UMLAssociation &rhs) {
     if (this == &rhs) {
         return true;
     }
@@ -128,7 +128,7 @@
 QString UMLAssociation::typeAsString (Uml::Association_Type atype)
 {
     if (atype < atypeFirst || atype > atypeLast)
-        return "";
+        return QString();
     return assocTypeStr[(unsigned)atype - (unsigned)atypeFirst];
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/association.h #725951:725952
@@ -56,7 +56,7 @@
     /**
      * Overloaded '==' operator
      */
-    bool operator==(UMLAssociation &rhs);
+    bool operator==(const UMLAssociation &rhs);
 
     /**
      * Standard deconstructor.
--- trunk/KDE/kdesdk/umbrello/umbrello/codeclassfield.cpp #725951:725952
@@ -120,7 +120,7 @@
 // get the type of object that will be added/removed from lists
 // of objects (as per specification of associations)
 QString CodeClassField::getListObjectType() {
-    QString type = QString ("");
+    QString type;
     if (!parentIsAttribute())
     {
         UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
@@ -595,7 +595,7 @@
 void CodeClassField::initFields(bool inConstructor) {
 
     m_writeOutMethods = false;
-    m_listClassName = QString ("");
+    m_listClassName = QString ();
     m_declCodeBlock = NULL;
 
     m_methodVector.setAutoDelete(false);
--- trunk/KDE/kdesdk/umbrello/umbrello/codedocument.cpp #725951:725952
@@ -302,7 +302,7 @@
     // IF the whole document is turned "Off" then don't bother
     // checking individual code blocks, just send back empty string
     if(!getWriteOutCode())
-        return QString("");
+        return QString();
 
     QString content = getHeader()->toString();
 
@@ -481,8 +481,8 @@
 
     m_writeOutCode = true;
     m_package = NULL;
-    m_fileExtension = QString("");
-    m_ID = QString(""); // leave with NO ID as a default
+    m_fileExtension = QString();
+    m_ID = QString(); // leave with NO ID as a default
 
     //m_textblockVector.setAutoDelete(false);
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerationpolicy.cpp #725951:725952
@@ -281,8 +281,8 @@
 }
 
 void CodeGenerationPolicy::calculateIndentation ( ) {
-    QString indent = "";
-    m_indentation = "";
+    QString indent;
+    m_indentation = QString();
     switch (Settings::getOptionState().codeGenerationState.indentationType) {
     case NONE:
         break;
@@ -499,7 +499,7 @@
     }
 
     QTextStream ts(&f);
-    QString retstr = QString("");
+    QString retstr = QString();
     QString endLine = getNewLineEndingChars();
     for(int l = 0; l < MAXLINES && !ts.atEnd(); l++)
         retstr += ts.readLine()+endLine;
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerator.cpp #725951:725952
@@ -520,7 +520,7 @@
         {
             // ugh. dir separator here is UNIX specific..
             QStringList dirs = pathDir.absolutePath().split("/");
-            QString currentDir = "";
+            QString currentDir;
 
             QStringList::iterator end(dirs.end());
             for (QStringList::iterator dir(dirs.begin()); dir != end; ++dir)
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppsourcecodedocument.cpp #725951:725952
@@ -148,7 +148,7 @@
     //
 
     // INCLUDE CODEBLOCK
-    QString includeStatement = "";
+    QString includeStatement;
     // Include own header file
     QString myOwnName( getParentClassifier()->getName() );
     includeStatement.append("#include \""+CodeGenerator::cleanName(myOwnName.toLower())+".h\""+endLine);
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppsourcecodeoperation.cpp #725951:725952
@@ -75,7 +75,7 @@
 
     QString returnType = o->getTypeName();
     QString methodName = o->getName();
-    QString paramStr = QString("");
+    QString paramStr;
     QString className = CodeGenerator::cleanName(c->getName());
 
     // assemble parameters
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/xmlelementcodeblock.cpp #725951:725952
@@ -122,7 +122,7 @@
 
     // Now update START/ENDING Text
     QString startText = '<' + nodeName;
-    QString endText = "";
+    QString endText;
 
     UMLAttributeList * alist = getAttributeList();
     foreach (UMLAttribute *at , *alist)
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #725951:725952
@@ -105,7 +105,7 @@
             lines.pop_back();  // nothing interesting on this line
     }
     if (! lines.count())
-        return "";
+        return QString();
 
     QStringList::Iterator end(lines.end());
     for (QStringList::Iterator lit(lines.begin()); lit != end; ++lit) {
--- trunk/KDE/kdesdk/umbrello/umbrello/codemethodblock.cpp #725951:725952
@@ -137,7 +137,7 @@
  */
 QString CodeMethodBlock::toString ( ) {
 
-    QString string = QString("");
+    QString string;
 
     if(getWriteOutText()) {
 
@@ -170,8 +170,8 @@
 
 void CodeMethodBlock::initFields ( ) {
 
-    m_startMethod = QString("");
-    m_endMethod = QString("");
+    m_startMethod = QString();
+    m_endMethod = QString();
 }
 
 void CodeMethodBlock::syncToParent ( )
--- trunk/KDE/kdesdk/umbrello/umbrello/codeparameter.cpp #725951:725952
@@ -277,7 +277,7 @@
     m_parentObject = obj;
 
     m_parentDocument = doc;
-    m_initialValue = QString("");
+    m_initialValue = QString();
 
     m_comment = CodeGenFactory::newCodeComment(m_parentDocument);
     m_comment->setText(getParentObject()->getDoc());
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classgenpage.cpp #725951:725952
@@ -239,7 +239,7 @@
     // manage stereotypes
     m_pStereoTypeCB -> setDuplicatesEnabled(false);//only allow one of each type in box
     m_pStereoTypeCB->setCompletionMode( KGlobalSettings::CompletionPopup );
-    insertStereotype (QString("")); // an empty stereotype is the default
+    insertStereotype (QString()); // an empty stereotype is the default
     int defaultStereotype=0;
     bool foundDefaultStereotype = false;
     foreach (UMLStereotype* ust, m_pUmldoc->getStereotypes()) {
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classifierlistpage.cpp #725951:725952
@@ -48,8 +48,8 @@
 
 void ClassifierListPage::setupPage() {
 
-    QString typeName("");
-    QString newItemType("");
+    QString typeName;
+    QString newItemType;
 
     if (m_itemType == ot_Attribute) {
         typeName = i18n("Attributes");
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classwizard.cpp #725951:725952
@@ -32,7 +32,7 @@
     UMLObject * pTemp = 0;
     QString name = i18n("new_class");
     QString newName = name;
-    QString num = "";
+    QString num;
     int i = 0;
     m_pClass = new UMLClassifier( newName );
     do {
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/codeeditor.cpp #725951:725952
@@ -404,7 +404,7 @@
     UMLObject * parentObj = db->getParentClassField()->getParentObject();
 
     QColor bgcolor = getState().editBlockColor;
-    QString componentName = QString("");
+    QString componentName;
     if(parentObj)
     {
         if(db->getParentClassField()->parentIsAttribute()) {
@@ -507,7 +507,7 @@
 
     OwnedHierarchicalCodeBlock * test = dynamic_cast<OwnedHierarchicalCodeBlock *>(hblock);
     UMLObject * parentObj = 0;
-    QString componentName = QString("");
+    QString componentName;
     QColor paperColor = getState().nonEditBlockColor;
     if(test)
     {
@@ -860,7 +860,7 @@
         TextBlockInfo *info = (*m_tbInfoMap)[block];
         UMLObject * parentObj = info->getParent();
         int pstart = m_textBlockList.findRef(block);
-        QString content = "";
+        QString content;
 
         // Assemble content from editiable paras
         QList<ParaInfo*> list = info->m_paraList;
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/parmpropdlg.cpp #725951:725952
@@ -46,9 +46,7 @@
     m_pUmldoc = doc;
     m_pAtt = a;
     QString type, text, name, initialValue;
-    if(!a) {
-        type = text = name = initialValue = "";
-    } else {
+    if(a) {
         type = a -> getTypeName();
         name = a -> getName();
         initialValue = a -> getInitialValue();
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/umloperationdialog.cpp #725951:725952
@@ -228,7 +228,7 @@
     // manage stereotypes
     m_pStereoTypeCB -> setDuplicatesEnabled(false);//only allow one of each type in box
     m_pStereoTypeCB->setCompletionMode( KGlobalSettings::CompletionPopup );
-    insertStereotype (QString("")); // an empty stereotype is the default
+    insertStereotype (QString()); // an empty stereotype is the default
     int defaultStereotype=0;
     bool foundDefaultStereotype = false;
     foreach (UMLStereotype* currentSt, m_doc->getStereotypes() ) {
--- trunk/KDE/kdesdk/umbrello/umbrello/docgenerators/docbookgenerator.cpp #725951:725952
@@ -49,7 +49,7 @@
 {
   KUrl url = umlDoc->url();
   QString fileName = url.fileName();
-  fileName.replace(QRegExp(".xmi$"),"");
+  fileName.remove(QRegExp(".xmi$"));
   url.setFileName(fileName);
   uDebug() <<"Exporting to directory: " << url;
   generateDocbookForProjectInto(url);
--- trunk/KDE/kdesdk/umbrello/umbrello/docgenerators/xhtmlgenerator.cpp #725951:725952
@@ -47,7 +47,7 @@
 {
   KUrl url = umlDoc->url();
   QString fileName = url.fileName();
-  fileName.replace(QRegExp(".xmi$"),"");
+  fileName.remove(QRegExp(".xmi$"));
   url.setFileName(fileName);
   uDebug()<< "Exporting to directory: " << url;
   return generateXhtmlForProjectInto(url);
--- trunk/KDE/kdesdk/umbrello/umbrello/floatingtextwidget.cpp #725951:725952
@@ -353,7 +353,7 @@
     if(m_Role == Uml::tr_Seq_Message || m_Role == Uml::tr_Seq_Message_Self ||
             m_Role == Uml::tr_Coll_Message || m_Role == Uml::tr_Coll_Message_Self) {
         if( m_Text.length() <= 1 || m_Text == ": " )
-            return "";
+            return QString();
     }
     return m_Text;
 }




More information about the umbrello-devel mailing list