diff -r b5537d245165 -r 25a950c2eb98 vymmodel.cpp --- a/vymmodel.cpp Tue Mar 09 08:28:49 2010 +0000 +++ b/vymmodel.cpp Tue Mar 09 08:29:09 2010 +0000 @@ -1553,7 +1553,6 @@ TreeItem *selti=getSelectedItem(); if (selti) { - emitNoteHasChanged(selti); saveState( selti, "setNote (\""+selti->getNote()+"\")", @@ -1561,7 +1560,8 @@ "setNote (\""+s+"\")", QString("Set note of %1 ").arg(getObjectName(selti)) ); } - selti->setNote(s); + selti->setNote(s); + emitNoteHasChanged(selti); } QString VymModel::getNote() @@ -1573,6 +1573,39 @@ return QString(); } +void VymModel::loadNote (const QString &fn) +{ + BranchItem *selbi=getSelectedBranch(); + if (selbi) + { + QString n; + if (!loadStringFromDisk (fn,n)) + qWarning ()<<"VymModel::loadNote Couldn't load "<getNote(); + if (n.isEmpty()) + qWarning ()<<"VymModel::saveNote note is empty, won't save to "<setNote (n); + } + } else + qWarning ("VymModel::saveNote no branch selected"); +} + void VymModel::findDuplicateURLs() // FIXME-3 needs GUI { // Generate map containing _all_ URLs and branches @@ -1612,6 +1645,7 @@ void VymModel::findAll (FindResultModel *rmodel, QString s, Qt::CaseSensitivity cs) { rmodel->clear(); + int i=0; BranchItem *cur=NULL; BranchItem *prev=NULL; nextBranch(cur,prev); @@ -1621,7 +1655,14 @@ { rmodel->addItem (cur); } - //if (cur->getNote().contains (s,cs)) //FIXME-2 does not detect multiple occurences + //if (cur->getNote().contains (s,cs)) //FIXME-2 does not detect multiple occurences yet + while (i>=0) + { + i=cur->getNote().indexOf (s,i,cs); + if (i>=0) i++; + qDebug()<<"i="<