diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-19 17:06:22 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-07-21 18:22:00 +0200 |
| commit | 74a60ebf31ab8271d03d53e8c9700b57147055d5 (patch) | |
| tree | b8f84dde97957d26c5d3eda75bc03715a9502821 /src | |
| parent | df736da245bf1ea04fadffa1f5d35c37252930a4 (diff) | |
Move month names from QGregorianCalendar to QRomanCalendar
The other Roman-based calendars share the same month names as
Gregorian, so it makes sense for them to use the same system fallbacks
as it when available.
Change-Id: Idf2f2901032c7a02d641f00a3993cc95b6bb8067
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/text/qlocale.cpp | 8 | ||||
| -rw-r--r-- | src/corelib/text/qlocale.h | 2 | ||||
| -rw-r--r-- | src/corelib/time/qgregoriancalendar_p.h | 6 | ||||
| -rw-r--r-- | src/corelib/time/qromancalendar_p.h | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 5e708abf581..b5edfdefe82 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -3004,8 +3004,8 @@ QString QCalendarBackend::monthName(const QLocale &locale, int month, int, localeMonthData(), month, format); } -QString QGregorianCalendar::monthName(const QLocale &locale, int month, int year, - QLocale::FormatType format) const +QString QRomanCalendar::monthName(const QLocale &locale, int month, int year, + QLocale::FormatType format) const { #ifndef QT_NO_SYSTEMLOCALE if (locale.d->m_data == &systemLocaleData) { @@ -3039,8 +3039,8 @@ QString QCalendarBackend::standaloneMonthName(const QLocale &locale, int month, localeMonthData(), month, format); } -QString QGregorianCalendar::standaloneMonthName(const QLocale &locale, int month, int year, - QLocale::FormatType format) const +QString QRomanCalendar::standaloneMonthName(const QLocale &locale, int month, int year, + QLocale::FormatType format) const { #ifndef QT_NO_SYSTEMLOCALE if (locale.d->m_data == &systemLocaleData) { diff --git a/src/corelib/text/qlocale.h b/src/corelib/text/qlocale.h index 7b93827282f..e2ebda7aebd 100644 --- a/src/corelib/text/qlocale.h +++ b/src/corelib/text/qlocale.h @@ -1126,7 +1126,7 @@ private: friend class QLocalePrivate; friend class QSystemLocale; friend class QCalendarBackend; - friend class QGregorianCalendar; + friend class QRomanCalendar; friend Q_CORE_EXPORT size_t qHash(const QLocale &key, size_t seed) noexcept; friend bool operator==(const QLocale &lhs, const QLocale &rhs) { return lhs.equals(rhs); } diff --git a/src/corelib/time/qgregoriancalendar_p.h b/src/corelib/time/qgregoriancalendar_p.h index ed950ecf494..9465581f839 100644 --- a/src/corelib/time/qgregoriancalendar_p.h +++ b/src/corelib/time/qgregoriancalendar_p.h @@ -35,12 +35,6 @@ public: bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override; QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override; - // Names of months (implemented in qlocale.cpp): - QString monthName(const QLocale &locale, int month, int year, - QLocale::FormatType format) const override; - QString standaloneMonthName(const QLocale &locale, int month, int year, - QLocale::FormatType format) const override; - // Static optimized versions for the benefit of QDate: static int weekDayOfJulian(qint64 jd); static bool leapTest(int year); diff --git a/src/corelib/time/qromancalendar_p.h b/src/corelib/time/qromancalendar_p.h index 9b5e7afd0ca..96501ce701a 100644 --- a/src/corelib/time/qromancalendar_p.h +++ b/src/corelib/time/qromancalendar_p.h @@ -29,6 +29,12 @@ public: bool isLunar() const override; bool isLuniSolar() const override; bool isSolar() const override; + + // Names of months (implemented in qlocale.cpp): + QString monthName(const QLocale &locale, int month, int year, + QLocale::FormatType format) const override; + QString standaloneMonthName(const QLocale &locale, int month, int year, + QLocale::FormatType format) const override; protected: // locale support: const QCalendarLocale *localeMonthIndexData() const override; |
