[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sun May 27 12:58:37 UTC 2007
SVN commit 668740 by okellogg:
sync umllistview.cpp with trunk (commits 665608,665854,666779)
M +22 -13 umllistview.cpp
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umllistview.cpp #668739:668740
@@ -821,12 +821,9 @@
}
m_doc = d;
- Settings::OptionState optionState = Settings::getOptionState();
- if (! optionState.generalState.tabdiagrams) {
- connect(m_doc, SIGNAL(sigDiagramCreated(Uml::IDType)), this, SLOT(slotDiagramCreated(Uml::IDType)));
- connect(m_doc, SIGNAL(sigDiagramRemoved(Uml::IDType)), this, SLOT(slotDiagramRemoved(Uml::IDType)));
- connect(m_doc, SIGNAL(sigDiagramRenamed(Uml::IDType)), this, SLOT(slotDiagramRenamed(Uml::IDType)));
- }
+ connect(m_doc, SIGNAL(sigDiagramCreated(Uml::IDType)), this, SLOT(slotDiagramCreated(Uml::IDType)));
+ connect(m_doc, SIGNAL(sigDiagramRemoved(Uml::IDType)), this, SLOT(slotDiagramRemoved(Uml::IDType)));
+ connect(m_doc, SIGNAL(sigDiagramRenamed(Uml::IDType)), this, SLOT(slotDiagramRenamed(Uml::IDType)));
connect(m_doc, SIGNAL(sigObjectCreated(UMLObject *)), this, SLOT(slotObjectCreated(UMLObject *)));
connect(m_doc, SIGNAL(sigObjectRemoved(UMLObject *)), this, SLOT(slotObjectRemoved(UMLObject *)));
}
@@ -1387,14 +1384,15 @@
if (newParentType == Uml::lvt_Class ||
newParentType == Uml::lvt_Interface) {
// update list view
+
newItem = move->deepCopy(newParent);
// we don't delete move right away, it will be deleted in slots,
// called by subsequent steps
//delete move;
- UMLClassifierListItem *cli = dynamic_cast<UMLClassifierListItem*>(srcObj);
- newParent->addClassifierListItem(cli, newItem);
+
// update model objects
m_bCreatingChildObject = true;
+
UMLClassifier *oldParentClassifier = dynamic_cast<UMLClassifier*>(srcObj->parent());
UMLClassifier *newParentClassifier = dynamic_cast<UMLClassifier*>(newParentObj);
if (srcType == Uml::lvt_Attribute) {
@@ -1415,7 +1413,11 @@
newAtt->setType(att->getType());
newAtt->setVisibility(att->getVisibility());
newAtt->setInitialValue(att->getInitialValue());
+
newItem->setUMLObject(newAtt);
+ newParent->addClassifierListItem( newAtt, newItem );
+
+ connectNewObjectsSlots( newAtt );
// Let's not forget to update the DocWindow::m_pObject
// because the old one is about to be physically deleted !
UMLApp::app()->getDocWindow()->showDocumentation(newAtt, true);
@@ -1448,6 +1450,10 @@
newOp->addParm(newParm);
}
newItem->setUMLObject(newOp);
+ newParent->addClassifierListItem( newOp, newItem );
+
+ connectNewObjectsSlots( newOp );
+
// Let's not forget to update the DocWindow::m_pObject
// because the old one is about to be physically deleted !
UMLApp::app()->getDocWindow()->showDocumentation(newOp, true);
@@ -2134,9 +2140,16 @@
return false;
}
+ // make changes to the object visible to this umllistviewitem
+ connectNewObjectsSlots( newObject );
item->setUMLObject( newObject );
item->setText( text );
ensureItemVisible(item);
+
+ // as it's a ClassifierListItem add it to the childObjectMap of the parent
+ UMLClassifierListItem* classifierListItem = static_cast<UMLClassifierListItem*>( newObject );
+ static_cast<UMLListViewItem*>( item->parent() )->addClassifierListItem(classifierListItem, item );
+
m_bCreatingChildObject = false;
//m_doc->setModified();
@@ -2504,11 +2517,7 @@
break;
default:
if (Model_Utils::typeIsDiagram(lvType)) {
- Settings::OptionState optionState = Settings::getOptionState();
- // don't load diagrams any more when using tabbed diagrams
- if (!optionState.generalState.tabdiagrams) {
- item = new UMLListViewItem( parent, label, lvType, nID );
- }
+ item = new UMLListViewItem( parent, label, lvType, nID );
} else {
kError() << pfx << "INTERNAL ERROR: unexpected listview type "
<< lvType << " (ID " << ID2STR(nID) << ")" << endl;
More information about the umbrello-devel
mailing list