readDate in KLocale

Jacek Stolarczyk jacek at mer.chemia.polsl.gliwice.pl
Tue Aug 6 22:36:58 BST 2002


Hi,

Is there any specific reason why "for" loops are used for month names and day 
names? (instead of "while"). Unless I'm missing something here it looks 
rather inefficient.

example snippet:
error = true;
for (int j = 1; j < 8; j++) {
  QString s = weekDayName(j, c == 'a').lower();
  int len = s.length();
  if (str.mid(strpos, len) == s)
  {
    strpos += len;
    error = false;
  }
}

I've written a patch to KLocale (adding implementation of possessive forms of 
month names in dates) so I can take care the problem above and post an 
extended patch here for review. Most probably on Thursday, my patch needs 
more testing, otherwise users of languages without noun declension would be 
rather perplexed.

Regards,

Jacek Stolarczyk
-- 
jstolarz at kde.org
Coordinator of Polish translations of KDE




More information about the kde-core-devel mailing list