[PATCH 11/23] kcalendarsystem: Update internal api to use quint64 for julian days, in order to match Qt5 QDate.
Jon Severinsson
jon at severinsson.net
Fri Oct 12 15:13:46 UTC 2012
---
kdecore/date/kcalendarsystem.cpp | 15 ++++++++-------
kdecore/date/kcalendarsystem.h | 4 ++--
kdecore/date/kcalendarsystemcoptic.cpp | 4 ++--
kdecore/date/kcalendarsystemcoptic_p.h | 4 ++--
kdecore/date/kcalendarsystemethiopian.cpp | 4 ++--
kdecore/date/kcalendarsystemethiopian_p.h | 4 ++--
kdecore/date/kcalendarsystemgregorian.cpp | 4 ++--
kdecore/date/kcalendarsystemgregorian_p.h | 4 ++--
kdecore/date/kcalendarsystemhebrew.cpp | 4 ++--
kdecore/date/kcalendarsystemhebrew_p.h | 4 ++--
kdecore/date/kcalendarsystemindiannational.cpp | 4 ++--
kdecore/date/kcalendarsystemindiannational_p.h | 4 ++--
kdecore/date/kcalendarsystemislamiccivil.cpp | 6 +++---
kdecore/date/kcalendarsystemislamiccivil_p.h | 4 ++--
kdecore/date/kcalendarsystemjalali.cpp | 8 ++++----
kdecore/date/kcalendarsystemjalali_p.h | 4 ++--
kdecore/date/kcalendarsystemjapanese.cpp | 4 ++--
kdecore/date/kcalendarsystemjapanese_p.h | 4 ++--
kdecore/date/kcalendarsystemjulian.cpp | 4 ++--
kdecore/date/kcalendarsystemjulian_p.h | 4 ++--
kdecore/date/kcalendarsystemminguo.cpp | 4 ++--
kdecore/date/kcalendarsystemminguo_p.h | 4 ++--
kdecore/date/kcalendarsystemqdate.cpp | 4 ++--
kdecore/date/kcalendarsystemqdate_p.h | 4 ++--
kdecore/date/kcalendarsystemthai.cpp | 4 ++--
kdecore/date/kcalendarsystemthai_p.h | 4 ++--
26 filer ändrade, 61 tillägg(+), 60 borttagningar(-)
diff --git a/kdecore/date/kcalendarsystem.cpp b/kdecore/date/kcalendarsystem.cpp
index afc2a18..5995e82 100644
--- a/kdecore/date/kcalendarsystem.cpp
+++ b/kdecore/date/kcalendarsystem.cpp
@@ -591,7 +591,8 @@ QString KCalendarSystemPrivate::simpleDateString(const QString &str) const
int KCalendarSystemPrivate::dayOfYear(const QDate &date) const
{
- int y, m, d, jdFirstDayOfYear;
+ qint64 jdFirstDayOfYear;
+ int y, m, d;
q->julianDayToDate(date.toJulianDay(), y, m, d);
q->dateToJulianDay(y, 1, 1, jdFirstDayOfYear);
//Take the jd of the given date, and subtract the jd of the first day of that year
@@ -609,14 +610,14 @@ int KCalendarSystemPrivate::dayOfWeek(const QDate &date) const
QDate KCalendarSystemPrivate::firstDayOfYear(int year) const
{
- int jd;
+ qint64 jd;
q->dateToJulianDay(year, 1, 1, jd);
return QDate::fromJulianDay(jd);
}
QDate KCalendarSystemPrivate::lastDayOfYear(int year) const
{
- int jd;
+ qint64 jd;
q->dateToJulianDay(year, 1, 1, jd);
jd = jd + daysInYear(year) - 1;
return QDate::fromJulianDay(jd);
@@ -624,14 +625,14 @@ QDate KCalendarSystemPrivate::lastDayOfYear(int year) const
QDate KCalendarSystemPrivate::firstDayOfMonth(int year, int month) const
{
- int jd;
+ qint64 jd;
q->dateToJulianDay(year, month, 1, jd);
return QDate::fromJulianDay(jd);
}
QDate KCalendarSystemPrivate::lastDayOfMonth(int year, int month) const
{
- int jd;
+ qint64 jd;
q->dateToJulianDay(year, month, 1, jd);
jd = jd + daysInMonth(year, month) - 1;
return QDate::fromJulianDay(jd);
@@ -921,7 +922,7 @@ bool KCalendarSystem::setDate(QDate &date, int year, int month, int day) const
date = QDate();
if (isValid(year, month, day)) {
- int jd;
+ qint64 jd;
dateToJulianDay(year, month, day, jd);
QDate calcDate = QDate::fromJulianDay(jd);
@@ -940,7 +941,7 @@ bool KCalendarSystem::setDate(QDate &date, int year, int dayOfYear) const
date = QDate();
if (isValid(year, dayOfYear)) {
- int jd;
+ qint64 jd;
dateToJulianDay(year, 1, 1, jd);
QDate calcDate = QDate::fromJulianDay(jd + dayOfYear - 1);
if (isValid(calcDate)) {
diff --git a/kdecore/date/kcalendarsystem.h b/kdecore/date/kcalendarsystem.h
index 7987f35..6e80636 100644
--- a/kdecore/date/kcalendarsystem.h
+++ b/kdecore/date/kcalendarsystem.h
@@ -1465,7 +1465,7 @@ protected:
* @param day day of month returned in this variable
* @return @c true if the date is valid, @c false otherwise
*/
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const = 0;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const = 0;
/**
* Internal method to convert YMD values for this calendar system into a
@@ -1483,7 +1483,7 @@ protected:
* @param jd Julian day number returned in this variable
* @return @c true if the date is valid, @c false otherwise
*/
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const = 0;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const = 0;
/**
* Returns the locale used for translations and formats for this
diff --git a/kdecore/date/kcalendarsystemcoptic.cpp b/kdecore/date/kcalendarsystemcoptic.cpp
index 7f57b76..f664d1e 100644
--- a/kdecore/date/kcalendarsystemcoptic.cpp
+++ b/kdecore/date/kcalendarsystemcoptic.cpp
@@ -497,7 +497,7 @@ bool KCalendarSystemCoptic::isProleptic() const
return false;
}
-bool KCalendarSystemCoptic::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemCoptic::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
//The Coptic calendar has 12 months of 30 days, a 13th month of 5 or 6 days,
//and a leap year every 4th year without fail that falls on the last day of
@@ -533,7 +533,7 @@ bool KCalendarSystemCoptic::julianDayToDate(int jd, int &year, int &month, int &
return true;
}
-bool KCalendarSystemCoptic::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemCoptic::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
//The Coptic calendar has 12 months of 30 days, a 13th month of 5 or 6 days,
//and a leap year every 4th year without fail that falls on the last day of
diff --git a/kdecore/date/kcalendarsystemcoptic_p.h b/kdecore/date/kcalendarsystemcoptic_p.h
index 575a3d5..f687f2f 100644
--- a/kdecore/date/kcalendarsystemcoptic_p.h
+++ b/kdecore/date/kcalendarsystemcoptic_p.h
@@ -63,8 +63,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemCoptic(KCalendarSystemCopticPrivate &dd, const KSharedConfig::Ptr, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemethiopian.cpp b/kdecore/date/kcalendarsystemethiopian.cpp
index 03ac1d3..3495752 100644
--- a/kdecore/date/kcalendarsystemethiopian.cpp
+++ b/kdecore/date/kcalendarsystemethiopian.cpp
@@ -396,12 +396,12 @@ bool KCalendarSystemEthiopian::isProleptic() const
return false;
}
-bool KCalendarSystemEthiopian::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemEthiopian::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
return KCalendarSystemCoptic::julianDayToDate(jd, year, month, day);
}
-bool KCalendarSystemEthiopian::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemEthiopian::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
return KCalendarSystemCoptic::dateToJulianDay(year, month, day, jd);
}
diff --git a/kdecore/date/kcalendarsystemethiopian_p.h b/kdecore/date/kcalendarsystemethiopian_p.h
index 16f5b10..504fcbe 100644
--- a/kdecore/date/kcalendarsystemethiopian_p.h
+++ b/kdecore/date/kcalendarsystemethiopian_p.h
@@ -64,8 +64,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemEthiopian(KCalendarSystemEthiopianPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemgregorian.cpp b/kdecore/date/kcalendarsystemgregorian.cpp
index 481be1b..3f5ed9e 100644
--- a/kdecore/date/kcalendarsystemgregorian.cpp
+++ b/kdecore/date/kcalendarsystemgregorian.cpp
@@ -492,7 +492,7 @@ bool KCalendarSystemGregorian::isProleptic() const
return true;
}
-bool KCalendarSystemGregorian::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemGregorian::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
Q_D(const KCalendarSystemGregorian);
@@ -520,7 +520,7 @@ bool KCalendarSystemGregorian::julianDayToDate(int jd, int &year, int &month, in
return true;
}
-bool KCalendarSystemGregorian::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemGregorian::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
Q_D(const KCalendarSystemGregorian);
diff --git a/kdecore/date/kcalendarsystemgregorian_p.h b/kdecore/date/kcalendarsystemgregorian_p.h
index d11e774..2f7b855 100644
--- a/kdecore/date/kcalendarsystemgregorian_p.h
+++ b/kdecore/date/kcalendarsystemgregorian_p.h
@@ -70,8 +70,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemGregorian(KCalendarSystemGregorianPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemhebrew.cpp b/kdecore/date/kcalendarsystemhebrew.cpp
index 3646e7f..ba239aa 100644
--- a/kdecore/date/kcalendarsystemhebrew.cpp
+++ b/kdecore/date/kcalendarsystemhebrew.cpp
@@ -1006,7 +1006,7 @@ bool KCalendarSystemHebrew::isProleptic() const
return false;
}
-bool KCalendarSystemHebrew::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemHebrew::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
class h_date * sd = toHebrew(QDate::fromJulianDay(jd));
@@ -1028,7 +1028,7 @@ bool KCalendarSystemHebrew::julianDayToDate(int jd, int &year, int &month, int &
return true;
}
-bool KCalendarSystemHebrew::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemHebrew::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
class h_date * gd = hebrewToGregorian(year, month, day);
diff --git a/kdecore/date/kcalendarsystemhebrew_p.h b/kdecore/date/kcalendarsystemhebrew_p.h
index 965ca94..3be9e5c 100644
--- a/kdecore/date/kcalendarsystemhebrew_p.h
+++ b/kdecore/date/kcalendarsystemhebrew_p.h
@@ -71,8 +71,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 js, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemHebrew(KCalendarSystemHebrewPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemindiannational.cpp b/kdecore/date/kcalendarsystemindiannational.cpp
index 20eee48..09a011b 100644
--- a/kdecore/date/kcalendarsystemindiannational.cpp
+++ b/kdecore/date/kcalendarsystemindiannational.cpp
@@ -493,7 +493,7 @@ bool KCalendarSystemIndianNational::isProleptic() const
return false;
}
-bool KCalendarSystemIndianNational::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemIndianNational::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
int L, N, I, J, D, M, Y;
@@ -517,7 +517,7 @@ bool KCalendarSystemIndianNational::julianDayToDate(int jd, int &year, int &mont
return true;
}
-bool KCalendarSystemIndianNational::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemIndianNational::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
int Y = year;
int M = month;
diff --git a/kdecore/date/kcalendarsystemindiannational_p.h b/kdecore/date/kcalendarsystemindiannational_p.h
index d4549a7..10052fb 100644
--- a/kdecore/date/kcalendarsystemindiannational_p.h
+++ b/kdecore/date/kcalendarsystemindiannational_p.h
@@ -67,8 +67,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemIndianNational(KCalendarSystemIndianNationalPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemislamiccivil.cpp b/kdecore/date/kcalendarsystemislamiccivil.cpp
index 816aabc..31ded2e 100644
--- a/kdecore/date/kcalendarsystemislamiccivil.cpp
+++ b/kdecore/date/kcalendarsystemislamiccivil.cpp
@@ -493,7 +493,7 @@ bool KCalendarSystemIslamicCivil::isProleptic() const
return false;
}
-bool KCalendarSystemIslamicCivil::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemIslamicCivil::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
Q_D(const KCalendarSystemIslamicCivil);
@@ -509,7 +509,7 @@ bool KCalendarSystemIslamicCivil::julianDayToDate(int jd, int &year, int &month,
// Search forward year by year from approximate year
year = (jd - epoch().toJulianDay()) / 355;
- int testJd;
+ qint64 testJd;
dateToJulianDay(year, 12, d->daysInMonth(year, 12), testJd);
while (jd > testJd) {
year++;
@@ -555,7 +555,7 @@ bool KCalendarSystemIslamicCivil::julianDayToDate(int jd, int &year, int &month,
*/
}
-bool KCalendarSystemIslamicCivil::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemIslamicCivil::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
/*
The following C++ code is translated from the Lisp code
diff --git a/kdecore/date/kcalendarsystemislamiccivil_p.h b/kdecore/date/kcalendarsystemislamiccivil_p.h
index 343072b..434800c 100644
--- a/kdecore/date/kcalendarsystemislamiccivil_p.h
+++ b/kdecore/date/kcalendarsystemislamiccivil_p.h
@@ -69,8 +69,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemIslamicCivil(KCalendarSystemIslamicCivilPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemjalali.cpp b/kdecore/date/kcalendarsystemjalali.cpp
index 3fc9526..f080c6b 100644
--- a/kdecore/date/kcalendarsystemjalali.cpp
+++ b/kdecore/date/kcalendarsystemjalali.cpp
@@ -501,7 +501,7 @@ bool KCalendarSystemJalali::isProleptic() const
return false;
}
-bool KCalendarSystemJalali::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemJalali::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
// Birashk algorithm is incorrect in two years in period AP 1244 to 1531.
// This results in a leap day being added to the end of 1404 instead of 1403
@@ -524,7 +524,7 @@ bool KCalendarSystemJalali::julianDayToDate(int jd, int &year, int &month, int &
// From original KDE3 code, source unknown? Unable to contact author or committer to confirm
// Matches Fermilab code, EMACS and D&R so check for PD source, likely Birashk's book
- int jdCycleStart;
+ qint64 jdCycleStart;
int daysSinceCycleStart;
int cycle;
int dayInCycle;
@@ -545,7 +545,7 @@ bool KCalendarSystemJalali::julianDayToDate(int jd, int &year, int &month, int &
year = year - 1;
}
- int firstDayOfYear;
+ qint64 firstDayOfYear;
dateToJulianDay(year, 1, 1, firstDayOfYear);
int dayinYear = jd - firstDayOfYear + 1;
if (dayinYear <= 186) {
@@ -559,7 +559,7 @@ bool KCalendarSystemJalali::julianDayToDate(int jd, int &year, int &month, int &
return true;
}
-bool KCalendarSystemJalali::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemJalali::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
Q_D(const KCalendarSystemJalali);
diff --git a/kdecore/date/kcalendarsystemjalali_p.h b/kdecore/date/kcalendarsystemjalali_p.h
index c9e2ce2..0fad472 100644
--- a/kdecore/date/kcalendarsystemjalali_p.h
+++ b/kdecore/date/kcalendarsystemjalali_p.h
@@ -58,8 +58,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemJalali(KCalendarSystemJalaliPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemjapanese.cpp b/kdecore/date/kcalendarsystemjapanese.cpp
index 2562894..c3e94fe 100644
--- a/kdecore/date/kcalendarsystemjapanese.cpp
+++ b/kdecore/date/kcalendarsystemjapanese.cpp
@@ -212,12 +212,12 @@ bool KCalendarSystemJapanese::isProleptic() const
return false;
}
-bool KCalendarSystemJapanese::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemJapanese::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
return KCalendarSystemGregorian::julianDayToDate(jd, year, month, day);
}
-bool KCalendarSystemJapanese::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemJapanese::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
return KCalendarSystemGregorian::dateToJulianDay(year, month, day, jd);
}
diff --git a/kdecore/date/kcalendarsystemjapanese_p.h b/kdecore/date/kcalendarsystemjapanese_p.h
index 1970936..5f327d9 100644
--- a/kdecore/date/kcalendarsystemjapanese_p.h
+++ b/kdecore/date/kcalendarsystemjapanese_p.h
@@ -66,8 +66,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemJapanese(KCalendarSystemJapanesePrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemjulian.cpp b/kdecore/date/kcalendarsystemjulian.cpp
index 1d7abc6..13039b2 100644
--- a/kdecore/date/kcalendarsystemjulian.cpp
+++ b/kdecore/date/kcalendarsystemjulian.cpp
@@ -502,7 +502,7 @@ bool KCalendarSystemJulian::isProleptic() const
return true;
}
-bool KCalendarSystemJulian::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemJulian::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
// Formula from The Calendar FAQ by Claus Tondering
// http://www.tondering.dk/claus/cal/node3.html#SECTION003161000000000000000
@@ -527,7 +527,7 @@ bool KCalendarSystemJulian::julianDayToDate(int jd, int &year, int &month, int &
return true;
}
-bool KCalendarSystemJulian::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemJulian::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
// Formula from The Calendar FAQ by Claus Tondering
// http://www.tondering.dk/claus/cal/node3.html#SECTION003161000000000000000
diff --git a/kdecore/date/kcalendarsystemjulian_p.h b/kdecore/date/kcalendarsystemjulian_p.h
index 4916697..0beea20 100644
--- a/kdecore/date/kcalendarsystemjulian_p.h
+++ b/kdecore/date/kcalendarsystemjulian_p.h
@@ -67,8 +67,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemJulian(KCalendarSystemJulianPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemminguo.cpp b/kdecore/date/kcalendarsystemminguo.cpp
index 55ea124..0cffc91 100644
--- a/kdecore/date/kcalendarsystemminguo.cpp
+++ b/kdecore/date/kcalendarsystemminguo.cpp
@@ -175,14 +175,14 @@ bool KCalendarSystemMinguo::isProleptic() const
return false;
}
-bool KCalendarSystemMinguo::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemMinguo::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
bool result = KCalendarSystemGregorian::julianDayToDate(jd, year, month, day);
year = year - 1911;
return result;
}
-bool KCalendarSystemMinguo::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemMinguo::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
return KCalendarSystemGregorian::dateToJulianDay(year + 1911, month, day, jd);
}
diff --git a/kdecore/date/kcalendarsystemminguo_p.h b/kdecore/date/kcalendarsystemminguo_p.h
index c41c0d6..d119d8b 100644
--- a/kdecore/date/kcalendarsystemminguo_p.h
+++ b/kdecore/date/kcalendarsystemminguo_p.h
@@ -64,8 +64,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemMinguo(KCalendarSystemMinguoPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemqdate.cpp b/kdecore/date/kcalendarsystemqdate.cpp
index dbb0a91..6a82e59 100644
--- a/kdecore/date/kcalendarsystemqdate.cpp
+++ b/kdecore/date/kcalendarsystemqdate.cpp
@@ -529,7 +529,7 @@ bool KCalendarSystemQDate::isProleptic() const
return false;
}
-bool KCalendarSystemQDate::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemQDate::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
QDate date = QDate::fromJulianDay(jd);
@@ -538,7 +538,7 @@ bool KCalendarSystemQDate::julianDayToDate(int jd, int &year, int &month, int &d
return date.isValid();
}
-bool KCalendarSystemQDate::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemQDate::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
QDate date;
diff --git a/kdecore/date/kcalendarsystemqdate_p.h b/kdecore/date/kcalendarsystemqdate_p.h
index 626f14d..f9aecc5 100644
--- a/kdecore/date/kcalendarsystemqdate_p.h
+++ b/kdecore/date/kcalendarsystemqdate_p.h
@@ -77,8 +77,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemQDate(KCalendarSystemQDatePrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
diff --git a/kdecore/date/kcalendarsystemthai.cpp b/kdecore/date/kcalendarsystemthai.cpp
index 45b0d8b..7aef482 100644
--- a/kdecore/date/kcalendarsystemthai.cpp
+++ b/kdecore/date/kcalendarsystemthai.cpp
@@ -161,14 +161,14 @@ bool KCalendarSystemThai::isProleptic() const
return false;
}
-bool KCalendarSystemThai::julianDayToDate(int jd, int &year, int &month, int &day) const
+bool KCalendarSystemThai::julianDayToDate(qint64 jd, int &year, int &month, int &day) const
{
bool result = KCalendarSystemGregorian::julianDayToDate(jd, year, month, day);
year = year + 543;
return result;
}
-bool KCalendarSystemThai::dateToJulianDay(int year, int month, int day, int &jd) const
+bool KCalendarSystemThai::dateToJulianDay(int year, int month, int day, qint64 &jd) const
{
return KCalendarSystemGregorian::dateToJulianDay(year - 543, month, day, jd);
}
diff --git a/kdecore/date/kcalendarsystemthai_p.h b/kdecore/date/kcalendarsystemthai_p.h
index 7c0f9d8..df0eb55 100644
--- a/kdecore/date/kcalendarsystemthai_p.h
+++ b/kdecore/date/kcalendarsystemthai_p.h
@@ -58,8 +58,8 @@ public:
virtual bool isProleptic() const;
protected:
- virtual bool julianDayToDate(int jd, int &year, int &month, int &day) const;
- virtual bool dateToJulianDay(int year, int month, int day, int &jd) const;
+ virtual bool julianDayToDate(qint64 jd, int &year, int &month, int &day) const;
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 &jd) const;
KCalendarSystemThai(KCalendarSystemThaiPrivate &dd, const KSharedConfig::Ptr config, const KLocale *locale);
private:
--
1.7.10.4
More information about the Kde-frameworks-devel
mailing list