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

Oliver Kellogg okellogg at users.sourceforge.net
Thu Feb 2 14:10:02 UTC 2006


SVN commit 505040 by okellogg:

assignUniqueIdOnCreation(): New.

 M  +7 -3      import_utils.cpp  
 M  +9 -0      import_utils.h  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/import_utils.cpp #505039:505040
@@ -62,6 +62,10 @@
     bPutAtGlobalScope = yesno;
 }
 
+void assignUniqueIdOnCreation(bool yesno) {
+    Object_Factory::assignUniqueIdOnCreation(yesno);
+}
+
 bool newUMLObjectWasCreated() {
     return bNewUMLObjectWasCreated;
 }
@@ -145,7 +149,7 @@
                         parentPkg = static_cast<UMLPackage*>(o);
                         continue;
                     }
-                    int wantNamespace = 1;
+                    int wantNamespace = KMessageBox::Yes;
                     /* We know std and Qt are always a namespaces */
                     if (scopeName != "std" && scopeName != "Qt") {
                         wantNamespace = KMessageBox::questionYesNo(NULL,
@@ -220,7 +224,7 @@
 }
 
 UMLOperation* makeOperation(UMLClassifier *parent, const QString &name) {
-    UMLOperation *op = new UMLOperation(parent, name);
+    UMLOperation *op = Object_Factory::createOperation(parent, name);
     return op;
 }
 
@@ -304,7 +308,7 @@
         typeObj = createUMLObject(Uml::ot_UMLObject, type, owner);
         bPutAtGlobalScope = false;
     }
-    UMLAttribute *attr = new UMLAttribute(method, name);
+    UMLAttribute *attr = Object_Factory::createAttribute(method, name);
     attr->setType(typeObj);
     method->addParm(attr);
     return attr;
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/import_utils.h #505039:505040
@@ -50,6 +50,15 @@
     void putAtGlobalScope(bool yesno);
 
     /**
+     * Control whether the creation methods solicit a new unique ID for the
+     * created object.
+     * By default, unique ID generation is turned on.
+     *
+     * @param yesno   False turns UID generation off, true turns it on.
+     */
+    void assignUniqueIdOnCreation(bool yesno);
+
+    /**
      * Create a UMLAttribute and insert it into the document.
      */
     UMLObject* insertAttribute(UMLClassifier *klass, Uml::Visibility scope, QString name,




More information about the umbrello-devel mailing list