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

Oliver Kellogg okellogg at users.sourceforge.net
Fri Aug 5 15:05:25 UTC 2005


SVN commit 443365 by okellogg:

resolveRef(): Temporarily use ClassImport::createUMLObject() for its scope
handling until the latter is merged into UMLDoc::createUMLObject().
The problem surfaces when dealing with old Umbrello files where the
type name was saved in the "type" attribute (of operation parameters etc.)
rather than the xmi.id of the model object of the attribute type.
Import of old files is still not perfect - it tends to create duplicated
model objects for the types. I'll try to resolve that next.
BUG:110216


 M  +2 -1      ChangeLog  
 M  +10 -1     umbrello/umlobject.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #443364:443365
@@ -9,7 +9,8 @@
 * Automatic Diagram Layout (67059, not yet closed)
 
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
-57588 58809 67719 72016 79433 87252 88117 97162 105564 108223 109591 109636
+ 57588  58809  67719  72016  79433  87252  88117  97162 105564 108223
+109591 109636 110216
 
 Version 1.4.2 (maintenance release)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlobject.cpp #443364:443365
@@ -22,6 +22,7 @@
 #include "package.h"
 #include "stereotype.h"
 #include "model_utils.h"
+#include "classimport.h"
 
 UMLObject::UMLObject(const UMLObject * parent, const QString &name, Uml::IDType id)
         : QObject(const_cast<UMLObject*>(parent), "UMLObject" ) {
@@ -395,6 +396,8 @@
     // Assume we're dealing with the older Umbrello format where
     // the type name was saved in the "type" attribute rather
     // than the xmi.id of the model object of the attribute type.
+    if (m_SecondaryId == "const QModelIndex&")
+        kdDebug() << "Yow! const QModelIndex&" << endl;
     m_pSecondary = pDoc->findUMLObject( m_SecondaryId, Uml::ot_UMLObject, this );
     if (m_pSecondary) {
         m_SecondaryId = "";
@@ -405,12 +408,18 @@
     // of on-the-fly scope creation:
     if (m_SecondaryId.contains("::")) {
         m_SecondaryId.replace("::", ".");
-        m_pSecondary = pDoc->findUMLObject( m_SecondaryId, Uml::ot_UMLObject, this );
+        // TODO: Merge ClassImport::createUMLObject() into UMLDoc::createUMLObject()
+        m_pSecondary = ClassImport::createUMLObject(Uml::ot_UMLObject, m_SecondaryId, NULL);
         if (m_pSecondary) {
             m_SecondaryId = "";
             maybeSignalObjectCreated();
+            kdDebug() << "UMLObject::resolveRef: Created a new type for " << m_SecondaryId
+                      << " using ClassImport::createUMLObject()" << endl;
             return true;
         }
+        kdError() << "UMLObject::resolveRef: ClassImport::createUMLObject() "
+                  << "failed to create a new type for " << m_SecondaryId << endl;
+        return false;
     }
     kdDebug() << "UMLObject::resolveRef: Creating new type for "
     << m_SecondaryId << endl;




More information about the umbrello-devel mailing list