diff -r 133e2ed6b9c5 -r f1006de05c54 branchitem.cpp --- a/branchitem.cpp Thu Sep 03 08:52:00 2009 +0000 +++ b/branchitem.cpp Mon Sep 07 15:36:57 2009 +0000 @@ -12,6 +12,8 @@ { //cout << "Constr. BranchItem\n"; + // Set type if parent is known yet + // if not, type is set in insertBranch or TreeItem::appendChild if (parent==rootItem) setType (MapCenter); else @@ -49,7 +51,13 @@ if (pos>branchCounter) pos=branchCounter; childItems.insert(pos+branchOffset,branch); branch->parentItem=this; + branch->rootItem=rootItem; branch->setModel (model); + if (parentItem==rootItem) + setType (MapCenter); + else + setType (Branch); + if (branchCounter==0) branchOffset=childItems.count()-1; @@ -425,7 +433,8 @@ { newbo->setParObj( ((MapItem*)parentItem)->getLMO() ); // Set visibility depending on parents - if (((BranchItem*)parentItem)->scrolled || !((MapItem*)parentItem)->getLMO()->isVisibleObj() ) + if (parentItem!=rootItem && + ( ((BranchItem*)parentItem)->scrolled || !((MapItem*)parentItem)->getLMO()->isVisibleObj() ) ) newbo->setVisibility (false); } newbo->setDefAttr(BranchObj::NewBranch);