-rw-r--r-- | libkcal/calendar.h | 2 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 14 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 7d23619..df5bbcf 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h | |||
@@ -66,25 +66,25 @@ public: | |||
66 | Calendar(const QString &timeZoneId); | 66 | Calendar(const QString &timeZoneId); |
67 | virtual ~Calendar(); | 67 | virtual ~Calendar(); |
68 | void deleteIncidence(Incidence *in); | 68 | void deleteIncidence(Incidence *in); |
69 | /** | 69 | /** |
70 | Clears out the current calendar, freeing all used memory etc. | 70 | Clears out the current calendar, freeing all used memory etc. |
71 | */ | 71 | */ |
72 | virtual void close() = 0; | 72 | virtual void close() = 0; |
73 | 73 | ||
74 | /** | 74 | /** |
75 | Sync changes in memory to persistant storage. | 75 | Sync changes in memory to persistant storage. |
76 | */ | 76 | */ |
77 | virtual void save() = 0; | 77 | virtual void save() = 0; |
78 | 78 | virtual QPtrList<Event> getExternLastSyncEvents() = 0; | |
79 | virtual bool isSaving() { return false; } | 79 | virtual bool isSaving() { return false; } |
80 | 80 | ||
81 | /** | 81 | /** |
82 | Return the owner of the calendar's full name. | 82 | Return the owner of the calendar's full name. |
83 | */ | 83 | */ |
84 | const QString &getOwner() const; | 84 | const QString &getOwner() const; |
85 | /** | 85 | /** |
86 | Set the owner of the calendar. Should be owner's full name. | 86 | Set the owner of the calendar. Should be owner's full name. |
87 | */ | 87 | */ |
88 | void setOwner( const QString &os ); | 88 | void setOwner( const QString &os ); |
89 | /** | 89 | /** |
90 | Return the email address of the calendar owner. | 90 | Return the email address of the calendar owner. |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 3c572f0..09ce9f0 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -213,24 +213,37 @@ QPtrList<Todo> CalendarLocal::rawTodos() | |||
213 | return mTodoList; | 213 | return mTodoList; |
214 | } | 214 | } |
215 | Todo *CalendarLocal::todo( int id ) | 215 | Todo *CalendarLocal::todo( int id ) |
216 | { | 216 | { |
217 | Todo *todo; | 217 | Todo *todo; |
218 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 218 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
219 | if ( todo->zaurusId() == id ) return todo; | 219 | if ( todo->zaurusId() == id ) return todo; |
220 | } | 220 | } |
221 | 221 | ||
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | QPtrList<Event> CalendarLocal::getExternLastSyncEvents() | ||
226 | { | ||
227 | QPtrList<Event> el; | ||
228 | Event *todo; | ||
229 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | ||
230 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) | ||
231 | if ( todo->summary().left(3) == "E: " ) | ||
232 | el.append( todo ); | ||
233 | } | ||
234 | |||
235 | return el; | ||
236 | |||
237 | } | ||
225 | Event *CalendarLocal::event( int id ) | 238 | Event *CalendarLocal::event( int id ) |
226 | { | 239 | { |
227 | Event *todo; | 240 | Event *todo; |
228 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | 241 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { |
229 | if ( todo->zaurusId() == id ) return todo; | 242 | if ( todo->zaurusId() == id ) return todo; |
230 | } | 243 | } |
231 | 244 | ||
232 | return 0; | 245 | return 0; |
233 | } | 246 | } |
234 | Todo *CalendarLocal::todo( const QString &uid ) | 247 | Todo *CalendarLocal::todo( const QString &uid ) |
235 | { | 248 | { |
236 | Todo *todo; | 249 | Todo *todo; |
@@ -311,25 +324,24 @@ QString CalendarLocal:: getAlarmNotification() | |||
311 | Alarm* alarm = mNextAlarmIncidence->alarms().first(); | 324 | Alarm* alarm = mNextAlarmIncidence->alarms().first(); |
312 | if ( alarm->type() == Alarm::Procedure ) { | 325 | if ( alarm->type() == Alarm::Procedure ) { |
313 | ret = "proc_alarm" + alarm->programFile()+"+++"; | 326 | ret = "proc_alarm" + alarm->programFile()+"+++"; |
314 | } else { | 327 | } else { |
315 | ret = "audio_alarm" +alarm->audioFile() +"+++"; | 328 | ret = "audio_alarm" +alarm->audioFile() +"+++"; |
316 | } | 329 | } |
317 | ret += "cal_alarm"+ mNextSummary.left( 25 ); | 330 | ret += "cal_alarm"+ mNextSummary.left( 25 ); |
318 | if ( mNextSummary.length() > 25 ) | 331 | if ( mNextSummary.length() > 25 ) |
319 | ret += "\n" + mNextSummary.mid(25, 25 ); | 332 | ret += "\n" + mNextSummary.mid(25, 25 ); |
320 | ret+= "\n"+mNextAlarmEventDateTimeString; | 333 | ret+= "\n"+mNextAlarmEventDateTimeString; |
321 | return ret; | 334 | return ret; |
322 | } | 335 | } |
323 | |||
324 | void CalendarLocal::registerAlarm() | 336 | void CalendarLocal::registerAlarm() |
325 | { | 337 | { |
326 | mLastAlarmNotificationString = getAlarmNotification(); | 338 | mLastAlarmNotificationString = getAlarmNotification(); |
327 | // qDebug("++ register Alarm %s %s",mNextAlarmDateTime.toString().latin1(), mLastAlarmNotificationString.latin1() ); | 339 | // qDebug("++ register Alarm %s %s",mNextAlarmDateTime.toString().latin1(), mLastAlarmNotificationString.latin1() ); |
328 | emit addAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); | 340 | emit addAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); |
329 | // #ifndef DESKTOP_VERSION | 341 | // #ifndef DESKTOP_VERSION |
330 | // AlarmServer::addAlarm ( mNextAlarmDateTime,"koalarm", mLastAlarmNotificationString.latin1() ); | 342 | // AlarmServer::addAlarm ( mNextAlarmDateTime,"koalarm", mLastAlarmNotificationString.latin1() ); |
331 | // #endif | 343 | // #endif |
332 | } | 344 | } |
333 | void CalendarLocal::deRegisterAlarm() | 345 | void CalendarLocal::deRegisterAlarm() |
334 | { | 346 | { |
335 | if ( mLastAlarmNotificationString.isNull() ) | 347 | if ( mLastAlarmNotificationString.isNull() ) |
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index a2e50e3..3257198 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h | |||
@@ -76,25 +76,25 @@ class CalendarLocal : public Calendar | |||
76 | Deletes an event from this calendar. | 76 | Deletes an event from this calendar. |
77 | */ | 77 | */ |
78 | void deleteEvent( Event *event ); | 78 | void deleteEvent( Event *event ); |
79 | 79 | ||
80 | /** | 80 | /** |
81 | Retrieves an event on the basis of the unique string ID. | 81 | Retrieves an event on the basis of the unique string ID. |
82 | */ | 82 | */ |
83 | Event *event( const QString &uid ); | 83 | Event *event( const QString &uid ); |
84 | /** | 84 | /** |
85 | Return unfiltered list of all events in calendar. | 85 | Return unfiltered list of all events in calendar. |
86 | */ | 86 | */ |
87 | QPtrList<Event> rawEvents(); | 87 | QPtrList<Event> rawEvents(); |
88 | 88 | QPtrList<Event> getExternLastSyncEvents(); | |
89 | /** | 89 | /** |
90 | Add a todo to the todolist. | 90 | Add a todo to the todolist. |
91 | */ | 91 | */ |
92 | bool addTodo( Todo *todo ); | 92 | bool addTodo( Todo *todo ); |
93 | bool addTodoNoDup( Todo *todo ); | 93 | bool addTodoNoDup( Todo *todo ); |
94 | /** | 94 | /** |
95 | Remove a todo from the todolist. | 95 | Remove a todo from the todolist. |
96 | */ | 96 | */ |
97 | void deleteTodo( Todo * ); | 97 | void deleteTodo( Todo * ); |
98 | /** | 98 | /** |
99 | Searches todolist for an event with this unique string identifier, | 99 | Searches todolist for an event with this unique string identifier, |
100 | returns a pointer or null. | 100 | returns a pointer or null. |