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

Oliver Kellogg okellogg at users.sourceforge.net
Thu Oct 12 17:23:28 UTC 2006


SVN commit 594874 by okellogg:

fix assignment to QString::null admonished by EBN

 M  +1 -1      codedocument.cpp  
 M  +2 -2      codegenerator.cpp  
 M  +5 -5      codegenerators/cppwriter.cpp  
 M  +3 -3      codeimport/kdevcppparser/ast.cpp  
 M  +2 -2      codeimport/kdevcppparser/ast_utils.cpp  
 M  +1 -1      codeimport/kdevcppparser/cpptree2uml.cpp  
 M  +2 -2      codeimport/kdevcppparser/driver.cpp  
 M  +2 -2      codeimport/kdevcppparser/lexer.cpp  
 M  +9 -9      codeimport/kdevcppparser/parser.cpp  
 M  +1 -1      codeimport/kdevcppparser/urlutil.cpp  
 M  +1 -1      codeimport/nativeimportbase.cpp  
 M  +6 -6      import_rose.cpp  
 M  +1 -1      model_utils.cpp  
 M  +1 -1      petalnode.cpp  
 M  +2 -2      petaltree2uml.cpp  
 M  +3 -3      umlviewimageexportermodel.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/codedocument.cpp #594873:594874
