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

Oliver Kellogg okellogg at users.sourceforge.net
Fri Dec 23 11:24:01 UTC 2005


SVN commit 490938 by okellogg:

createUMLObject(): Create the full type including possible template params
in C++ syntax. Addresses
http://sourceforge.net/mailarchive/forum.php?thread_id=9298028&forum_id=460


 M  +7 -5      import_utils.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/import_utils.cpp #490937:490938
@@ -117,8 +117,9 @@
         int isConst = name.contains(QRegExp("^const "));
         name.remove(QRegExp("^const\\s+"));
         QString typeName(name);
-        int isPointer = typeName.contains('*');
-        int isRef = typeName.contains('&');
+        const int isAdorned = typeName.contains( QRegExp("[^\\w: ]") );
+        const int isPointer = typeName.contains('*');
+        const int isRef = typeName.contains('&');
         typeName.remove(QRegExp("[^\\w: ].*$"));
         UMLObject *origType = umldoc->findUMLObject(typeName, Uml::ot_UMLObject, parentPkg);
         if (origType == NULL) {
@@ -163,13 +164,13 @@
                 bPutAtGlobalScope = true;
             }
             Uml::Object_Type t = type;
-            if (type == Uml::ot_UMLObject || isConst || isRef || isPointer)
+            if (type == Uml::ot_UMLObject || isAdorned)
                 t = Uml::ot_Class;
             origType = umldoc->createUMLObject(t, typeName, parentPkg);
             bNewUMLObjectWasCreated = true;
             kapp->processEvents();
         }
-        if (isConst || isPointer || isRef) {
+        if (isConst || isAdorned) {
             // Create the full given type (including adornments.)
             if (isConst)
                 name.prepend("const ");
@@ -187,7 +188,8 @@
                 kdError() << "createUMLObject(" << name << "): "
                 << "origType " << typeName << " is not a UMLClassifier"
                 << endl;
-            dt->setIsReference();
+            if (isRef || isPointer)
+                dt->setIsReference();
             /*
             if (isPointer) {
                 UMLObject *pointerDecl = umldoc->createUMLObject(Uml::ot_Datatype, type);




More information about the umbrello-devel mailing list