-rw-r--r-- | libkcal/icalformatimpl.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index c23978d..bd13132 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp | |||
@@ -158,101 +158,97 @@ icalcomponent *ICalFormatImpl::writeEvent(Event *event) | |||
158 | 158 | ||
159 | if (event->hasEndDate()) { | 159 | if (event->hasEndDate()) { |
160 | // end time | 160 | // end time |
161 | icaltimetype end; | 161 | icaltimetype end; |
162 | if (event->doesFloat()) { | 162 | if (event->doesFloat()) { |
163 | // kdDebug(5800) << "§§ Event " << event->summary() << " floats." << endl; | 163 | // kdDebug(5800) << "§§ Event " << event->summary() << " floats." << endl; |
164 | // +1 day because end date is non-inclusive. | 164 | // +1 day because end date is non-inclusive. |
165 | end = writeICalDate( event->dtEnd().date().addDays( 1 ) ); | 165 | end = writeICalDate( event->dtEnd().date().addDays( 1 ) ); |
166 | } else { | 166 | } else { |
167 | // kdDebug(5800) << "§§ Event " << event->summary() << " has time." << endl; | 167 | // kdDebug(5800) << "§§ Event " << event->summary() << " has time." << endl; |
168 | end = writeICalDateTime(event->dtEnd()); | 168 | end = writeICalDateTime(event->dtEnd()); |
169 | } | 169 | } |
170 | icalcomponent_add_property(vevent,icalproperty_new_dtend(end)); | 170 | icalcomponent_add_property(vevent,icalproperty_new_dtend(end)); |
171 | } | 171 | } |
172 | 172 | ||
173 | // TODO: attachments, resources | 173 | // TODO: attachments, resources |
174 | #if 0 | 174 | #if 0 |
175 | // attachments | 175 | // attachments |
176 | tmpStrList = anEvent->attachments(); | 176 | tmpStrList = anEvent->attachments(); |
177 | for ( QStringList::Iterator it = tmpStrList.begin(); | 177 | for ( QStringList::Iterator it = tmpStrList.begin(); |
178 | it != tmpStrList.end(); | 178 | it != tmpStrList.end(); |
179 | ++it ) | 179 | ++it ) |
180 | addPropValue(vevent, VCAttachProp, (*it).utf8()); | 180 | addPropValue(vevent, VCAttachProp, (*it).utf8()); |
181 | 181 | ||
182 | // resources | 182 | // resources |
183 | tmpStrList = anEvent->resources(); | 183 | tmpStrList = anEvent->resources(); |
184 | tmpStr = tmpStrList.join(";"); | 184 | tmpStr = tmpStrList.join(";"); |
185 | if (!tmpStr.isEmpty()) | 185 | if (!tmpStr.isEmpty()) |
186 | addPropValue(vevent, VCResourcesProp, tmpStr.utf8()); | 186 | addPropValue(vevent, VCResourcesProp, tmpStr.utf8()); |
187 | 187 | ||
188 | #endif | 188 | #endif |
189 | 189 | ||
190 | // Transparency | 190 | // Transparency |
191 | switch( event->transparency() ) { | 191 | switch( event->transparency() ) { |
192 | case Event::Transparent: | 192 | case Event::Transparent: |
193 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_TRANSPARENT)); | 193 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_TRANSPARENT)); |
194 | break; | 194 | break; |
195 | case Event::Opaque: | 195 | case Event::Opaque: |
196 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_OPAQUE)); | 196 | icalcomponent_add_property(vevent, icalproperty_new_transp(ICAL_TRANSP_OPAQUE)); |
197 | break; | 197 | break; |
198 | } | 198 | } |
199 | 199 | ||
200 | return vevent; | 200 | return vevent; |
201 | } | 201 | } |
202 | 202 | ||
203 | icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy, | 203 | icalcomponent *ICalFormatImpl::writeFreeBusy(FreeBusy *freebusy, |
204 | Scheduler::Method method) | 204 | Scheduler::Method method) |
205 | { | 205 | { |
206 | #if QT_VERSION >= 300 | 206 | |
207 | kdDebug(5800) << "icalformatimpl: writeFreeBusy: startDate: " | ||
208 | << freebusy->dtStart().toString("ddd MMMM d yyyy: h:m:s ap") << " End Date: " | ||
209 | << freebusy->dtEnd().toString("ddd MMMM d yyyy: h:m:s ap") << endl; | ||
210 | #endif | ||
211 | 207 | ||
212 | icalcomponent *vfreebusy = icalcomponent_new(ICAL_VFREEBUSY_COMPONENT); | 208 | icalcomponent *vfreebusy = icalcomponent_new(ICAL_VFREEBUSY_COMPONENT); |
213 | 209 | ||
214 | writeIncidenceBase(vfreebusy,freebusy); | 210 | writeIncidenceBase(vfreebusy,freebusy); |
215 | 211 | ||
216 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtstart( | 212 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtstart( |
217 | writeICalDateTime(freebusy->dtStart()))); | 213 | writeICalDateTime(freebusy->dtStart()))); |
218 | 214 | ||
219 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtend( | 215 | icalcomponent_add_property(vfreebusy, icalproperty_new_dtend( |
220 | writeICalDateTime(freebusy->dtEnd()))); | 216 | writeICalDateTime(freebusy->dtEnd()))); |
221 | 217 | ||
222 | if (method == Scheduler::Request) { | 218 | if (method == Scheduler::Request) { |
223 | icalcomponent_add_property(vfreebusy,icalproperty_new_uid( | 219 | icalcomponent_add_property(vfreebusy,icalproperty_new_uid( |
224 | freebusy->uid().utf8())); | 220 | freebusy->uid().utf8())); |
225 | } | 221 | } |
226 | 222 | ||
227 | //Loops through all the periods in the freebusy object | 223 | //Loops through all the periods in the freebusy object |
228 | QValueList<Period> list = freebusy->busyPeriods(); | 224 | QValueList<Period> list = freebusy->busyPeriods(); |
229 | QValueList<Period>::Iterator it; | 225 | QValueList<Period>::Iterator it; |
230 | icalperiodtype period; | 226 | icalperiodtype period; |
231 | for (it = list.begin(); it!= list.end(); ++it) { | 227 | for (it = list.begin(); it!= list.end(); ++it) { |
232 | period.start = writeICalDateTime((*it).start()); | 228 | period.start = writeICalDateTime((*it).start()); |
233 | period.end = writeICalDateTime((*it).end()); | 229 | period.end = writeICalDateTime((*it).end()); |
234 | icalcomponent_add_property(vfreebusy, icalproperty_new_freebusy(period) ); | 230 | icalcomponent_add_property(vfreebusy, icalproperty_new_freebusy(period) ); |
235 | } | 231 | } |
236 | 232 | ||
237 | return vfreebusy; | 233 | return vfreebusy; |
238 | } | 234 | } |
239 | 235 | ||
240 | icalcomponent *ICalFormatImpl::writeJournal(Journal *journal) | 236 | icalcomponent *ICalFormatImpl::writeJournal(Journal *journal) |
241 | { | 237 | { |
242 | icalcomponent *vjournal = icalcomponent_new(ICAL_VJOURNAL_COMPONENT); | 238 | icalcomponent *vjournal = icalcomponent_new(ICAL_VJOURNAL_COMPONENT); |
243 | 239 | ||
244 | writeIncidence(vjournal,journal); | 240 | writeIncidence(vjournal,journal); |
245 | 241 | ||
246 | // start time | 242 | // start time |
247 | if (journal->dtStart().isValid()) { | 243 | if (journal->dtStart().isValid()) { |
248 | icaltimetype start; | 244 | icaltimetype start; |
249 | if (journal->doesFloat()) { | 245 | if (journal->doesFloat()) { |
250 | // kdDebug(5800) << "§§ Incidence " << event->summary() << " floats." << endl; | 246 | // kdDebug(5800) << "§§ Incidence " << event->summary() << " floats." << endl; |
251 | start = writeICalDate(journal->dtStart().date()); | 247 | start = writeICalDate(journal->dtStart().date()); |
252 | } else { | 248 | } else { |
253 | // kdDebug(5800) << "§§ incidence " << event->summary() << " has time." << endl; | 249 | // kdDebug(5800) << "§§ incidence " << event->summary() << " has time." << endl; |
254 | start = writeICalDateTime(journal->dtStart()); | 250 | start = writeICalDateTime(journal->dtStart()); |
255 | } | 251 | } |
256 | icalcomponent_add_property(vjournal,icalproperty_new_dtstart(start)); | 252 | icalcomponent_add_property(vjournal,icalproperty_new_dtstart(start)); |
257 | } | 253 | } |
258 | 254 | ||