[Uml-devel] KDE/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Nov 27 11:27:01 UTC 2005
SVN commit 483700 by okellogg:
apply commit 483699 from branches/KDE/3.5
M +6 -0 umldoc.cpp
M +7 -0 umldoc.h
M +6 -0 umlobject.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp #483699:483700
@@ -89,6 +89,7 @@
UMLDoc::UMLDoc() {
m_Name = i18n("UML Model");
+ m_modelID = "m1";
m_currentView = 0;
m_uniqueID = 0;
m_count = 0;
@@ -1477,6 +1478,10 @@
return m_Name;
}
+Uml::IDType UMLDoc::getModelID() const {
+ return m_modelID;
+}
+
void UMLDoc::saveToXMI(QIODevice& file, bool saveSubmodelFiles /* = false */) {
QDomDocument doc;
@@ -1553,6 +1558,7 @@
QDomElement contentNS = doc.createElement( "UML:Namespace.contents" );
QDomElement objectsElement = doc.createElement( "UML:Model" );
+ objectsElement.setAttribute( "xmi.id", ID2STR(m_modelID) );
objectsElement.setAttribute( "name", m_Name );
objectsElement.setAttribute( "isSpecification", "false" );
objectsElement.setAttribute( "isAbstract", "false" );
--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.h #483699:483700
@@ -434,6 +434,12 @@
QString getName() const;
/**
+ * Return the m_modelID (currently this a fixed value:
+ * Umbrello supports only a single document.)
+ */
+ Uml::IDType getModelID() const;
+
+ /**
* Used to give a unique ID to any sort of object.
*
* @return A new unique ID.
@@ -933,6 +939,7 @@
int m_uniqueID;
QString m_Name; ///< name of this model as stored in the <UML:Model> tag
+ Uml::IDType m_modelID; ///< xmi.id of this model in the <UML:Model>
int m_count; ///< auxiliary counter for the progress bar
bool m_modified;
KURL m_doc_url;
--- trunk/KDE/kdesdk/umbrello/umbrello/umlobject.cpp #483699:483700
@@ -471,6 +471,12 @@
}
qElement.setAttribute( "xmi.id", ID2STR(m_nId) );
qElement.setAttribute( "name", m_Name );
+ Uml::IDType nmSpc;
+ if (m_pUMLPackage)
+ nmSpc = m_pUMLPackage->getID();
+ else
+ nmSpc = UMLApp::app()->getDocument()->getModelID();
+ qElement.setAttribute( "namespace", ID2STR(nmSpc) );
if (! m_Doc.isEmpty())
qElement.setAttribute( "comment", m_Doc ); //CHECK: uml13.dtd compliance
#ifdef XMI_FLAT_PACKAGES
More information about the umbrello-devel
mailing list