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

Andi Fischer andi.fischer at hispeed.ch
Fri Jan 30 09:17:53 UTC 2009


SVN commit 918579 by fischer:

Fixing some Krazy issues.

 M  +5 -6      codeimport/classimport.cpp  
 M  +1 -1      codeimport/import_utils.cpp  
 M  +5 -5      codeimport/kdevcppparser/preprocesslexer.cpp  
 M  +1 -1      codeimport/kdevcppparser/urlutil.cpp  
 M  +4 -4      model_utils.cpp  
 M  +2 -2      operation.cpp  
 M  +2 -2      petaltree2uml.cpp  
 M  +2 -2      umldoc.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/classimport.cpp #918578:918579
@@ -1,11 +1,10 @@
 /***************************************************************************
- *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *  copyright (C) 2006-2008                                                *
+ *  copyright (C) 2006-2009                                                *
  *  Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                   *
  ***************************************************************************/
 
@@ -55,15 +54,15 @@
 ClassImport *ClassImport::createImporterByFileExt(const QString &filename) 
 {
     ClassImport *classImporter;
-    if (filename.endsWith(".idl"))
+    if (filename.endsWith(QLatin1String(".idl")))
         classImporter = new IDLImport();
-    else if (filename.endsWith(".py"))
+    else if (filename.endsWith(QLatin1String(".py")))
         classImporter = new PythonImport();
-    else if (filename.endsWith(".java"))
+    else if (filename.endsWith(QLatin1String(".java")))
         classImporter = new JavaImport();
     else if (filename.contains( QRegExp("\\.ad[sba]$") ))
         classImporter = new AdaImport();
-    else if (filename.endsWith(".pas"))
+    else if (filename.endsWith(QLatin1String(".pas")))
         classImporter = new PascalImport();
 #ifndef DISABLE_CPP_IMPORT
     else
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #918578:918579
@@ -120,7 +120,7 @@
     QStringList lines = comment.split('\n');
     QString& first = lines.first();
     QRegExp wordex("\\w");
-    if (first.startsWith("/*")) {
+    if (first.startsWith(QLatin1String("/*"))) {
         int wordpos = wordex.indexIn(first);
         if (wordpos != -1)
             first = first.mid(wordpos);  // remove comment start
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/preprocesslexer.cpp #918578:918579
@@ -547,15 +547,15 @@
                     m_preprocessedString += QString(" ") + (*pos).second + QString(" ");
                 }
             } else if (/*qt_rx.exactMatch(ide) ||*/
-                ide.endsWith("EXPORT") ||
-                (ide.startsWith("Q_EXPORT") && ide != "Q_EXPORT_INTERFACE") ||
-                ide.startsWith("QM_EXPORT") ||
-                ide.startsWith("QM_TEMPLATE")) {
+                ide.endsWith(QLatin1String("EXPORT")) ||
+                (ide.startsWith(QLatin1String("Q_EXPORT")) && ide != "Q_EXPORT_INTERFACE") ||
+                ide.startsWith(QLatin1String("QM_EXPORT")) ||
+                ide.startsWith(QLatin1String("QM_TEMPLATE"))) {
 
                 m_source.parse(*gr_whiteSpace);
                 if (m_source.currentChar() == '(')
                     skip('(', ')');
-            } else if (ide.startsWith("K_TYPELIST_") || ide.startsWith("TYPELIST_")) {
+            } else if (ide.startsWith(QLatin1String("K_TYPELIST_")) || ide.startsWith(QLatin1String("TYPELIST_"))) {
                 tk = m_source.createToken(Token_identifier, start);
                 m_source.parse(*gr_whiteSpace);
                 if (m_source.currentChar() == '(')
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/urlutil.cpp #918578:918579
@@ -121,7 +121,7 @@
     if (absRef == absBase)
         return QString(".");
     else
-        return absRef.replace(0, absBase.length(), QString());
+        return absRef.remove(0, absBase.length());
 }
 
 ///////////////////////////////////////////////////////////////////////////////
--- trunk/KDE/kdesdk/umbrello/umbrello/model_utils.cpp #918578:918579
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *  copyright (C) 2004-2008                                                *
+ *  copyright (C) 2004-2009                                                *
  *  Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                   *
  ***************************************************************************/
 
@@ -483,13 +483,13 @@
         name.remove(mnemonicVis);
     }
     Uml::Parameter_Direction pd = Uml::pd_In;
-    if (name.startsWith("in ")) {
+    if (name.startsWith(QLatin1String("in "))) {
         pd = Uml::pd_In;
         name = name.mid(3);
-    } else if (name.startsWith("inout ")) {
+    } else if (name.startsWith(QLatin1String("inout "))) {
         pd = Uml::pd_InOut;
         name = name.mid(6);
-    } else if (name.startsWith("out ")) {
+    } else if (name.startsWith(QLatin1String("out "))) {
         pd = Uml::pd_Out;
         name = name.mid(4);
     }
--- trunk/KDE/kdesdk/umbrello/umbrello/operation.cpp #918578:918579
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2008                                               *
+ *   copyright (C) 2002-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -170,7 +170,7 @@
     if (returnType.length() > 0 && returnType != "void") {
         s.append(" : ");
 
-        if (returnType.startsWith("virtual ")) {
+        if (returnType.startsWith(QLatin1String("virtual "))) {
             s += returnType.mid(8);
         } else {
             s += returnType;
--- trunk/KDE/kdesdk/umbrello/umbrello/petaltree2uml.cpp #918578:918579
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2006-2008                                               *
+ *   copyright (C) 2006-2009                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -423,7 +423,7 @@
             QStringList initialArgs = roleNode->initialArgs();
             if (initialArgs.count() > 1) {
                 QString roleName = clean(initialArgs[1]);
-                if (! roleName.startsWith("$UNNAMED"))
+                if (! roleName.startsWith(QLatin1String("$UNNAMED")))
                     role->setName(roleName);
             }
             role->setID(quid(roleNode));
--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp #918578:918579
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *  copyright (C) 2002-2008                                                *
+ *  copyright (C) 2002-2009                                                *
  *  Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                   *
  ***************************************************************************/
 
@@ -489,7 +489,7 @@
             newDocument();
             return false;
         }
-        if (filetype.endsWith(".mdl"))
+        if (filetype.endsWith(QLatin1String(".mdl")))
             status = Import_Rose::loadFromMDL(file);
         else
             status = loadFromXMI( file, ENC_UNKNOWN );




More information about the umbrello-devel mailing list