From a7098018c56ec4f42c42cc4484be0154ea2d4bcc Mon Sep 17 00:00:00 2001 From: Giorgos Tsiapaliwkas Date: Mon, 23 Jan 2012 21:43:42 +0200 Subject: [PATCH] Add again Q_DECLARE_FLAGS and fix some typos --- declarativeimports/locale/locale.cpp | 24 +----------------------- declarativeimports/locale/locale.h | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/declarativeimports/locale/locale.cpp b/declarativeimports/locale/locale.cpp index 9349245f2..3ca0b187a 100644 --- a/declarativeimports/locale/locale.cpp +++ b/declarativeimports/locale/locale.cpp @@ -24,7 +24,7 @@ Locale::Locale(QObject* parent) : QObject(parent) { - m_locale = new KLocale(KGlobal::locale()); + m_locale = new KLocale(*KGlobal::locale()); } @@ -121,40 +121,18 @@ void Locale::translateRawFrom(const char *catname, const char *msg, QString *lan m_locale->translateRawFrom(catname, 0, msg, 0, 0, lang, trans); } -void Locale::translateRaw(const char *msg, QString *lang, QString *trans) const -{ - m_locale->translateRawFrom(0, 0, msg, 0, 0, lang, trans); -} - void Locale::translateRawFrom(const char *catname, const char *ctxt, const char *msg, QString *lang, QString *trans) const { m_locale->translateRawFrom(catname, ctxt, msg, 0, 0, lang, trans); } -void Locale::translateRaw(const char *ctxt, const char *msg, QString *lang, QString *trans) const -{ - m_locale->translateRawFrom(0, ctxt, msg, 0, 0, lang, trans); -} - void Locale::translateRawFrom(const char *catname, const char *singular, const char *plural, unsigned long n, QString *lang, QString *trans) const { m_locale->translateRawFrom(catname, 0, singular, plural, n, lang, trans); } -void Locale::translateRaw(const char *singular, const char *plural, unsigned long n, QString *lang, - QString *trans) const -{ - m_locale->translateRawFrom(0, 0, singular, plural, n, lang, trans); -} - -void Locale::translateRaw(const char *ctxt, const char *singular, const char *plural, - unsigned long n, QString *lang, QString *trans) const -{ - m_locale->translateRawFrom(0, ctxt, singular, plural, n, lang, trans); -} - QString Locale::translateQt(const char *context, const char *sourceText, const char *comment) const { return m_locale->translateQt(context, sourceText, comment); diff --git a/declarativeimports/locale/locale.h b/declarativeimports/locale/locale.h index ead62c3a8..f23ac18da 100644 --- a/declarativeimports/locale/locale.h +++ b/declarativeimports/locale/locale.h @@ -688,8 +688,8 @@ public: * @see BinaryUnitDialect */ QString formatByteSize(double size, int precision, - BinaryUnitDialect dialect = KLocale::DefaultBinaryDialect, - BinarySizeUnits specificUnit = KLocale::DefaultBinaryUnits) const; + BinaryUnitDialect dialect = Locale::DefaultBinaryDialect, + BinarySizeUnits specificUnit = Locale::DefaultBinaryUnits) const; /** * Returns the user's configured binary unit dialect. @@ -880,6 +880,8 @@ public: LongName /**< Long text format, e.g. Monday for Monday */ }; + Q_DECLARE_FLAGS(DateTimeComponents, DateTimeComponent) + //KDE5 move to KDateTime namespace /** * Format for date string. @@ -934,6 +936,8 @@ public: Seconds = 0x02 /**< Include the seconds value */ }; + Q_DECLARE_FLAGS(DateTimeFormatOptions, DateTimeFormatOption) + //KDE5 move to KDateTime namespace /** * Returns a string formatted to the current locale's conventions @@ -980,6 +984,8 @@ public: ///< "%I.%M.%S %p". }; + Q_DECLARE_FLAGS(TimeFormatOptions, TimeFormatOption) + //KDE5 move to KDateTime namespace /** * @@ -991,7 +997,7 @@ public: * @return The time as a string */ Q_INVOKABLE QString formatLocaleTime(const QTime &pTime, - TimeFormatOptions options = KLocale::TimeDefault) const; + TimeFormatOptions options = Locale::TimeDefault) const; /** * @@ -1214,6 +1220,8 @@ public: ///< left out when entering a time string. }; + Q_DECLARE_FLAGS(TimeProcessingOptions, TimeProcessingOption) + /** * * Converts a localized time string to a QTime. @@ -1232,7 +1240,7 @@ public: * @return The string converted to a QTime */ Q_INVOKABLE QTime readLocaleTime(const QString &str, bool *ok = 0, - TimeFormatOptions options = KLocale::TimeDefault, + TimeFormatOptions options = Locale::TimeDefault, TimeProcessingOptions processing = ProcessNonStrict) const; /**