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

Oliver Kellogg okellogg at users.sourceforge.net
Sun Jun 13 03:44:34 UTC 2004


CVS commit by okellogg: 

apply(): Improve debugging.


  M +8 -2      umlattributedialog.cpp   1.14


--- kdesdk/umbrello/umbrello/dialogs/umlattributedialog.cpp  #1.13:1.14
@@ -151,5 +151,9 @@ bool UMLAttributeDialog::apply() {
         }
 
-        m_pAttribute->setTypeName( m_pTypeCB->currentText() );
+        QString typeName = m_pTypeCB->currentText();
+        // TODO: The type of UMLAttributes is just a "passive" string.
+        // UMLAttribute should be enhanced to give the user the choice
+        // of referencing existing UMLClassifiers instead.
+        m_pAttribute->setTypeName( typeName );
         m_pAttribute->setInitialValue( m_pInitialLE->text() );
         QString name = m_pNameLE->text();
@@ -171,5 +175,7 @@ bool UMLAttributeDialog::apply() {
         m_pAttribute->setStatic( m_pStaticCB->isChecked() );
 
-        UMLApp::app()->getDocument()->createDatatype( m_pTypeCB->currentText() );
+        UMLDoc *umldoc = UMLApp::app()->getDocument();
+        if (umldoc->findUMLObject(typeName) == NULL)
+                umldoc->createDatatype( m_pTypeCB->currentText() );
 
         return true;






More information about the umbrello-devel mailing list