Index: ossp-pkg/as/as-gui/TODO RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v rcsdiff -q -kk '-r1.83' '-r1.84' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/TODO,v' 2>/dev/null --- TODO 2003/02/11 14:19:57 1.83 +++ TODO 2003/02/11 22:17:17 1.84 @@ -75,7 +75,6 @@ cs: line numberscould be referenced when entering accounts ala bash history ('!4' = record #4) mlelstv: 24:00 muss als Valideintrag im Finishfeld erlaubt thl: / should enable the user to search for something -thl: sort accounting 'popup' list thl: using = should force a recalculation for a time field thl: using ~ should round a time field to the next quarter (configurable) Index: ossp-pkg/as/as-gui/as_dataop.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v rcsdiff -q -kk '-r1.46' '-r1.47' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_dataop.cpp,v' 2>/dev/null --- as_dataop.cpp 2003/02/11 14:19:57 1.46 +++ as_dataop.cpp 2003/02/11 22:17:17 1.47 @@ -29,6 +29,10 @@ // tidatops.cpp: ISO C++ implementation // +// System headers +#include +#include + // Qt general headers #include // Portable regular expressions #include @@ -72,7 +76,13 @@ // void Titraqform::loadAccounts(QTextStream &Tstream) { - QString Line; // Used for linewise editing and whitespace eating + using namespace std; // Needed for hash tables with hmap + map Hashnames; // Hashtable for storing names + map Hashnums; // Hashtable for storing repetitions + map::iterator Nameiter; // The hashtable name iterator + map::iterator Numiter; // The hashtable number iterator + + QString Line; // Used for linewise editing and whitespace eating // Eat lines until reading the start accounts token while (!Line.startsWith(trUtf8("%!AS-ACCOUNTS")) && !Tstream.atEnd()) { @@ -99,7 +109,8 @@ if (Temp == QString(QChar('R'))) { // Copy the account field Asline >> Temp; // to temporary for transfer - *m_pTaskentries << Temp; // to internal account bank + string Convstring = Temp; // Convert to string (can't cast?) + Hashnames[Convstring] += Hashnames[Convstring]; } Line = QString(""); // Clear line for next round @@ -110,6 +121,22 @@ Line = QString(""); } } + +// Hashnames.insert(map::value_type((string)QString, int)); + for (Nameiter = Hashnames.begin(); Nameiter != Hashnames.end(); Nameiter++) + Hashnums[Nameiter->second] += Nameiter->first + '\n'; + +// FIXME: Put this in loadData, to load custom and most used task names before +// FIXME: default listings are sorted and inserted + for (Numiter = Hashnums.begin(); Numiter != Hashnums.end(); Numiter++) { + + // Count the number of lines of sorted task names + int nNumlines = QString(Numiter->second).contains('\n'); + + // Iterate through the lines of task names, feeding them into the menu + for (int nIter = 0; nIter < nNumlines; nIter++) + *m_pTaskentries << QString(Numiter->second).section('\n', nIter, nIter); + } } //