1.1 --- a/flagrow.cpp Wed Feb 10 13:48:42 2010 +0000
1.2 +++ b/flagrow.cpp Fri Feb 19 13:47:03 2010 +0000
1.3 @@ -1,8 +1,7 @@
1.4 +#include <QDebug>
1.5 +
1.6 #include "flagrow.h"
1.7
1.8 -#include <iostream>
1.9 -using namespace std;
1.10 -
1.11 /////////////////////////////////////////////////////////////////
1.12 // FlagRow
1.13 /////////////////////////////////////////////////////////////////
1.14 @@ -47,9 +46,12 @@
1.15 }
1.16
1.17
1.18 -bool FlagRow::isActive (const QString &name)
1.19 +bool FlagRow::isActive (const QString &name) //FIXME-2 regression
1.20 {
1.21 - return activeNames.contains (name);
1.22 + QString n;
1.23 + foreach (n,activeNames)
1.24 + if (n==name) return true;
1.25 + return false;
1.26 }
1.27
1.28 void FlagRow::toggle (const QString &name, FlagRow *masterRow)
1.29 @@ -76,14 +78,14 @@
1.30
1.31 void FlagRow::activate (const QString &name)
1.32 {
1.33 - if (!activeNames.contains (name))
1.34 + if (!isActive (name))
1.35 activeNames.append (name);
1.36 else
1.37 qWarning (QString("FlagRow::activate - %1 is already active").arg(name));
1.38 }
1.39
1.40
1.41 -void FlagRow::deactivate (const QString &name)
1.42 +void FlagRow::deactivate (const QString &name) //FIXME-4 complaints if CTRL-E is pressed with focus on NoteEditor ?!
1.43 {
1.44 int n=activeNames.indexOf (name);
1.45 if (n>=0)
1.46 @@ -142,23 +144,22 @@
1.47
1.48 void FlagRow::setMasterRow (FlagRow *row)
1.49 {
1.50 - masterRow=row;
1.51 + masterRow=row;
1.52 }
1.53
1.54 void FlagRow::updateToolBar (const QStringList &activeNames)
1.55 {
1.56 if (toolBar )
1.57 {
1.58 - if (activeNames.isEmpty() )
1.59 - for (int i=0;i<flags.size();++i)
1.60 - flags.at(i)->getAction()->setChecked (false);
1.61 - else
1.62 - for (int i=0;i<flags.size();++i)
1.63 - flags.at(i)->getAction()->setChecked (
1.64 - activeNames.contains (flags.at(i)->getName()));
1.65 + for (int i=0;i<flags.size();++i)
1.66 + flags.at(i)->getAction()->setChecked (false);
1.67 + for (int i=0;i<flags.size();++i)
1.68 + {
1.69 + int n=activeNames.indexOf (flags.at(i)->getName());
1.70 + if (n>=0)
1.71 + flags.at(i)->getAction()->setChecked (true);
1.72 + }
1.73 }
1.74 - return;
1.75 -
1.76 }
1.77
1.78