-rw-r--r-- | microkde/kdecore/klocale.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp index 8b4513e..27acfec 100644 --- a/microkde/kdecore/klocale.cpp +++ b/microkde/kdecore/klocale.cpp @@ -341,4 +341,8 @@ QString KLocale::formatDateTime(const QDateTime &pDateTime, - return format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) + QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) .arg(formatTime( pDateTime.time(), includeSeconds , intIntDateFormat )); + + //qDebug("KLocale::formatDateTime transformed %s, into %s", pDateTime.toString().latin1(), res.latin1() ); + + return res; } @@ -603,2 +607,4 @@ QDateTime KLocale::readDateTime(const QString &intstr, + QDateTime m_dt; + if (ok) @@ -610,7 +616,11 @@ QDateTime KLocale::readDateTime(const QString &intstr, } - QDateTime m_dt; + + //only set values if both operations returned true. + if ((ok1 == true) && (ok2 == true)) + { m_dt.setDate(m_date); m_dt.setTime(m_time); + } - qDebug("KLocale::readDateTime() transformed %s into %s (%s), %s (%s) : err1=%i, err2=%i", intstr.latin1(), date.latin1(), dformat.latin1(), time.latin1(), tformat.latin1(), ok1, ok2); + //qDebug("KLocale::readDateTime() transformed %s into %s (%s), %s (%s) : err1=%i, err2=%i", intstr.latin1(), date.latin1(), dformat.latin1(), time.latin1(), tformat.latin1(), ok1, ok2); return m_dt; |