summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index c33581c..c82ea92 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -940,97 +940,97 @@ void CalendarLocal::deleteJournal( Journal *journal )
940QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date ) 940QPtrList<Journal> CalendarLocal::journals4Date( const QDate & date )
941{ 941{
942 QPtrList<Journal> el; 942 QPtrList<Journal> el;
943 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 943 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
944 if ( it->calEnabled() && it->dtStart().date() == date) el.append( it ); 944 if ( it->calEnabled() && it->dtStart().date() == date) el.append( it );
945 return el; 945 return el;
946} 946}
947Journal *CalendarLocal::journal( const QDate &date ) 947Journal *CalendarLocal::journal( const QDate &date )
948{ 948{
949// kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; 949// kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl;
950 950
951 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 951 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
952 if ( it->calEnabled() && it->dtStart().date() == date ) 952 if ( it->calEnabled() && it->dtStart().date() == date )
953 return it; 953 return it;
954 954
955 return 0; 955 return 0;
956} 956}
957 957
958Journal *CalendarLocal::journal( const QString &uid ) 958Journal *CalendarLocal::journal( const QString &uid )
959{ 959{
960 Journal * retVal = 0; 960 Journal * retVal = 0;
961 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 961 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
962 if ( it->calEnabled() && it->uid() == uid ) { 962 if ( it->calEnabled() && it->uid() == uid ) {
963 if ( retVal ) { 963 if ( retVal ) {
964 if ( retVal->calID() > it->calID() ) { 964 if ( retVal->calID() > it->calID() ) {
965 retVal = it; 965 retVal = it;
966 } 966 }
967 } else { 967 } else {
968 retVal = it; 968 retVal = it;
969 } 969 }
970 } 970 }
971 return retVal; 971 return retVal;
972} 972}
973 973
974QPtrList<Journal> CalendarLocal::journals() 974QPtrList<Journal> CalendarLocal::journals()
975{ 975{
976 QPtrList<Journal> el; 976 QPtrList<Journal> el;
977 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 977 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
978 if ( it->calEnabled() ) el.append( it ); 978 if ( it->calEnabled() ) el.append( it );
979 return el; 979 return el;
980} 980}
981void CalendarLocal::setCalendarRemove( int id ) 981void CalendarLocal::setCalendarRemove( int id )
982{ 982{
983 983
984 { 984 {
985 QPtrList<Event> EventList = mEventList; 985 QPtrList<Event> EventList = mEventList;
986 Event * ev = EventList.first(); 986 Event * ev = EventList.first();
987 while ( ev ) { 987 while ( ev ) {
988 if ( ev->calID() == id ) 988 if ( ev->calID() == id && ev->uid().left( 15 ) != QString("last-syncEvent-") )
989 deleteEvent( ev ); 989 deleteEvent( ev );
990 ev = EventList.next(); 990 ev = EventList.next();
991 } 991 }
992 } 992 }
993 { 993 {
994 994
995 QPtrList<Todo> TodoList = mTodoList; 995 QPtrList<Todo> TodoList = mTodoList;
996 Todo * ev = TodoList.first(); 996 Todo * ev = TodoList.first();
997 while ( ev ) { 997 while ( ev ) {
998 if ( ev->calID() == id ) 998 if ( ev->calID() == id )
999 deleteTodo( ev ); 999 deleteTodo( ev );
1000 ev = TodoList.next(); 1000 ev = TodoList.next();
1001 } 1001 }
1002 } 1002 }
1003 { 1003 {
1004 QPtrList<Journal> JournalList = mJournalList; 1004 QPtrList<Journal> JournalList = mJournalList;
1005 Journal * ev = JournalList.first(); 1005 Journal * ev = JournalList.first();
1006 while ( ev ) { 1006 while ( ev ) {
1007 if ( ev->calID() == id ) 1007 if ( ev->calID() == id )
1008 deleteJournal( ev ); 1008 deleteJournal( ev );
1009 ev = JournalList.next(); 1009 ev = JournalList.next();
1010 } 1010 }
1011 } 1011 }
1012 1012
1013 clearUndo(0); 1013 clearUndo(0);
1014 1014
1015} 1015}
1016 1016
1017void CalendarLocal::setAllCalendarEnabled( bool enable ) 1017void CalendarLocal::setAllCalendarEnabled( bool enable )
1018{ 1018{
1019 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1019 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1020 it->setCalEnabled( enable ); 1020 it->setCalEnabled( enable );
1021 1021
1022 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 1022 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1023 it->setCalEnabled( enable ); 1023 it->setCalEnabled( enable );
1024 1024
1025 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 1025 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1026 it->setCalEnabled( enable ); 1026 it->setCalEnabled( enable );
1027 1027
1028 1028
1029} 1029}
1030void CalendarLocal::setCalendarEnabled( int id, bool enable ) 1030void CalendarLocal::setCalendarEnabled( int id, bool enable )
1031{ 1031{
1032 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1032 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1033 if ( it->calID() == id ) it->setCalEnabled( enable ); 1033 if ( it->calID() == id ) it->setCalEnabled( enable );
1034 1034
1035 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 1035 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1036 if ( it->calID() == id ) it->setCalEnabled( enable ); 1036 if ( it->calID() == id ) it->setCalEnabled( enable );