-rw-r--r-- | libopie/pim/oevent.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp index aaae3b2..ada596c 100644 --- a/libopie/pim/oevent.cpp +++ b/libopie/pim/oevent.cpp | |||
@@ -166,48 +166,53 @@ QDateTime OEvent::endDateTime()const { | |||
166 | * if all Day event the end time needs | 166 | * if all Day event the end time needs |
167 | * to be on the same day as the start | 167 | * to be on the same day as the start |
168 | */ | 168 | */ |
169 | if ( data->isAllDay ) | 169 | if ( data->isAllDay ) |
170 | return QDateTime( data->start.date(), QTime(23, 59, 59 ) ); | 170 | return QDateTime( data->start.date(), QTime(23, 59, 59 ) ); |
171 | return data->end; | 171 | return data->end; |
172 | } | 172 | } |
173 | QDateTime OEvent::endDateTimeInZone()const { | 173 | QDateTime OEvent::endDateTimeInZone()const { |
174 | /* if no timezone, or all day event or if the current and this timeZone match... */ | 174 | /* if no timezone, or all day event or if the current and this timeZone match... */ |
175 | if (data->timezone.isEmpty() || data->isAllDay || data->timezone == OTimeZone::current().timeZone() ) return endDateTime(); | 175 | if (data->timezone.isEmpty() || data->isAllDay || data->timezone == OTimeZone::current().timeZone() ) return endDateTime(); |
176 | 176 | ||
177 | OTimeZone zone(data->timezone ); | 177 | OTimeZone zone(data->timezone ); |
178 | return zone.toDateTime( data->end, OTimeZone::current() ); | 178 | return zone.toDateTime( data->end, OTimeZone::current() ); |
179 | } | 179 | } |
180 | void OEvent::setEndDateTime( const QDateTime& dt ) { | 180 | void OEvent::setEndDateTime( const QDateTime& dt ) { |
181 | changeOrModify(); | 181 | changeOrModify(); |
182 | data->end = dt; | 182 | data->end = dt; |
183 | } | 183 | } |
184 | bool OEvent::isMultipleDay()const { | 184 | bool OEvent::isMultipleDay()const { |
185 | return data->end.date().day() - data->start.date().day(); | 185 | return data->end.date().day() - data->start.date().day(); |
186 | } | 186 | } |
187 | bool OEvent::isAllDay()const { | 187 | bool OEvent::isAllDay()const { |
188 | return data->isAllDay; | 188 | return data->isAllDay; |
189 | } | 189 | } |
190 | void OEvent::setAllDay( bool allDay ) { | ||
191 | changeOrModify(); | ||
192 | data->isAllDay = allDay; | ||
193 | if (allDay ) data->timezone = "UTC"; | ||
194 | } | ||
190 | void OEvent::setTimeZone( const QString& tz ) { | 195 | void OEvent::setTimeZone( const QString& tz ) { |
191 | changeOrModify(); | 196 | changeOrModify(); |
192 | data->timezone = tz; | 197 | data->timezone = tz; |
193 | } | 198 | } |
194 | QString OEvent::timeZone()const { | 199 | QString OEvent::timeZone()const { |
195 | return data->timezone; | 200 | return data->timezone; |
196 | } | 201 | } |
197 | bool OEvent::match( const QRegExp& )const { | 202 | bool OEvent::match( const QRegExp& )const { |
198 | // FIXME | 203 | // FIXME |
199 | return false; | 204 | return false; |
200 | } | 205 | } |
201 | QString OEvent::toRichText()const { | 206 | QString OEvent::toRichText()const { |
202 | // FIXME | 207 | // FIXME |
203 | return "OEvent test"; | 208 | return "OEvent test"; |
204 | } | 209 | } |
205 | QString OEvent::toShortText()const { | 210 | QString OEvent::toShortText()const { |
206 | return "OEvent shotText"; | 211 | return "OEvent shotText"; |
207 | } | 212 | } |
208 | QString OEvent::type()const { | 213 | QString OEvent::type()const { |
209 | return QString::fromLatin1("OEvent"); | 214 | return QString::fromLatin1("OEvent"); |
210 | } | 215 | } |
211 | QString OEvent::recordField( int /*id */ )const { | 216 | QString OEvent::recordField( int /*id */ )const { |
212 | return QString::null; | 217 | return QString::null; |
213 | } | 218 | } |