diff -r c2ce9944148c -r 0bba81dde1bc flagrow.cpp --- a/flagrow.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/flagrow.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -1,8 +1,7 @@ +#include + #include "flagrow.h" -#include -using namespace std; - ///////////////////////////////////////////////////////////////// // FlagRow ///////////////////////////////////////////////////////////////// @@ -47,9 +46,12 @@ } -bool FlagRow::isActive (const QString &name) +bool FlagRow::isActive (const QString &name) //FIXME-2 regression { - return activeNames.contains (name); + QString n; + foreach (n,activeNames) + if (n==name) return true; + return false; } void FlagRow::toggle (const QString &name, FlagRow *masterRow) @@ -76,14 +78,14 @@ void FlagRow::activate (const QString &name) { - if (!activeNames.contains (name)) + if (!isActive (name)) activeNames.append (name); else qWarning (QString("FlagRow::activate - %1 is already active").arg(name)); } -void FlagRow::deactivate (const QString &name) +void FlagRow::deactivate (const QString &name) //FIXME-4 complaints if CTRL-E is pressed with focus on NoteEditor ?! { int n=activeNames.indexOf (name); if (n>=0) @@ -142,23 +144,22 @@ void FlagRow::setMasterRow (FlagRow *row) { - masterRow=row; + masterRow=row; } void FlagRow::updateToolBar (const QStringList &activeNames) { if (toolBar ) { - if (activeNames.isEmpty() ) - for (int i=0;igetAction()->setChecked (false); - else - for (int i=0;igetAction()->setChecked ( - activeNames.contains (flags.at(i)->getName())); + for (int i=0;igetAction()->setChecked (false); + for (int i=0;igetName()); + if (n>=0) + flags.at(i)->getAction()->setChecked (true); + } } - return; - }