[PATCH 12/23] kcalendarsystem: Make calendarSystem() a simple virtual function.
Jon Severinsson
jon at severinsson.net
Fri Oct 12 15:13:47 UTC 2012
---
kdecore/date/kcalendarsystem.cpp | 8 --------
kdecore/date/kcalendarsystem.h | 3 +--
kdecore/date/kcalendarsystemcoptic.cpp | 10 +++++-----
kdecore/date/kcalendarsystemcoptic_p.h | 1 +
kdecore/date/kcalendarsystemcopticprivate_p.h | 1 -
kdecore/date/kcalendarsystemethiopian.cpp | 11 +++++------
kdecore/date/kcalendarsystemethiopian_p.h | 1 +
kdecore/date/kcalendarsystemgregorian.cpp | 10 +++++-----
kdecore/date/kcalendarsystemgregorian_p.h | 1 +
kdecore/date/kcalendarsystemgregorianprivate_p.h | 1 -
kdecore/date/kcalendarsystemhebrew.cpp | 11 +++++------
kdecore/date/kcalendarsystemhebrew_p.h | 1 +
kdecore/date/kcalendarsystemindiannational.cpp | 11 +++++------
kdecore/date/kcalendarsystemindiannational_p.h | 1 +
kdecore/date/kcalendarsystemislamiccivil.cpp | 11 +++++------
kdecore/date/kcalendarsystemislamiccivil_p.h | 1 +
kdecore/date/kcalendarsystemjalali.cpp | 11 +++++------
kdecore/date/kcalendarsystemjalali_p.h | 1 +
kdecore/date/kcalendarsystemjapanese.cpp | 11 +++++------
kdecore/date/kcalendarsystemjapanese_p.h | 1 +
kdecore/date/kcalendarsystemjulian.cpp | 11 +++++------
kdecore/date/kcalendarsystemjulian_p.h | 1 +
kdecore/date/kcalendarsystemminguo.cpp | 11 +++++------
kdecore/date/kcalendarsystemminguo_p.h | 1 +
kdecore/date/kcalendarsystemprivate_p.h | 1 -
kdecore/date/kcalendarsystemqdate.cpp | 11 +++++------
kdecore/date/kcalendarsystemqdate_p.h | 1 +
kdecore/date/kcalendarsystemthai.cpp | 11 +++++------
kdecore/date/kcalendarsystemthai_p.h | 1 +
29 filer ändrade, 73 tillägg(+), 83 borttagningar(-)
diff --git a/kdecore/date/kcalendarsystem.cpp b/kdecore/date/kcalendarsystem.cpp
index 5995e82..a31b978 100644
--- a/kdecore/date/kcalendarsystem.cpp
+++ b/kdecore/date/kcalendarsystem.cpp
@@ -815,14 +815,6 @@ KCalendarSystem::~KCalendarSystem()
}
// NOT VIRTUAL - If override needed use shared-d
-KLocale::CalendarSystem KCalendarSystem::calendarSystem() const
-{
- Q_D(const KCalendarSystem);
-
- return d->calendarSystem();
-}
-
-// NOT VIRTUAL - If override needed use shared-d
QString KCalendarSystem::calendarLabel() const
{
return KCalendarSystem::calendarLabel(calendarSystem());
diff --git a/kdecore/date/kcalendarsystem.h b/kdecore/date/kcalendarsystem.h
index 6e80636..25af454 100644
--- a/kdecore/date/kcalendarsystem.h
+++ b/kdecore/date/kcalendarsystem.h
@@ -133,7 +133,6 @@ public:
*/
KDECORE_DEPRECATED virtual QString calendarType() const = 0;
- //KDE5 make virtual?
/**
* @since 4.6
*
@@ -141,7 +140,7 @@ public:
*
* @return type of calendar system
*/
- KLocale::CalendarSystem calendarSystem() const;
+ virtual KLocale::CalendarSystem calendarSystem() const = 0;
//KDE5 make virtual?
/**
diff --git a/kdecore/date/kcalendarsystemcoptic.cpp b/kdecore/date/kcalendarsystemcoptic.cpp
index f664d1e..0578dfa 100644
--- a/kdecore/date/kcalendarsystemcoptic.cpp
+++ b/kdecore/date/kcalendarsystemcoptic.cpp
@@ -38,11 +38,6 @@ KCalendarSystemCopticPrivate::~KCalendarSystemCopticPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemCopticPrivate::calendarSystem() const
-{
- return KLocale::CopticCalendar;
-}
-
void KCalendarSystemCopticPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -414,6 +409,11 @@ QString KCalendarSystemCoptic::calendarType() const
return QLatin1String("coptic");
}
+KLocale::CalendarSystem KCalendarSystemCoptic::calendarSystem() const
+{
+ return KLocale::CopticCalendar;
+}
+
QDate KCalendarSystemCoptic::epoch() const
{
//0001-01-01, no Year 0.
diff --git a/kdecore/date/kcalendarsystemcoptic_p.h b/kdecore/date/kcalendarsystemcoptic_p.h
index f687f2f..b077800 100644
--- a/kdecore/date/kcalendarsystemcoptic_p.h
+++ b/kdecore/date/kcalendarsystemcoptic_p.h
@@ -41,6 +41,7 @@ public:
virtual ~KCalendarSystemCoptic();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemcopticprivate_p.h b/kdecore/date/kcalendarsystemcopticprivate_p.h
index d30bd6a..35907ff 100644
--- a/kdecore/date/kcalendarsystemcopticprivate_p.h
+++ b/kdecore/date/kcalendarsystemcopticprivate_p.h
@@ -30,7 +30,6 @@ public:
virtual ~KCalendarSystemCopticPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
diff --git a/kdecore/date/kcalendarsystemethiopian.cpp b/kdecore/date/kcalendarsystemethiopian.cpp
index 3495752..4074e4e 100644
--- a/kdecore/date/kcalendarsystemethiopian.cpp
+++ b/kdecore/date/kcalendarsystemethiopian.cpp
@@ -36,17 +36,11 @@ public:
virtual ~KCalendarSystemEthiopianPrivate() {
}
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual QString monthName(int month, int year, KLocale::DateTimeComponentFormat format, bool possessive) const;
virtual QString weekDayName(int weekDay, KLocale::DateTimeComponentFormat format) const;
};
-KLocale::CalendarSystem KCalendarSystemEthiopianPrivate::calendarSystem() const
-{
- return KLocale::EthiopianCalendar;
-}
-
void KCalendarSystemEthiopianPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -314,6 +308,11 @@ QString KCalendarSystemEthiopian::calendarType() const
return QLatin1String("ethiopian");
}
+KLocale::CalendarSystem KCalendarSystemEthiopian::calendarSystem() const
+{
+ return KLocale::EthiopianCalendar;
+}
+
QDate KCalendarSystemEthiopian::epoch() const
{
//0001-01-01, no Year 0.
diff --git a/kdecore/date/kcalendarsystemethiopian_p.h b/kdecore/date/kcalendarsystemethiopian_p.h
index 504fcbe..2669654 100644
--- a/kdecore/date/kcalendarsystemethiopian_p.h
+++ b/kdecore/date/kcalendarsystemethiopian_p.h
@@ -42,6 +42,7 @@ public:
virtual ~KCalendarSystemEthiopian();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemgregorian.cpp b/kdecore/date/kcalendarsystemgregorian.cpp
index 3f5ed9e..7f16d8e 100644
--- a/kdecore/date/kcalendarsystemgregorian.cpp
+++ b/kdecore/date/kcalendarsystemgregorian.cpp
@@ -41,11 +41,6 @@ KCalendarSystemGregorianPrivate::~KCalendarSystemGregorianPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemGregorianPrivate::calendarSystem() const
-{
- return KLocale::GregorianCalendar;
-}
-
// Dummy version using Gregorian as an example
// This method MUST be re-implemented in any new Calendar System
void KCalendarSystemGregorianPrivate::loadDefaultEraList()
@@ -408,6 +403,11 @@ QString KCalendarSystemGregorian::calendarType() const
return QLatin1String("gregorian-proleptic");
}
+KLocale::CalendarSystem KCalendarSystemGregorian::calendarSystem() const
+{
+ return KLocale::GregorianCalendar;
+}
+
QDate KCalendarSystemGregorian::epoch() const
{
return QDate::fromJulianDay(1721426);
diff --git a/kdecore/date/kcalendarsystemgregorian_p.h b/kdecore/date/kcalendarsystemgregorian_p.h
index 2f7b855..464ac8d 100644
--- a/kdecore/date/kcalendarsystemgregorian_p.h
+++ b/kdecore/date/kcalendarsystemgregorian_p.h
@@ -46,6 +46,7 @@ public:
virtual ~KCalendarSystemGregorian();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemgregorianprivate_p.h b/kdecore/date/kcalendarsystemgregorianprivate_p.h
index 61d6646..fb7a0dd 100644
--- a/kdecore/date/kcalendarsystemgregorianprivate_p.h
+++ b/kdecore/date/kcalendarsystemgregorianprivate_p.h
@@ -32,7 +32,6 @@ public:
virtual ~KCalendarSystemGregorianPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
diff --git a/kdecore/date/kcalendarsystemhebrew.cpp b/kdecore/date/kcalendarsystemhebrew.cpp
index ba239aa..38df98e 100644
--- a/kdecore/date/kcalendarsystemhebrew.cpp
+++ b/kdecore/date/kcalendarsystemhebrew.cpp
@@ -243,7 +243,6 @@ public:
virtual ~KCalendarSystemHebrewPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
@@ -277,11 +276,6 @@ KCalendarSystemHebrewPrivate::~KCalendarSystemHebrewPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemHebrewPrivate::calendarSystem() const
-{
- return KLocale::HebrewCalendar;
-}
-
void KCalendarSystemHebrewPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -898,6 +892,11 @@ QString KCalendarSystemHebrew::calendarType() const
return QLatin1String("hebrew");
}
+KLocale::CalendarSystem KCalendarSystemHebrew::calendarSystem() const
+{
+ return KLocale::HebrewCalendar;
+}
+
QDate KCalendarSystemHebrew::epoch() const
{
// Hebrew 0001-01-01 (Gregorian -3760-09-07, Julian -3761-10-07)
diff --git a/kdecore/date/kcalendarsystemhebrew_p.h b/kdecore/date/kcalendarsystemhebrew_p.h
index 3be9e5c..330a15d 100644
--- a/kdecore/date/kcalendarsystemhebrew_p.h
+++ b/kdecore/date/kcalendarsystemhebrew_p.h
@@ -45,6 +45,7 @@ public:
virtual ~KCalendarSystemHebrew();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemindiannational.cpp b/kdecore/date/kcalendarsystemindiannational.cpp
index 09a011b..1907d84 100644
--- a/kdecore/date/kcalendarsystemindiannational.cpp
+++ b/kdecore/date/kcalendarsystemindiannational.cpp
@@ -34,7 +34,6 @@ public:
virtual ~KCalendarSystemIndianNationalPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
@@ -62,11 +61,6 @@ KCalendarSystemIndianNationalPrivate::~KCalendarSystemIndianNationalPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemIndianNationalPrivate::calendarSystem() const
-{
- return KLocale::IndianNationalCalendar;
-}
-
void KCalendarSystemIndianNationalPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -410,6 +404,11 @@ QString KCalendarSystemIndianNational::calendarType() const
return QLatin1String("indian-national");
}
+KLocale::CalendarSystem KCalendarSystemIndianNational::calendarSystem() const
+{
+ return KLocale::IndianNationalCalendar;
+}
+
QDate KCalendarSystemIndianNational::epoch() const
{
//0000-01-01, has Year 0.
diff --git a/kdecore/date/kcalendarsystemindiannational_p.h b/kdecore/date/kcalendarsystemindiannational_p.h
index 10052fb..03f98c4 100644
--- a/kdecore/date/kcalendarsystemindiannational_p.h
+++ b/kdecore/date/kcalendarsystemindiannational_p.h
@@ -45,6 +45,7 @@ public:
virtual ~KCalendarSystemIndianNational();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemislamiccivil.cpp b/kdecore/date/kcalendarsystemislamiccivil.cpp
index 31ded2e..270e584 100644
--- a/kdecore/date/kcalendarsystemislamiccivil.cpp
+++ b/kdecore/date/kcalendarsystemislamiccivil.cpp
@@ -32,7 +32,6 @@ public:
virtual ~KCalendarSystemIslamicCivilPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
@@ -60,11 +59,6 @@ KCalendarSystemIslamicCivilPrivate::~KCalendarSystemIslamicCivilPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemIslamicCivilPrivate::calendarSystem() const
-{
- return KLocale::IslamicCivilCalendar;
-}
-
void KCalendarSystemIslamicCivilPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -415,6 +409,11 @@ QString KCalendarSystemIslamicCivil::calendarType() const
return QLatin1String("hijri");
}
+KLocale::CalendarSystem KCalendarSystemIslamicCivil::calendarSystem() const
+{
+ return KLocale::IslamicCivilCalendar;
+}
+
QDate KCalendarSystemIslamicCivil::epoch() const
{
// 16 July 622 in the Julian calendar
diff --git a/kdecore/date/kcalendarsystemislamiccivil_p.h b/kdecore/date/kcalendarsystemislamiccivil_p.h
index 434800c..59dd87b 100644
--- a/kdecore/date/kcalendarsystemislamiccivil_p.h
+++ b/kdecore/date/kcalendarsystemislamiccivil_p.h
@@ -47,6 +47,7 @@ public:
virtual ~KCalendarSystemIslamicCivil();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemjalali.cpp b/kdecore/date/kcalendarsystemjalali.cpp
index f080c6b..a866321 100644
--- a/kdecore/date/kcalendarsystemjalali.cpp
+++ b/kdecore/date/kcalendarsystemjalali.cpp
@@ -40,7 +40,6 @@ public:
virtual ~KCalendarSystemJalaliPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
@@ -68,11 +67,6 @@ KCalendarSystemJalaliPrivate::~KCalendarSystemJalaliPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemJalaliPrivate::calendarSystem() const
-{
- return KLocale::JalaliCalendar;
-}
-
void KCalendarSystemJalaliPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -421,6 +415,11 @@ QString KCalendarSystemJalali::calendarType() const
return QLatin1String("jalali");
}
+KLocale::CalendarSystem KCalendarSystemJalali::calendarSystem() const
+{
+ return KLocale::JalaliCalendar;
+}
+
QDate KCalendarSystemJalali::epoch() const
{
// 19 March 622 in the Julian calendar
diff --git a/kdecore/date/kcalendarsystemjalali_p.h b/kdecore/date/kcalendarsystemjalali_p.h
index 0fad472..0a2b8e0 100644
--- a/kdecore/date/kcalendarsystemjalali_p.h
+++ b/kdecore/date/kcalendarsystemjalali_p.h
@@ -36,6 +36,7 @@ public:
virtual ~KCalendarSystemJalali();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemjapanese.cpp b/kdecore/date/kcalendarsystemjapanese.cpp
index c3e94fe..da741e5 100644
--- a/kdecore/date/kcalendarsystemjapanese.cpp
+++ b/kdecore/date/kcalendarsystemjapanese.cpp
@@ -32,7 +32,6 @@ public:
explicit KCalendarSystemJapanesePrivate(KCalendarSystemJapanese *q);
virtual ~KCalendarSystemJapanesePrivate();
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int earliestValidYear() const;
};
@@ -48,11 +47,6 @@ KCalendarSystemJapanesePrivate::~KCalendarSystemJapanesePrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemJapanesePrivate::calendarSystem() const
-{
- return KLocale::JapaneseCalendar;
-}
-
void KCalendarSystemJapanesePrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -122,6 +116,11 @@ QString KCalendarSystemJapanese::calendarType() const
return QLatin1String("japanese");
}
+KLocale::CalendarSystem KCalendarSystemJapanese::calendarSystem() const
+{
+ return KLocale::JapaneseCalendar;
+}
+
QDate KCalendarSystemJapanese::epoch() const
{
// 0001-01-01 Gregorian for now
diff --git a/kdecore/date/kcalendarsystemjapanese_p.h b/kdecore/date/kcalendarsystemjapanese_p.h
index 5f327d9..f7f11a0 100644
--- a/kdecore/date/kcalendarsystemjapanese_p.h
+++ b/kdecore/date/kcalendarsystemjapanese_p.h
@@ -42,6 +42,7 @@ public:
virtual ~KCalendarSystemJapanese();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemjulian.cpp b/kdecore/date/kcalendarsystemjulian.cpp
index 13039b2..85b2592 100644
--- a/kdecore/date/kcalendarsystemjulian.cpp
+++ b/kdecore/date/kcalendarsystemjulian.cpp
@@ -35,7 +35,6 @@ public:
virtual ~KCalendarSystemJulianPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
@@ -65,11 +64,6 @@ KCalendarSystemJulianPrivate::~KCalendarSystemJulianPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemJulianPrivate::calendarSystem() const
-{
- return KLocale::JulianCalendar;
-}
-
void KCalendarSystemJulianPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -423,6 +417,11 @@ QString KCalendarSystemJulian::calendarType() const
return QLatin1String("julian");
}
+KLocale::CalendarSystem KCalendarSystemJulian::calendarSystem() const
+{
+ return KLocale::JulianCalendar;
+}
+
QDate KCalendarSystemJulian::epoch() const
{
return QDate::fromJulianDay(1721426);
diff --git a/kdecore/date/kcalendarsystemjulian_p.h b/kdecore/date/kcalendarsystemjulian_p.h
index 0beea20..30c8672 100644
--- a/kdecore/date/kcalendarsystemjulian_p.h
+++ b/kdecore/date/kcalendarsystemjulian_p.h
@@ -45,6 +45,7 @@ public:
virtual ~KCalendarSystemJulian();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemminguo.cpp b/kdecore/date/kcalendarsystemminguo.cpp
index 0cffc91..fbb19e8 100644
--- a/kdecore/date/kcalendarsystemminguo.cpp
+++ b/kdecore/date/kcalendarsystemminguo.cpp
@@ -32,7 +32,6 @@ public:
explicit KCalendarSystemMinguoPrivate(KCalendarSystemMinguo *q);
virtual ~KCalendarSystemMinguoPrivate();
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual bool isLeapYear(int year) const;
virtual int earliestValidYear() const;
@@ -49,11 +48,6 @@ KCalendarSystemMinguoPrivate::~KCalendarSystemMinguoPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemMinguoPrivate::calendarSystem() const
-{
- return KLocale::MinguoCalendar;
-}
-
void KCalendarSystemMinguoPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -97,6 +91,11 @@ QString KCalendarSystemMinguo::calendarType() const
return QLatin1String("minguo");
}
+KLocale::CalendarSystem KCalendarSystemMinguo::calendarSystem() const
+{
+ return KLocale::MinguoCalendar;
+}
+
QDate KCalendarSystemMinguo::epoch() const
{
// 0001-01-01 = 1912-01-01 AD Gregorian
diff --git a/kdecore/date/kcalendarsystemminguo_p.h b/kdecore/date/kcalendarsystemminguo_p.h
index d119d8b..20c567e 100644
--- a/kdecore/date/kcalendarsystemminguo_p.h
+++ b/kdecore/date/kcalendarsystemminguo_p.h
@@ -42,6 +42,7 @@ public:
virtual ~KCalendarSystemMinguo();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemprivate_p.h b/kdecore/date/kcalendarsystemprivate_p.h
index 2cda27d..d935ead 100644
--- a/kdecore/date/kcalendarsystemprivate_p.h
+++ b/kdecore/date/kcalendarsystemprivate_p.h
@@ -36,7 +36,6 @@ public:
virtual ~KCalendarSystemPrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const = 0;
virtual void loadDefaultEraList() = 0;
virtual int monthsInYear(int year) const = 0;
virtual int daysInMonth(int year, int month) const = 0;
diff --git a/kdecore/date/kcalendarsystemqdate.cpp b/kdecore/date/kcalendarsystemqdate.cpp
index 6a82e59..79a8114 100644
--- a/kdecore/date/kcalendarsystemqdate.cpp
+++ b/kdecore/date/kcalendarsystemqdate.cpp
@@ -40,7 +40,6 @@ public:
virtual ~KCalendarSystemQDatePrivate();
// Virtual methods each calendar system must re-implement
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual int monthsInYear(int year) const;
virtual int daysInMonth(int year, int month) const;
@@ -72,11 +71,6 @@ KCalendarSystemQDatePrivate::~KCalendarSystemQDatePrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemQDatePrivate::calendarSystem() const
-{
- return KLocale::QDateCalendar;
-}
-
void KCalendarSystemQDatePrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -408,6 +402,11 @@ QString KCalendarSystemQDate::calendarType() const
return QLatin1String("gregorian");
}
+KLocale::CalendarSystem KCalendarSystemQDate::calendarSystem() const
+{
+ return KLocale::QDateCalendar;
+}
+
QDate KCalendarSystemQDate::epoch() const
{
// 1 Jan 1 AD in Julian
diff --git a/kdecore/date/kcalendarsystemqdate_p.h b/kdecore/date/kcalendarsystemqdate_p.h
index f9aecc5..7582b85 100644
--- a/kdecore/date/kcalendarsystemqdate_p.h
+++ b/kdecore/date/kcalendarsystemqdate_p.h
@@ -45,6 +45,7 @@ public:
virtual ~KCalendarSystemQDate();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
diff --git a/kdecore/date/kcalendarsystemthai.cpp b/kdecore/date/kcalendarsystemthai.cpp
index 7aef482..c14aacb 100644
--- a/kdecore/date/kcalendarsystemthai.cpp
+++ b/kdecore/date/kcalendarsystemthai.cpp
@@ -32,7 +32,6 @@ public:
explicit KCalendarSystemThaiPrivate(KCalendarSystemThai *q);
virtual ~KCalendarSystemThaiPrivate();
- virtual KLocale::CalendarSystem calendarSystem() const;
virtual void loadDefaultEraList();
virtual bool isLeapYear(int year) const;
virtual bool hasYearZero() const;
@@ -50,11 +49,6 @@ KCalendarSystemThaiPrivate::~KCalendarSystemThaiPrivate()
{
}
-KLocale::CalendarSystem KCalendarSystemThaiPrivate::calendarSystem() const
-{
- return KLocale::ThaiCalendar;
-}
-
void KCalendarSystemThaiPrivate::loadDefaultEraList()
{
QString name, shortName, format;
@@ -103,6 +97,11 @@ QString KCalendarSystemThai::calendarType() const
return QLatin1String("thai");
}
+KLocale::CalendarSystem KCalendarSystemThai::calendarSystem() const
+{
+ return KLocale::ThaiCalendar;
+}
+
QDate KCalendarSystemThai::epoch() const
{
// 0000-01-01 = 0544-01-01 BC Gregorian = 0544-01-07 BC Julian
diff --git a/kdecore/date/kcalendarsystemthai_p.h b/kdecore/date/kcalendarsystemthai_p.h
index df0eb55..3e1eb31 100644
--- a/kdecore/date/kcalendarsystemthai_p.h
+++ b/kdecore/date/kcalendarsystemthai_p.h
@@ -42,6 +42,7 @@ public:
virtual ~KCalendarSystemThai();
virtual QString calendarType() const;
+ virtual KLocale::CalendarSystem calendarSystem() const;
virtual QDate epoch() const;
virtual QDate earliestValidDate() const;
--
1.7.10.4
More information about the Kde-frameworks-devel
mailing list