author | zautrix <zautrix> | 2005-11-26 11:20:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-26 11:20:22 (UTC) |
commit | 85bd9f05564e566b296c949ce6e214ebdbf573ac (patch) (side-by-side diff) | |
tree | b00eb9453ea06f2b43fd896a9a4840b7d64af69b /libkcal/calendarlocal.cpp | |
parent | 3cd0013c04172b312ee21e80224a3b7734b4d413 (diff) | |
download | kdepimpi-85bd9f05564e566b296c949ce6e214ebdbf573ac.zip kdepimpi-85bd9f05564e566b296c949ce6e214ebdbf573ac.tar.gz kdepimpi-85bd9f05564e566b296c949ce6e214ebdbf573ac.tar.bz2 |
sync
-rw-r--r-- | libkcal/calendarlocal.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index b02f706..ad8ace3 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -67,65 +67,74 @@ CalendarLocal::~CalendarLocal() { registerObserver( 0 ); if ( mDeleteIncidencesOnClose ) close(); } bool CalendarLocal::mergeCalendarFile( QString name ) { CalendarLocal calendar( timeZoneId() ); calendar.setDefaultCalendar( 1 ); if ( calendar.load( name ) ) { mergeCalendar( &calendar ); return true; } return false; } -Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckDuplicates) +Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckDuplicates, bool enabledOnly ) { Todo *todo;; Incidence *retVal = 0; for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { if ( todo->uid() == uid ) { + if ( enabledOnly ) + if ( !todo->calEnabled() ) + continue; if ( doNotCheckDuplicates ) return todo; if ( retVal ) { if ( retVal->calID() > todo->calID() ) { retVal = todo; } } else { retVal = todo; } } } if ( retVal ) return retVal; Event *event; for ( event = mEventList.first(); event; event = mEventList.next() ) { if ( event->uid() == uid ) { + if ( enabledOnly ) + if ( !event->calEnabled() ) + continue; if ( doNotCheckDuplicates ) return event; if ( retVal ) { if ( retVal->calID() > event->calID() ) { retVal = event; } } else { retVal = event; } } } if ( retVal ) return retVal; for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) if ( it->uid() == uid ) { + if ( enabledOnly ) + if ( !it->calEnabled() ) + continue; if ( doNotCheckDuplicates ) return it; if ( retVal ) { if ( retVal->calID() > it->calID() ) { retVal = it; } } else { retVal = it; } } return retVal; } bool CalendarLocal::mergeCalendar( Calendar* remote ) { // 1 look for raw inc in local // if inc not in remote, delete in local |