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

Oliver Kellogg okellogg at users.sourceforge.net
Tue Oct 24 19:38:46 UTC 2006


SVN commit 598836 by okellogg:

Style: Prevent dangling of m_datatypeFolder.

 M  +4 -4      umllistview.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umllistview.cpp #598835:598836
@@ -129,6 +129,7 @@
     m_rv = NULL;
     for (int i = 0; i < Uml::N_MODELTYPES; i++)
         m_lv[i] = NULL;
+    m_datatypeFolder = NULL;
     //setup slots/signals
     connect(this, SIGNAL(dropped(QDropEvent *, QListViewItem *, QListViewItem *)),
             this, SLOT(slotDropped(QDropEvent *, QListViewItem *, QListViewItem *)));
@@ -1802,9 +1803,6 @@
 }
 
 void UMLListView::addNewItem(UMLListViewItem *parentItem, Uml::ListView_Type type) {
-    QString name;
-
-    //// CHECK: Why?
      if (type == Uml::lvt_Datatype) {
          parentItem = m_datatypeFolder;
      }
@@ -1818,6 +1816,7 @@
 
     Uml::Icon_Type icon = Model_Utils::convert_LVT_IT(type);
 
+    QString name;
     if (Model_Utils::typeIsDiagram(type)) {
         Uml::Diagram_Type dt = Model_Utils::convert_LVT_DT(type);
         name = getUniqueDiagramName(dt);
@@ -2579,7 +2578,8 @@
     if ( !parent ) {
         return;
     }
-
+    if (parent == m_lv[Uml::mt_Logical])
+        m_datatypeFolder = NULL;
     while ( parent->firstChild() ) {
         delete parent->firstChild();
     }




More information about the umbrello-devel mailing list