[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Mar 18 17:16:23 UTC 2005


CVS commit by okellogg: 

UMLListView::{slotObjectCreated,childObjectAdded}: It turns out the slowdown
was caused by calling ensureItemVisible() during UMLDoc::resolveTypes().
BUG:101148


  M +7 -3      umllistview.cpp   1.150
  M +4 -1      umlobject.cpp   1.71
  M +5 -0      umlobject.h   1.51


--- kdesdk/umbrello/umbrello/umllistview.cpp  #1.149:1.150
@@ -597,4 +597,6 @@ void UMLListView::slotObjectCreated(UMLO
         connectNewObjectsSlots(object);
         newItem = new UMLListViewItem(parentItem, object->getName(), convert_OT_LVT(type), object);
+        if (m_doc->loading())
+                return;
         ensureItemVisible(newItem);
         newItem->setOpen(true);
@@ -686,8 +688,10 @@ void UMLListView::childObjectAdded(UMLOb
                 UMLListViewItem *newItem = new UMLListViewItem(parentItem, text,
                                                                convert_OT_LVT(obj->getBaseType()), obj);
+                if (! m_doc->loading()) {
                 ensureItemVisible(newItem);
                 clearSelection();
                 setSelected(newItem, true);
         }
+        }
         connectNewObjectsSlots(obj);
 }

--- kdesdk/umbrello/umbrello/umlobject.cpp  #1.70:1.71
@@ -63,4 +63,5 @@ void UMLObject::init() {
         m_bStatic = false;
         m_bInPaste = false;
+        m_bCreationWasSignalled = false;
         m_pSecondary = NULL;
 }
@@ -328,9 +329,11 @@ QString UMLObject::getSecondaryId() cons
 
 void UMLObject::maybeSignalObjectCreated() {
-        if (m_BaseType != Uml::ot_Stereotype &&
+        if (!m_bCreationWasSignalled &&
+            m_BaseType != Uml::ot_Stereotype &&
             m_BaseType != Uml::ot_Association &&
             m_BaseType != Uml::ot_Role) {
                 UMLDoc* umldoc = UMLApp::app()->getDocument();
                 umldoc->signalUMLObjectCreated(this);
+                m_bCreationWasSignalled = true;
         }
 }

--- kdesdk/umbrello/umbrello/umlobject.h  #1.50:1.51
@@ -414,4 +414,9 @@ protected:
 
         /**
+         * Auxiliary to maybeSignalObjectCreated().
+         */
+        bool m_bCreationWasSignalled;
+
+        /**
          * Pointer to an associated object.
          * Only a few of the classes inheriting from UMLObject use this.






More information about the umbrello-devel mailing list