-rw-r--r-- | libopie2/opiepim/core/opimevent.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp index c656c3d..7bc6c32 100644 --- a/libopie2/opiepim/core/opimevent.cpp +++ b/libopie2/opiepim/core/opimevent.cpp | |||
@@ -25,97 +25,97 @@ | |||
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "opimevent.h" | 30 | #include "opimevent.h" |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimrecurrence.h> | 33 | #include <opie2/opimrecurrence.h> |
34 | #include <opie2/opimresolver.h> | 34 | #include <opie2/opimresolver.h> |
35 | #include <opie2/opimnotifymanager.h> | 35 | #include <opie2/opimnotifymanager.h> |
36 | #include <opie2/odebug.h> | 36 | #include <opie2/odebug.h> |
37 | 37 | ||
38 | #include <qpe/categories.h> | 38 | #include <qpe/categories.h> |
39 | #include <qpe/stringutil.h> | 39 | #include <qpe/stringutil.h> |
40 | 40 | ||
41 | /* QT */ | 41 | /* QT */ |
42 | 42 | ||
43 | namespace Opie | 43 | namespace Opie |
44 | { | 44 | { |
45 | 45 | ||
46 | int OCalendarHelper::week( const QDate& date ) | 46 | int OCalendarHelper::week( const QDate& date ) |
47 | { | 47 | { |
48 | // Calculates the week this date is in within that | 48 | // Calculates the week this date is in within that |
49 | // month. Equals the "row" is is in in the month view | 49 | // month. Equals the "row" is is in in the month view |
50 | int week = 1; | 50 | int week = 1; |
51 | QDate tmp( date.year(), date.month(), 1 ); | 51 | QDate tmp( date.year(), date.month(), 1 ); |
52 | if ( date.dayOfWeek() < tmp.dayOfWeek() ) | 52 | if ( date.dayOfWeek() < tmp.dayOfWeek() ) |
53 | ++week; | 53 | ++week; |
54 | 54 | ||
55 | week += ( date.day() - 1 ) / 7; | 55 | week += ( date.day() - 1 ) / 7; |
56 | 56 | ||
57 | return week; | 57 | return week; |
58 | } | 58 | } |
59 | 59 | ||
60 | 60 | ||
61 | int OCalendarHelper::ocurrence( const QDate& date ) | 61 | int OCalendarHelper::ocurrence( const QDate& date ) |
62 | { | 62 | { |
63 | // calculates the number of occurrances of this day of the | 63 | // calculates the number of occurrances of this day of the |
64 | // week till the given date (e.g 3rd Wednesday of the month) | 64 | // week till the given date (e.g 3rd Wednesday of the month) |
65 | return ( date.day() - 1 ) / 7 + 1; | 65 | return ( date.day() - 1 ) / 7 + 1; |
66 | } | 66 | } |
67 | 67 | ||
68 | 68 | ||
69 | int OCalendarHelper::dayOfWeek( char day ) | 69 | int OCalendarHelper::dayOfWeek( char day ) |
70 | { | 70 | { |
71 | int dayOfWeek = 1; | 71 | int dayOfWeek = 1; |
72 | char i = OPimRecurrence::MON; | 72 | char i = OPimRecurrence::MON; |
73 | while ( !( i & day ) && i <= OPimRecurrence::SUN ) | 73 | while ( !( i & day ) && i <= static_cast<char>(OPimRecurrence::SUN) ) |
74 | { | 74 | { |
75 | i <<= 1; | 75 | i <<= 1; |
76 | ++dayOfWeek; | 76 | ++dayOfWeek; |
77 | } | 77 | } |
78 | return dayOfWeek; | 78 | return dayOfWeek; |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | int OCalendarHelper::monthDiff( const QDate& first, const QDate& second ) | 82 | int OCalendarHelper::monthDiff( const QDate& first, const QDate& second ) |
83 | { | 83 | { |
84 | return ( second.year() - first.year() ) * 12 + | 84 | return ( second.year() - first.year() ) * 12 + |
85 | second.month() - first.month(); | 85 | second.month() - first.month(); |
86 | } | 86 | } |
87 | 87 | ||
88 | 88 | ||
89 | struct OPimEvent::Data : public QShared | 89 | struct OPimEvent::Data : public QShared |
90 | { | 90 | { |
91 | Data() : QShared() | 91 | Data() : QShared() |
92 | { | 92 | { |
93 | child = 0; | 93 | child = 0; |
94 | recur = 0; | 94 | recur = 0; |
95 | manager = 0; | 95 | manager = 0; |
96 | isAllDay = false; | 96 | isAllDay = false; |
97 | parent = 0; | 97 | parent = 0; |
98 | } | 98 | } |
99 | ~Data() | 99 | ~Data() |
100 | { | 100 | { |
101 | delete manager; | 101 | delete manager; |
102 | delete recur; | 102 | delete recur; |
103 | } | 103 | } |
104 | QString description; | 104 | QString description; |
105 | QString location; | 105 | QString location; |
106 | OPimNotifyManager* manager; | 106 | OPimNotifyManager* manager; |
107 | OPimRecurrence* recur; | 107 | OPimRecurrence* recur; |
108 | QString note; | 108 | QString note; |
109 | QDateTime created; | 109 | QDateTime created; |
110 | QDateTime start; | 110 | QDateTime start; |
111 | QDateTime end; | 111 | QDateTime end; |
112 | bool isAllDay : 1; | 112 | bool isAllDay : 1; |
113 | QString timezone; | 113 | QString timezone; |
114 | QArray<int>* child; | 114 | QArray<int>* child; |
115 | int parent; | 115 | int parent; |
116 | }; | 116 | }; |
117 | 117 | ||
118 | 118 | ||
119 | OPimEvent::OPimEvent( int uid ) | 119 | OPimEvent::OPimEvent( int uid ) |
120 | : OPimRecord( uid ) | 120 | : OPimRecord( uid ) |
121 | { | 121 | { |