author | alwin <alwin> | 2005-03-16 16:09:14 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-16 16:09:14 (UTC) |
commit | d16a2a4e0617f21cba0e399dbe5ffa17d76886b9 (patch) (unidiff) | |
tree | 10e32b2cd5ed35feaf0a3647d2c3bd5dfa6e938f /core/pim/datebook/holiday/christian | |
parent | 829995787660e9786269c4cd4e2626825472e9cd (diff) | |
download | opie-d16a2a4e0617f21cba0e399dbe5ffa17d76886b9.zip opie-d16a2a4e0617f21cba0e399dbe5ffa17d76886b9.tar.gz opie-d16a2a4e0617f21cba0e399dbe5ffa17d76886b9.tar.bz2 |
corrected some stuff
Diffstat (limited to 'core/pim/datebook/holiday/christian') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/holiday/christian/chrisholiday.cpp | 8 | ||||
-rw-r--r-- | core/pim/datebook/holiday/christian/chrisholiday.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/core/pim/datebook/holiday/christian/chrisholiday.cpp b/core/pim/datebook/holiday/christian/chrisholiday.cpp index 6ef102a..3427b73 100644 --- a/core/pim/datebook/holiday/christian/chrisholiday.cpp +++ b/core/pim/datebook/holiday/christian/chrisholiday.cpp | |||
@@ -64,24 +64,32 @@ void ChrisHoliday::calc_easter() | |||
64 | unsigned long i = c/4; | 64 | unsigned long i = c/4; |
65 | unsigned long j = c%4; | 65 | unsigned long j = c%4; |
66 | unsigned long k = j%100; | 66 | unsigned long k = j%100; |
67 | unsigned long l = (32+2*e+2*i-h-k)%7; | 67 | unsigned long l = (32+2*e+2*i-h-k)%7; |
68 | unsigned long m = (a+11*h+22*l)/451; | 68 | unsigned long m = (a+11*h+22*l)/451; |
69 | n = (h+l-7*m+114)/31; | 69 | n = (h+l-7*m+114)/31; |
70 | p = (h+l-7*m+114)%31; | 70 | p = (h+l-7*m+114)%31; |
71 | } else { | 71 | } else { |
72 | unsigned long a = _lastyear%4; | 72 | unsigned long a = _lastyear%4; |
73 | unsigned long b = _lastyear%7; | 73 | unsigned long b = _lastyear%7; |
74 | unsigned long c = _lastyear%19; | 74 | unsigned long c = _lastyear%19; |
75 | unsigned long d = (19*c+15)%30; | 75 | unsigned long d = (19*c+15)%30; |
76 | unsigned long e = (2*a+4*b-d+34)%7; | 76 | unsigned long e = (2*a+4*b-d+34)%7; |
77 | n = (d+e+114)/31; | 77 | n = (d+e+114)/31; |
78 | p = (d+e+114)%31; | 78 | p = (d+e+114)%31; |
79 | } | 79 | } |
80 | p++; | 80 | p++; |
81 | QDate d(_lastyear,n,p); | 81 | QDate d(_lastyear,n,p); |
82 | _days[d].append(QObject::tr("Eastersunday","holidays")); | 82 | _days[d].append(QObject::tr("Eastersunday","holidays")); |
83 | _days[d.addDays(49)].append(QObject::tr("Whitsunday","holidays")); | 83 | _days[d.addDays(49)].append(QObject::tr("Whitsunday","holidays")); |
84 | _days[d.addDays(50)].append(QObject::tr("Whitmonday","holidays")); | 84 | _days[d.addDays(50)].append(QObject::tr("Whitmonday","holidays")); |
85 | _days[d.addDays(-46)].append(QObject::tr("Ash Wednesday","holidays")); | 85 | _days[d.addDays(-46)].append(QObject::tr("Ash Wednesday","holidays")); |
86 | _days[d.addDays(60)].append(QObject::tr("Corpus Christi","holidays")); | 86 | _days[d.addDays(60)].append(QObject::tr("Corpus Christi","holidays")); |
87 | } | 87 | } |
88 | |||
89 | QMap<QDate,QStringList> ChrisHoliday::entries(const QDate&,const QDate&) | ||
90 | { | ||
91 | QMap<QDate,QStringList> ret; | ||
92 | return ret; | ||
93 | } | ||
94 | |||
95 | EXPORT_HOLIDAY_PLUGIN(ChrisHoliday); \ No newline at end of file | ||
diff --git a/core/pim/datebook/holiday/christian/chrisholiday.h b/core/pim/datebook/holiday/christian/chrisholiday.h index 5f43e85..8dcf4c6 100644 --- a/core/pim/datebook/holiday/christian/chrisholiday.h +++ b/core/pim/datebook/holiday/christian/chrisholiday.h | |||
@@ -1,33 +1,33 @@ | |||
1 | #ifndef __DUMMY_HOLIDAY_H | 1 | #ifndef __DUMMY_HOLIDAY_H |
2 | #define __DUMMY_HOLIDAY_H | 2 | #define __DUMMY_HOLIDAY_H |
3 | 3 | ||
4 | #include "hlist.h" | 4 | #include "hlist.h" |
5 | 5 | ||
6 | #include <opie2/oholidayplugin.h> | 6 | #include <opie2/oholidayplugin.h> |
7 | #include <opie2/oholidaypluginif.h> | 7 | #include <opie2/oholidaypluginif.h> |
8 | 8 | ||
9 | #include <qmap.h> | 9 | #include <qmap.h> |
10 | 10 | ||
11 | class ChrisHoliday:public Opie::Datebook::HolidayPlugin | 11 | class ChrisHoliday:public Opie::Datebook::HolidayPlugin |
12 | { | 12 | { |
13 | typedef QMap<QDate,QStringList> tDayMap; | 13 | typedef QMap<QDate,QStringList> tDayMap; |
14 | 14 | ||
15 | public: | 15 | public: |
16 | ChrisHoliday():Opie::Datebook::HolidayPlugin(){_lastyear=0;} | 16 | ChrisHoliday():Opie::Datebook::HolidayPlugin(){_lastyear=0;} |
17 | virtual ~ChrisHoliday(){} | 17 | virtual ~ChrisHoliday(){} |
18 | 18 | ||
19 | virtual QString description(); | 19 | virtual QString description(); |
20 | virtual QStringList entries(const QDate&); | 20 | virtual QStringList entries(const QDate&); |
21 | virtual QStringList entries(unsigned year, unsigned month, unsigned day); | 21 | virtual QStringList entries(unsigned year, unsigned month, unsigned day); |
22 | virtual QMap<QDate,QStringList> entries(const QDate&,const QDate&); | ||
22 | protected: | 23 | protected: |
23 | HList _internallist; | 24 | HList _internallist; |
24 | unsigned int _lastyear; | 25 | unsigned int _lastyear; |
25 | tDayMap _days; | 26 | tDayMap _days; |
26 | 27 | ||
27 | void calcit(int year); | 28 | void calcit(int year); |
28 | void calc_easter(); | 29 | void calc_easter(); |
29 | void calc_christmas(); | 30 | void calc_christmas(); |
30 | }; | 31 | }; |
31 | 32 | ||
32 | EXPORT_HOLIDAY_PLUGIN(ChrisHoliday); | ||
33 | #endif | 33 | #endif |