diff --git a/declarativeimports/locale/locale.cpp b/declarativeimports/locale/locale.cpp index f8bd19437..63213b297 100644 --- a/declarativeimports/locale/locale.cpp +++ b/declarativeimports/locale/locale.cpp @@ -279,18 +279,16 @@ QTime Locale::readTime(const QString &intstr) const return m_locale->readTime(intstr, ok); } -QTime Locale::readLocaleTime(const QString &intstr, bool *ok, TimeFormatOptions options, +QTime Locale::readLocaleTime(const QString &intstr, TimeFormatOptions options, TimeProcessingOptions processing) const { - Q_UNUSED(options) - Q_UNUSED(processing) - return m_locale->readLocaleTime(intstr, ok); + bool *ok; + return m_locale->readLocaleTime(intstr, ok, (KLocale::TimeFormatOptions)(int)options, (KLocale::TimeProcessingOptions)(int)processing); } QString Locale::formatLocaleTime(const QTime &time, TimeFormatOptions options) const { - Q_UNUSED(options) - return m_locale->formatLocaleTime(time); + return m_locale->formatLocaleTime(time, (KLocale::TimeFormatOptions)(int)options); } bool Locale::use12Clock() const @@ -315,9 +313,7 @@ QStringList Locale::currencyCodeList() const QString Locale::formatDateTime(const QDateTime &dateTime, Locale::DateFormat format, DateTimeFormatOptions options) const { - Q_UNUSED(format) - Q_UNUSED(options) - return m_locale->formatDateTime(dateTime); + return m_locale->formatDateTime(dateTime, (KLocale::DateFormat)format, (KLocale::DateTimeFormatOptions)(int)options); } void Locale::setDateFormat(const QString &format) diff --git a/declarativeimports/locale/locale.h b/declarativeimports/locale/locale.h index 4fbcaeb64..f52761e4c 100644 --- a/declarativeimports/locale/locale.h +++ b/declarativeimports/locale/locale.h @@ -993,7 +993,7 @@ public: * @return The string converted to a QTime */ - Q_INVOKABLE QTime readLocaleTime(const QString &str, bool *ok = 0, + Q_INVOKABLE QTime readLocaleTime(const QString &str, TimeFormatOptions options = Locale::TimeDefault, TimeProcessingOptions processing = ProcessNonStrict) const; diff --git a/declarativeimports/locale/tests/contents/code/klocaleqmltest.qml b/declarativeimports/locale/tests/contents/code/klocaleqmltest.qml index a77c6778a..0e61bb326 100644 --- a/declarativeimports/locale/tests/contents/code/klocaleqmltest.qml +++ b/declarativeimports/locale/tests/contents/code/klocaleqmltest.qml @@ -180,7 +180,7 @@ Item { console.log("prettyFormatDuration:" + locale.prettyFormatDuration(10)) - console.log("formatLocaleTime:" + locale.formatLocaleTime("2010-05-05")) + console.log("formatLocaleTime:" + locale.formatLocaleTime("11:12:13")) console.log("dayPeriodText:" + locale.dayPeriodText("11:22:33")) @@ -192,7 +192,7 @@ Item { console.log("readTime:" + locale.readTime("11:22:33"))//TODO its value in nothing(blank) - console.log("readLocaleTime:" + locale.readLocaleTime("11:12:13 AM")) + console.log("readLocaleTime:" + locale.readLocaleTime("11:12:13")) console.log("fileEncodingMib:" + locale.fileEncodingMib)