[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Sep 16 11:54:36 UTC 2006
SVN commit 585144 by okellogg:
m_pCurrentRoot: New. Auxiliary variable for currentView().
M +5 -0 umldoc.cpp
M +7 -0 umldoc.h
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.cpp #585143:585144
@@ -95,6 +95,7 @@
m_pAutoSaveTimer = 0;
m_nViewID = Uml::id_None;
m_pTabPopupMenu = 0;
+ m_pCurrentRoot = NULL;
}
void UMLDoc::init() {
@@ -1182,6 +1183,8 @@
UMLFolder *UMLDoc::currentRoot() {
UMLView *currentView = UMLApp::app()->getCurrentView();
if (currentView == NULL) {
+ if (m_pCurrentRoot)
+ return m_pCurrentRoot;
kdError() << "UMLDoc::currentRoot: currentView is NULL, assuming Logical View"
<< endl;
return m_root[Uml::mt_Logical];
@@ -1664,6 +1667,7 @@
#endif
} else {
createDiagram(m_root[mt_Logical], Uml::dt_Class, false);
+ m_pCurrentRoot = m_root[mt_Logical];
}
emit sigResetStatusbarProgress();
return true;
@@ -1746,6 +1750,7 @@
for (int i = 0; i < Uml::N_MODELTYPES; i++) {
if (name == m_root[i]->getName() ||
name == nativeRootName[i]) { // @todo checking for name creates i18n problem
+ m_pCurrentRoot = m_root[i];
m_root[i]->loadFromXMI(tempElement);
foundUmbrelloRootFolder = true;
break;
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.h #585143:585144
@@ -892,6 +892,13 @@
*/
KPopupMenu* m_pTabPopupMenu;
+ /**
+ * Auxiliary variable for currentRoot():
+ * m_pCurrentRoot is only used if UMLApp::app()->getCurrentView()
+ * returns NULL.
+ */
+ UMLFolder * m_pCurrentRoot;
+
public slots:
void slotRemoveUMLObject(UMLObject*o);
More information about the umbrello-devel
mailing list