1.1 --- a/branchitem.cpp Thu Apr 23 12:15:31 2009 +0000
1.2 +++ b/branchitem.cpp Mon Apr 27 12:07:15 2009 +0000
1.3 @@ -17,8 +17,12 @@
1.4
1.5 BranchItem::~BranchItem()
1.6 {
1.7 - cout << "Destr. BranchItem\n";
1.8 - qDeleteAll(childItems);
1.9 +// cout << "Destr. BranchItem "<<getHeadingStd()<<endl;
1.10 + if (lmo)
1.11 + {
1.12 + delete lmo;
1.13 + lmo=NULL;
1.14 + }
1.15 }
1.16
1.17 void BranchItem::copy (BranchItem *other)
1.18 @@ -27,6 +31,19 @@
1.19 tmpUnscrolled=other->tmpUnscrolled;
1.20 }
1.21
1.22 +void BranchItem::insertBranch (int pos, BranchItem *branch)
1.23 +{
1.24 + if (pos<0) pos=0;
1.25 + if (pos>branchCounter) pos=branchCounter;
1.26 + childItems.insert(pos+branchOffset,branch);
1.27 + branch->parentItem=this;
1.28 + branch->setModel (model);
1.29 +
1.30 + if (branchCounter==0)
1.31 + branchOffset=childItems.count()-1;
1.32 + branchCounter++;
1.33 +}
1.34 +
1.35 QString BranchItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset)
1.36 {
1.37 // Cloudy stuff can be hidden during exports
1.38 @@ -310,12 +327,11 @@
1.39 BranchObj* BranchItem::createMapObj(QGraphicsScene *scene)
1.40 {
1.41 // Initialize BranchObj, order of things is important...
1.42 - cout << "BI::createMO scene="<<scene<<endl;
1.43 BranchObj* newbo=new BranchObj(scene);
1.44 newbo->setParObj(parent()->getLMO() );
1.45 newbo->setTreeItem (this);
1.46 newbo->setDefAttr(BranchObj::NewBranch);
1.47 - //newbo->updateLink();
1.48 + //newbo->updateLink(); //FIXME-3
1.49
1.50 lmo=newbo;
1.51 return newbo;