Proposal: consistency for dateFormat()

Jarosław Staniek js at
Fri Jan 20 15:37:20 GMT 2006

Stephan Kulow said the following, On 2006-01-20 15:58:

> Am Freitag, 20. Januar 2006 10:45 schrieb Jaroslaw Staniek:
>>My proposal is to change the default of shortFormat to true for KDElibs4
>>QString KLocale::formatDate(const QDate &pDate, bool shortFormat = false)
>>Why? Many of KLocale data/time-related functions default to short formats,
>>in particular, shortFormat is true by default here:
>>   QString KLocale::formatDateTime(const QDateTime &pDateTime,
>>			 bool shortFormat = true,
>>			 bool includeSecs = false) const;
>>I must admit that at least two times I used formatDate(const QDate &)
>>expecting short format as in formatDateTime() and was surprised that long
>>format was printed.
> Objection! That is a suprise regression from KDE3 to KDE4. I wouldn't object 
> if you change the interface to use some well defined enum for that, so that 
> the developer needs to change his code to follow the new API

Ah, OK, I can propose an enum for both booleans.
But then we still couldn't have the default option in if we do not want to 
surprise developers, could we?

KLocale::formatDateTime(const QDateTime &pDateTime, int options = 

(Yes we can use QFlags here).

regards / pozdrawiam,
  Jaroslaw Staniek / OpenOffice Polska

  Kexi Developer: |
  Kexi Support:
  Kexi For MS Windows:
  KDE3, KDE4 Libraries For Developing MS Windows Applications:

More information about the kde-core-devel mailing list