[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Wed Aug 30 21:45:59 UTC 2006
SVN commit 579046 by okellogg:
conclusion of fix for duplicate Datatypes folder (cf. r577194)
M +12 -0 folder.cpp
M +3 -2 umldoc.cpp
M +12 -0 umldoc.h
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/folder.cpp #579045:579046
@@ -144,6 +144,18 @@
return false;
continue;
}
+ // Do not re-create the predefined Datatypes folder in the Logical View,
+ // it already exists.
+ UMLDoc *umldoc = UMLApp::app()->getDocument();
+ UMLFolder *logicalView = umldoc->getRootFolder(Uml::mt_Logical);
+ if (this == logicalView && Uml::tagEq(type, "Package")) {
+ QString thisName = tempElement.attribute("name", "");
+ if (thisName == umldoc->datatypeFolderName()) {
+ UMLFolder *datatypeFolder = umldoc->getDatatypeFolder();
+ datatypeFolder->loadFromXMI(tempElement);
+ continue;
+ }
+ }
QString stereoID = tempElement.attribute("stereotype", "");
UMLObject *pObject = Object_Factory::makeObjectFromXMI(type, stereoID);
if (!pObject) {
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.cpp #579045:579046
@@ -85,6 +85,7 @@
UMLDoc::UMLDoc() {
m_Name = i18n("UML Model");
m_modelID = "m1";
+ m_datatypeFolderName = i18n("Datatypes");
m_count = 0;
m_pChangeLog = 0;
m_Doc = "";
@@ -109,7 +110,7 @@
m_root[i] = new UMLFolder(predefinedName[i]);
m_root[i]->markPredefined();
}
- m_datatypeRoot = new UMLFolder(i18n("Datatypes"));
+ m_datatypeRoot = new UMLFolder(m_datatypeFolderName);
m_datatypeRoot->markPredefined();
m_root[Uml::mt_Logical]->addObject(m_datatypeRoot);
@@ -287,7 +288,7 @@
for (int i = 0; i < Uml::N_MODELTYPES; i++)
m_root[i]->removeAllObjects();
// Restore the datatype folder, it has been deleted above.
- m_datatypeRoot = new UMLFolder(i18n("Datatypes"));
+ m_datatypeRoot = new UMLFolder(m_datatypeFolderName);
m_datatypeRoot->markPredefined();
m_root[Uml::mt_Logical]->addObject(m_datatypeRoot);
listView->theDatatypeFolder()->setUMLObject(m_datatypeRoot);
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.h #579045:579046
@@ -513,6 +513,13 @@
}
/**
+ * Return the name of the predefined Datatypes folder in the Logical View.
+ */
+ QString datatypeFolderName() const {
+ return m_datatypeFolderName;
+ }
+
+ /**
* Returns a list of the concepts in this UMLDoc.
*
* @param includeNested Whether to include the concepts from
@@ -811,6 +818,11 @@
UMLFolder *m_datatypeRoot;
/**
+ * Name of the predefined Datatypes folder in the Logical View
+ */
+ QString m_datatypeFolderName;
+
+ /**
* The UMLDoc is the sole owner of all stereotypes.
* UMLStereotype instances are reference counted.
* When an UMLStereotype is no longer referenced anywhere,
More information about the umbrello-devel
mailing list