summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/calendarlocal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp11
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
@@ -77,18 +77,21 @@ bool CalendarLocal::mergeCalendarFile( QString 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 {
@@ -97,12 +100,15 @@ Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckD
}
}
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 {
@@ -110,12 +116,15 @@ Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckD
}
}
}
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 {