diff -r 62d621e3e550 -r 5ecd0462f76b vymmodel.cpp --- a/vymmodel.cpp Mon Mar 15 15:32:37 2010 +0000 +++ b/vymmodel.cpp Thu Mar 18 11:31:02 2010 +0000 @@ -139,6 +139,7 @@ linkstyle=LinkableMapObj::PolyParabel; defXLinkWidth=1; defXLinkColor=QColor (230,230,230); + zoomFactor=1; hidemode=TreeItem::HideNone; @@ -226,6 +227,7 @@ xml.attribut("linkColor", defLinkColor.name() ) + xml.attribut("defXLinkColor", defXLinkColor.name() ) + xml.attribut("defXLinkWidth", QString().setNum(defXLinkWidth,10) ) + + xml.attribut("mapZoomFactor", QString().setNum(mapEditor->getZoomFactorTarget()) ) + colhint; s+=xml.beginElement("vymmap",mapAttr); xml.incIndent(); @@ -499,6 +501,8 @@ zipped=zipped_org; updateActions(); + + if (mapEditor) mapEditor->setZoomFactorTarget (zoomFactor); return err; } @@ -1646,7 +1650,6 @@ void VymModel::findAll (FindResultModel *rmodel, QString s, Qt::CaseSensitivity cs) { rmodel->clear(); - int i=0; BranchItem *cur=NULL; BranchItem *prev=NULL; nextBranch(cur,prev); @@ -1656,12 +1659,15 @@ { rmodel->addItem (cur); } - //if (cur->getNote().contains (s,cs)) //FIXME-2 does not detect multiple occurences yet + int i=0; while (i>=0) { - i=cur->getNote().indexOf (s,i,cs); - if (i>=0) i++; - //qDebug()<<"i="<getNote().indexOf (s,i,cs); //FIXME-2 add subitems to rmodel + if (i>=0) + { + rmodel->addSubItem (cur,"Note",cur,i); + i++; + } } nextBranch(cur,prev); } @@ -2284,7 +2290,7 @@ QString ("addMapCenter (%1,%2)").arg (contextPos.x()).arg(contextPos.y()), QString ("Adding MapCenter to (%1,%2)").arg (contextPos.x()).arg(contextPos.y()) ); - mapEditor->autoLayout(); //FIXME-3 testing + emitUpdateLayout(); return bi; } @@ -4413,6 +4419,11 @@ mapEditor=NULL; } +void VymModel::setMapZoomFactor (const double &d) +{ + zoomFactor=d; +} + void VymModel::setContextPos(QPointF p) { contextPos=p; @@ -5097,6 +5108,11 @@ emit (dataChanged (ix,ix) ); } +void VymModel::emitUpdateLayout() +{ + if (settings.value("/mainwindow/autoLayout/use","true")=="true") + emit (updateLayout()); +} bool VymModel::selectFirstBranch() {