diff -r 735c7ea1d2a9 -r 4a84d7e444d8 vymmodel.cpp --- a/vymmodel.cpp Tue Jan 05 11:23:12 2010 +0000 +++ b/vymmodel.cpp Thu Jan 21 11:56:57 2010 +0000 @@ -14,6 +14,7 @@ #include "mainwindow.h" #include "misc.h" #include "parser.h" +#include "process.h" #include "warningdialog.h" #include "xlinkitem.h" @@ -1550,14 +1551,21 @@ return QString(); } -void VymModel::setNote(const QString &s) //FIXME-2 savestate missing // FIXME-2 call to VM::updateNoteFlag missing (fix signal handling here) -{ +void VymModel::setNote(const QString &s) +{ + cout << "VM::setNote\n"; TreeItem *selti=getSelectedItem(); if (selti) { + emitNoteHasChanged(selti); + saveState( + selti, + "setNote (\""+selti->getNote()+"\")", + selti, + "setNote (\""+s+"\")", + QString("Set note of %1 ").arg(getObjectName(selti)) ); + } selti->setNote(s); - emitNoteHasChanged(selti); - } } QString VymModel::getNote() @@ -1569,6 +1577,42 @@ return QString(); } +void VymModel::findDuplicateURLs() // FIXME-3 needs GUI +{ + // Generate map containing _all_ URLs and branches + QString u; + QMap map; + BranchItem *cur=NULL; + BranchItem *prev=NULL; + nextBranch(cur,prev); + while (cur) + { + u=cur->getURL(); + if (!u.isEmpty() ) + map.insertMulti (u,cur); + nextBranch(cur,prev); + } + + // Extract duplicate URLs + QMap ::const_iterator i=map.constBegin(); + QMap ::const_iterator firstdup=map.constEnd(); //invalid + while (i != map.constEnd()) + { + if (i!=map.constBegin() && i.key()==firstdup.key()) + { + if ( i-1==firstdup ) + { + cout << firstdup.key().toStdString() << endl; + cout << " - "<< firstdup.value() <<" - "<getHeadingStd()<getHeadingStd()<getURL().isEmpty()) urls.append( cur->getURL()); + if (!cur->getURL().isEmpty() && !(ignoreScrolled && cur->hasScrolledParent(cur) )) + urls.append( cur->getURL()); cur=nextBranch (cur,prev,true,selbi); } return urls; @@ -2888,7 +2933,77 @@ { QRegExp rx("(\\d+)"); if (rx.indexIn(url) !=-1) - cout << "VM::getBugzillaData bug="<isEmpty()) selti->clearNote(); else selti->setNote (textEditor->getText()); emitDataHasChanged(selti); - emitSelectionChanged(); - } }