summaryrefslogtreecommitdiffabout
path: root/libkcal/icalformatimpl.cpp
authorzautrix <zautrix>2005-06-08 10:34:22 (UTC)
committer zautrix <zautrix>2005-06-08 10:34:22 (UTC)
commit793d117812b4da36c9c11d90cccba347cbc6e208 (patch) (side-by-side diff)
tree5bc77e2b7a32a541c2a3b3c3d6d50f873216deef /libkcal/icalformatimpl.cpp
parent39d84e2fc3099bd5d7596e8be5dc6783826cec01 (diff)
downloadkdepimpi-793d117812b4da36c9c11d90cccba347cbc6e208.zip
kdepimpi-793d117812b4da36c9c11d90cccba347cbc6e208.tar.gz
kdepimpi-793d117812b4da36c9c11d90cccba347cbc6e208.tar.bz2
changed incidence type to a faster access method
Diffstat (limited to 'libkcal/icalformatimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index 2405682..3e28714 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -2062,111 +2062,111 @@ QString ICalFormatImpl::extractErrorProperty(icalcomponent *c)
icalproperty *error;
error = icalcomponent_get_first_property(c,ICAL_XLICERROR_PROPERTY);
while(error) {
errorMessage += icalproperty_get_xlicerror(error);
errorMessage += "\n";
error = icalcomponent_get_next_property(c,ICAL_XLICERROR_PROPERTY);
}
// kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: " << errorMessage << endl;
return errorMessage;
}
void ICalFormatImpl::dumpIcalRecurrence(icalrecurrencetype r)
{
int i;
if (r.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
int index = 0;
QString out = " By Day: ";
while((i = r.by_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
out.append(QString::number(i) + " ");
}
}
if (r.by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
int index = 0;
QString out = " By Month Day: ";
while((i = r.by_month_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
out.append(QString::number(i) + " ");
}
}
if (r.by_year_day[0] != ICAL_RECURRENCE_ARRAY_MAX) {
int index = 0;
QString out = " By Year Day: ";
while((i = r.by_year_day[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
out.append(QString::number(i) + " ");
}
}
if (r.by_month[0] != ICAL_RECURRENCE_ARRAY_MAX) {
int index = 0;
QString out = " By Month: ";
while((i = r.by_month[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
out.append(QString::number(i) + " ");
}
}
if (r.by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX) {
int index = 0;
QString out = " By Set Pos: ";
while((i = r.by_set_pos[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
out.append(QString::number(i) + " ");
}
}
}
icalcomponent *ICalFormatImpl::createScheduleComponent(IncidenceBase *incidence,
Scheduler::Method method)
{
icalcomponent *message = createCalendarComponent();
icalproperty_method icalmethod = ICAL_METHOD_NONE;
switch (method) {
case Scheduler::Publish:
icalmethod = ICAL_METHOD_PUBLISH;
break;
case Scheduler::Request:
icalmethod = ICAL_METHOD_REQUEST;
break;
case Scheduler::Refresh:
icalmethod = ICAL_METHOD_REFRESH;
break;
case Scheduler::Cancel:
icalmethod = ICAL_METHOD_CANCEL;
break;
case Scheduler::Add:
icalmethod = ICAL_METHOD_ADD;
break;
case Scheduler::Reply:
icalmethod = ICAL_METHOD_REPLY;
break;
case Scheduler::Counter:
icalmethod = ICAL_METHOD_COUNTER;
break;
case Scheduler::Declinecounter:
icalmethod = ICAL_METHOD_DECLINECOUNTER;
break;
default:
return message;
}
icalcomponent_add_property(message,icalproperty_new_method(icalmethod));
// TODO: check, if dynamic cast is required
- if(incidence->type() == "Todo") {
+ if(incidence->typeID() == todoID ) {
Todo *todo = static_cast<Todo *>(incidence);
icalcomponent_add_component(message,writeTodo(todo));
}
- if(incidence->type() == "Event") {
+ if(incidence->typeID() == eventID ) {
Event *event = static_cast<Event *>(incidence);
icalcomponent_add_component(message,writeEvent(event));
}
- if(incidence->type() == "FreeBusy") {
+ if(incidence->typeID() == freebusyID) {
FreeBusy *freebusy = static_cast<FreeBusy *>(incidence);
icalcomponent_add_component(message,writeFreeBusy(freebusy, method));
}
return message;
}