@@ -125,7 +125,7 @@
 QString CodeDocument::getPackage ( ) const {
     if (m_package)
         return m_package->getName();
-    return QString::null;
+    return QString();
 }
 
 /**
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerator.cpp #594873:594874
@@ -436,7 +436,7 @@
             } else {
                 m_applyToAllRemaining = false;
             }
-            return QString::null;
+            return QString();
             break;
         }
 
@@ -451,7 +451,7 @@
         }
         break;
     case CodeGenerationPolicy::Cancel: //don't output anything
-        return QString::null;
+        return QString();
         break;
     }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/cppwriter.cpp #594873:594874
@@ -58,7 +58,7 @@
     // %VECTOR_TYPENAME%, which is as definition above.
     VECTOR_METHOD_APPEND = "%VARNAME%.push_back(add_object);"; // for std::vector
     VECTOR_METHOD_REMOVE = "int i, size = %VARNAME%.size();\nfor ( i = 0; i < size; i++) {\n\t%ITEMCLASS% item = %VARNAME%.at(i);\n\tif(item == remove_object) {\n\t\tvector<%ITEMCLASS%>::iterator it = %VARNAME%.begin() + i;\n\t\t%VARNAME%.erase(it);\n\t\treturn;\n\t}\n }"; // for std::vector
-    VECTOR_METHOD_INIT = ""; // nothing to be done
+    VECTOR_METHOD_INIT.clear(); // nothing to be done
     /*
         VECTOR_METHOD_APPEND = "%VARNAME%.append(&add_object);"; // Qt lib implementation
         VECTOR_METHOD_REMOVE = "%VARNAME%.removeRef(&remove_object);"; // Qt lib implementation
@@ -1033,7 +1033,7 @@
             }
         }
         // Now initialize the association related fields (e.g. vectors)
-        if (VECTOR_METHOD_INIT != "") {
+        if (!VECTOR_METHOD_INIT.isEmpty()) {
             QStringList::Iterator it;
             for( it = VectorFieldVariables.begin(); it != VectorFieldVariables.end(); ++it ) {
                 QString fieldVarName = *it;
@@ -1044,7 +1044,7 @@
             }
         }
 
-        if (OBJECT_METHOD_INIT != "") {
+        if (!OBJECT_METHOD_INIT.isEmpty()) {
             QStringList::Iterator it;
             for( it = ObjectFieldVariables.begin(); it != ObjectFieldVariables.end(); ++it ) {
                 QString fieldVarName = *it;
@@ -1143,8 +1143,8 @@
     // generate method decl for each operation given
     for (UMLOperation *op = oplist.first(); op; op = oplist.next()) {
 
-        QString returnStr = "";  // buffer for documentation
-        QString methodReturnType = "";
+        QString returnStr;  // buffer for documentation
+        QString methodReturnType;
         UMLAttributeList *atl = op->getParmList();  // method parameters
 
         if (op->isConstructorOperation()) {
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/ast.cpp #594873:594874
@@ -117,7 +117,7 @@
 	return "Custom";
     }
 
-    return QString::null;
+    return QString();
 }
 
 
@@ -227,7 +227,7 @@
 QString NameAST::text() const
 {
     if( !m_unqualifiedName.get() )
-        return QString::null;
+        return QString();
 
     QString str;
 
@@ -462,7 +462,7 @@
 QString ClassOrNamespaceNameAST::text() const
 {
     if( !m_name.get() )
-        return QString::null;
+        return QString();
 
     QString str = m_name->text();
     if( m_templateArgumentList.get() )
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/ast_utils.cpp #594873:594874
@@ -110,7 +110,7 @@
 QString typeSpecToString( TypeSpecifierAST* typeSpec )  /// @todo remove
 {
     if( !typeSpec )
-        return QString::null;
+        return QString();
 
     return typeSpec->text().replace( QRegExp(" :: "), "::" );
 }
@@ -118,7 +118,7 @@
 QString declaratorToString( DeclaratorAST* declarator, const QString& scope, bool skipPtrOp )
 {
    if( !declarator )
-       return QString::null;
+       return QString();
 
    QString text;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp #594873:594874
@@ -569,7 +569,7 @@
 QString CppTree2Uml::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator )
 {
     if( !typeSpec || !declarator )
-        return QString::null;
+        return QString();
 
     QString text;
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/driver.cpp #594873:594874
@@ -255,7 +255,7 @@
         fileParsed( fileName );
     }
     
-    m_currentFileName = QString::null;
+    m_currentFileName.clear();
     lexer = 0;
 }
 
@@ -418,7 +418,7 @@
 	    return fileInfo.absFilePath();
     }
 
-    return QString::null;
+    return QString();
 }
 
 void Driver::setResolveDependencesEnabled( bool enabled )
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/lexer.cpp #594873:594874
@@ -101,7 +101,7 @@
                 return scope[ name ];
         }
 
-        return QString::null;
+        return QString();
     }
 
 };
@@ -143,7 +143,7 @@
     m_index = 0;
     m_size = 0;
     m_tokens.clear();
-    m_source = QString::null;
+    m_source.clear();
     m_ptr = 0;
     m_endPtr = 0;
     m_startLine = false;
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/parser.cpp #594873:594874
@@ -316,7 +316,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 
 	if( !skipExpression(expr) ){
@@ -832,7 +832,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 
 	if( !parseTemplateArgument(templArg) ){
@@ -1474,7 +1474,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 
 	if( !parseTemplateParameter(param) ){
@@ -1779,7 +1779,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 
 	if( lex->lookAhead(0) == Token_ellipsis )
@@ -2228,7 +2228,7 @@
 
 	QString comment;
 	while( lex->lookAhead(0) == ',' ){
-	    comment = QString::null;
+	    comment.clear();
 	    advanceAndCheckTrailingComment( comment );
 
 	    if( !parseBaseSpecifier(baseSpec) ){
@@ -2282,7 +2282,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 
 	if( parseMemInitializer(init) ){
@@ -2327,7 +2327,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 	if( parseTypeId(typeId) ){
 	    if (!comment.isEmpty())
@@ -3904,7 +3904,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 
         if( !parseAssignmentExpression(expr) )
@@ -4110,7 +4110,7 @@
 
     QString comment;
     while( lex->lookAhead(0) == ',' ){
-	comment = QString::null;
+	comment.clear();
 	advanceAndCheckTrailingComment( comment );
 	if( lex->lookAhead(0) == Token_identifier ){
 	    AST_FROM_TOKEN( tk, lex->index() );
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/urlutil.cpp #594873:594874
@@ -73,7 +73,7 @@
 
 QString URLUtil::upDir(const QString & path, bool slashSuffix) {
   int slashPos = path.findRev("/");
-  if (slashPos<1) return QString::null;
+  if (slashPos<1) return QString();
   return path.mid(0,slashPos+ (slashSuffix ? 1 : 0) );
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/nativeimportbase.cpp #594873:594874
@@ -102,7 +102,7 @@
         // if last item in m_source is a comment then it is dropped too
         (m_srcIndex == m_source.count() - 1 &&
          m_source[m_srcIndex].startsWith(m_singleLineCommentIntro))) {
-        return QString::null;
+        return QString();
     }
     return m_source[m_srcIndex];
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/import_rose.cpp #594873:594874
@@ -140,7 +140,7 @@
  */
 QString extractImmediateValues(QStringList& l) {
     if (l.count() == 0)
-        return QString::null;
+        return QString();
     if (l.first() == "(")
         l.pop_front();
     QString result;
@@ -174,21 +174,21 @@
             break;
         if (line[0] != '|') {
             kError() << loc() << "expecting '|' at start of verbatim text" << endl;
-            return QString::null;
+            return QString();
         } else {
             result += line.mid(1) + "\n";
         }
     }
     if (line.isNull()) {
         kError() << loc() << "premature EOF" << endl;
-        return QString::null;
+        return QString();
     }
     if (! line.isEmpty()) {
         for (uint i = 0; i < line.length(); i++) {
             const QChar& clParenth = line[i];
             if (clParenth != ')') {
                 kError() << loc() << "expected ')', found: " << clParenth << endl;
-                return QString::null;
+                return QString();
             }
             nClosures++;
         }
@@ -219,11 +219,11 @@
 QString extractValue(QStringList& l, QTextStream& stream) {
     methodName("extractValue");
     if (l.count() == 0)
-        return QString::null;
+        return QString();
     if (l.first() == "(")
         l.pop_front();
     if (l.first() != "value")
-        return QString::null;
+        return QString();
     l.pop_front();  // remove "value"
     l.pop_front();  // remove the value type: could be e.g. "Text" or "cardinality"
     QString result;
--- trunk/KDE/kdesdk/umbrello/umbrello/model_utils.cpp #594873:594874
@@ -548,7 +548,7 @@
         default:
             break;
     }
-    return QString::null;
+    return QString();
 }
 
 Uml::Programming_Language stringToProgLang(QString str) {
--- trunk/KDE/kdesdk/umbrello/umbrello/petalnode.cpp #594873:594874
@@ -29,7 +29,7 @@
 
 QString PetalNode::name() const {
     if (m_initialArgs.count() == 0)
-        return QString::null;
+        return QString();
     return m_initialArgs.first();
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/petaltree2uml.cpp #594873:594874
@@ -39,7 +39,7 @@
  */
 QString clean(QString str) {
     if (str.isNull())
-        return QString::null;
+        return QString();
     str.remove("\"");
     str.remove(QRegExp("^Logical View::"));
     return str;
@@ -62,7 +62,7 @@
 QString quidu(const PetalNode *node) {
     QString quiduStr = node->findAttribute("quidu").string;
     if (quiduStr.isEmpty())
-        return QString::null;
+        return QString();
     quiduStr.remove("\"");
     return quiduStr;
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/umlviewimageexportermodel.cpp #594873:594874
@@ -81,7 +81,7 @@
     if (QString("xpm") == imageType) return "image/x-xpm";
     if (QString("eps") == imageType) return "image/x-eps";
     if (QString("svg") == imageType) return "image/svg+xml";
-    return QString::null;
+    return QString();
 }
 
 QString UMLViewImageExporterModel::mimeTypeToImageType(QString mimeType) {
@@ -95,7 +95,7 @@
     if (QString("image/x-xpm") == mimeType) return "xpm";
     if (QString("image/x-eps") == mimeType) return "eps";
     if (QString("image/svg+xml") == mimeType) return "svg";
-    return QString::null;
+    return QString();
 }
 
 QStringList UMLViewImageExporterModel::exportAllViews(const QString &imageType, const KUrl &directory, bool useFolders) const {
@@ -158,7 +158,7 @@
         }
     } //!isLocalFile
 
-    return QString::null;
+    return QString();
 }
 
 QString UMLViewImageExporterModel::getDiagramFileName(UMLView *view, const QString &imageType, bool useFolders /* = false */) const {




More information about the umbrello-devel mailing list