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) (unidiff)
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) (show 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
@@ -2110,63 +2110,63 @@ void ICalFormatImpl::dumpIcalRecurrence(icalrecurrencetype r)
2110 int index = 0; 2110 int index = 0;
2111 QString out = " By Set Pos: "; 2111 QString out = " By Set Pos: ";
2112 while((i = r.by_set_pos[index++]) != ICAL_RECURRENCE_ARRAY_MAX) { 2112 while((i = r.by_set_pos[index++]) != ICAL_RECURRENCE_ARRAY_MAX) {
2113 out.append(QString::number(i) + " "); 2113 out.append(QString::number(i) + " ");
2114 } 2114 }
2115 } 2115 }
2116} 2116}
2117 2117
2118icalcomponent *ICalFormatImpl::createScheduleComponent(IncidenceBase *incidence, 2118icalcomponent *ICalFormatImpl::createScheduleComponent(IncidenceBase *incidence,
2119 Scheduler::Method method) 2119 Scheduler::Method method)
2120{ 2120{
2121 icalcomponent *message = createCalendarComponent(); 2121 icalcomponent *message = createCalendarComponent();
2122 2122
2123 icalproperty_method icalmethod = ICAL_METHOD_NONE; 2123 icalproperty_method icalmethod = ICAL_METHOD_NONE;
2124 2124
2125 switch (method) { 2125 switch (method) {
2126 case Scheduler::Publish: 2126 case Scheduler::Publish:
2127 icalmethod = ICAL_METHOD_PUBLISH; 2127 icalmethod = ICAL_METHOD_PUBLISH;
2128 break; 2128 break;
2129 case Scheduler::Request: 2129 case Scheduler::Request:
2130 icalmethod = ICAL_METHOD_REQUEST; 2130 icalmethod = ICAL_METHOD_REQUEST;
2131 break; 2131 break;
2132 case Scheduler::Refresh: 2132 case Scheduler::Refresh:
2133 icalmethod = ICAL_METHOD_REFRESH; 2133 icalmethod = ICAL_METHOD_REFRESH;
2134 break; 2134 break;
2135 case Scheduler::Cancel: 2135 case Scheduler::Cancel:
2136 icalmethod = ICAL_METHOD_CANCEL; 2136 icalmethod = ICAL_METHOD_CANCEL;
2137 break; 2137 break;
2138 case Scheduler::Add: 2138 case Scheduler::Add:
2139 icalmethod = ICAL_METHOD_ADD; 2139 icalmethod = ICAL_METHOD_ADD;
2140 break; 2140 break;
2141 case Scheduler::Reply: 2141 case Scheduler::Reply:
2142 icalmethod = ICAL_METHOD_REPLY; 2142 icalmethod = ICAL_METHOD_REPLY;
2143 break; 2143 break;
2144 case Scheduler::Counter: 2144 case Scheduler::Counter:
2145 icalmethod = ICAL_METHOD_COUNTER; 2145 icalmethod = ICAL_METHOD_COUNTER;
2146 break; 2146 break;
2147 case Scheduler::Declinecounter: 2147 case Scheduler::Declinecounter:
2148 icalmethod = ICAL_METHOD_DECLINECOUNTER; 2148 icalmethod = ICAL_METHOD_DECLINECOUNTER;
2149 break; 2149 break;
2150 default: 2150 default:
2151 2151
2152 return message; 2152 return message;
2153 } 2153 }
2154 2154
2155 icalcomponent_add_property(message,icalproperty_new_method(icalmethod)); 2155 icalcomponent_add_property(message,icalproperty_new_method(icalmethod));
2156 2156
2157 // TODO: check, if dynamic cast is required 2157 // TODO: check, if dynamic cast is required
2158 if(incidence->type() == "Todo") { 2158 if(incidence->typeID() == todoID ) {
2159 Todo *todo = static_cast<Todo *>(incidence); 2159 Todo *todo = static_cast<Todo *>(incidence);
2160 icalcomponent_add_component(message,writeTodo(todo)); 2160 icalcomponent_add_component(message,writeTodo(todo));
2161 } 2161 }
2162 if(incidence->type() == "Event") { 2162 if(incidence->typeID() == eventID ) {
2163 Event *event = static_cast<Event *>(incidence); 2163 Event *event = static_cast<Event *>(incidence);
2164 icalcomponent_add_component(message,writeEvent(event)); 2164 icalcomponent_add_component(message,writeEvent(event));
2165 } 2165 }
2166 if(incidence->type() == "FreeBusy") { 2166 if(incidence->typeID() == freebusyID) {
2167 FreeBusy *freebusy = static_cast<FreeBusy *>(incidence); 2167 FreeBusy *freebusy = static_cast<FreeBusy *>(incidence);
2168 icalcomponent_add_component(message,writeFreeBusy(freebusy, method)); 2168 icalcomponent_add_component(message,writeFreeBusy(freebusy, method));
2169 } 2169 }
2170 2170
2171 return message; 2171 return message;
2172} 2172}