1.1 --- a/mapcenterobj.cpp Mon Nov 20 12:12:05 2006 +0000
1.2 +++ b/mapcenterobj.cpp Thu Nov 23 13:53:08 2006 +0000
1.3 @@ -1,4 +1,4 @@
1.4 -#include <qdatetime.h>
1.5 +#include <QDateTime>
1.6
1.7 #include "mapcenterobj.h"
1.8 #include "floatimageobj.h"
1.9 @@ -20,7 +20,7 @@
1.10
1.11 MapCenterObj::~MapCenterObj()
1.12 {
1.13 -// cout << "Destr MapCenterObj\n";
1.14 + cout << "Destr MapCenterObj\n";
1.15 }
1.16
1.17 void MapCenterObj::clear()
1.18 @@ -74,9 +74,8 @@
1.19 childPos.setX( clickBox.topLeft().x() + (int)(clickBox.width())/2 );
1.20 childPos.setY( clickBox.topLeft().y() + (int)(clickBox.height())/2 );
1.21 parPos=childPos;
1.22 - BranchObj *b;
1.23 - for (b=branch.first(); b; b=branch.next() )
1.24 - b->updateLink();
1.25 + for (int i=0; i<branch.size(); ++i)
1.26 + branch.at(i)->updateLink();
1.27 }
1.28
1.29 void MapCenterObj::updateRelPositions()
1.30 @@ -84,11 +83,10 @@
1.31 if (repositionRequest) unsetAllRepositionRequests();
1.32
1.33 // update relative Positions of branches and floats
1.34 - BranchObj *b;
1.35 - for (b=branch.first(); b; b=branch.next() )
1.36 + for (int i=0; i<branch.size(); ++i)
1.37 {
1.38 - b->setRelPos();
1.39 - b->setOrientation();
1.40 + branch.at(i)->setRelPos();
1.41 + branch.at(i)->setOrientation();
1.42 }
1.43
1.44 for (int i=0; i<floatimage.size(); ++i)
1.45 @@ -99,13 +97,12 @@
1.46
1.47 LinkableMapObj* MapCenterObj::findMapObj(QPoint p, LinkableMapObj *excludeLMO)
1.48 {
1.49 - BranchObj *bo;
1.50 LinkableMapObj *lmo;
1.51
1.52 // Search through child branches
1.53 - for (bo=branch.first(); bo; bo=branch.next() )
1.54 + for (int i=0; i<branch.size(); ++i)
1.55 {
1.56 - lmo = bo->findMapObj(p, excludeLMO);
1.57 + lmo = branch.at(i)->findMapObj(p, excludeLMO);
1.58 if (lmo!= NULL) return lmo;
1.59 }
1.60 // is p in MapCenter?
1.61 @@ -161,18 +158,16 @@
1.62 s+=note.saveToDir();
1.63
1.64 // Save branches
1.65 - BranchObj *bo;
1.66 - for (bo=branch.first(); bo; bo=branch.next() )
1.67 - s+=bo->saveToDir(tmpdir,prefix, offset);
1.68 + for (int i=0; i<branch.size(); ++i)
1.69 + s+=branch.at(i)->saveToDir(tmpdir,prefix, offset);
1.70
1.71 // Save FloatImages
1.72 for (int i=0; i<floatimage.size(); ++i)
1.73 s+=floatimage.at(i)->saveToDir (tmpdir,prefix);
1.74
1.75 // Save XLinks
1.76 - XLinkObj *xlo;
1.77 - for (xlo=xlink.first(); xlo; xlo=xlink.next() )
1.78 - s+=xlo->saveToDir();
1.79 + for (int i=0;i<xlink.size(); ++i)
1.80 + s+=xlink.at(i)->saveToDir();
1.81
1.82 decIndent();
1.83 s+=endElement ("mapcenter");