summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
authorzautrix <zautrix>2005-11-25 22:51:38 (UTC)
committer zautrix <zautrix>2005-11-25 22:51:38 (UTC)
commit0e18027f386280bf427ef9d0ffec61a5516cebda (patch) (unidiff)
tree91f93d724d141b9f087e4cef0c1a11e354ee389a /libkcal/calendarlocal.cpp
parentb71ee5442df23bb9900d3db6e6244773ee34ef13 (diff)
downloadkdepimpi-0e18027f386280bf427ef9d0ffec61a5516cebda.zip
kdepimpi-0e18027f386280bf427ef9d0ffec61a5516cebda.tar.gz
kdepimpi-0e18027f386280bf427ef9d0ffec61a5516cebda.tar.bz2
sync
Diffstat (limited to 'libkcal/calendarlocal.cpp') (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
@@ -924,129 +924,129 @@ bool CalendarLocal::addJournal(Journal *journal)
924 924
925 setModified( true ); 925 setModified( true );
926 if ( journal->calID() == 0 ) 926 if ( journal->calID() == 0 )
927 journal->setCalID( mDefaultCalendar ); 927 journal->setCalID( mDefaultCalendar );
928 journal->setCalEnabled( true ); 928 journal->setCalEnabled( true );
929 return true; 929 return true;
930} 930}
931 931
932void CalendarLocal::deleteJournal( Journal *journal ) 932void CalendarLocal::deleteJournal( Journal *journal )
933{ 933{
934 clearUndo(journal); 934 clearUndo(journal);
935 if ( mJournalList.removeRef(journal) ) { 935 if ( mJournalList.removeRef(journal) ) {
936 setModified( true ); 936 setModified( true );
937 } 937 }
938} 938}
939 939
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 );
1037 1037
1038 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 1038 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1039 if ( it->calID() == id ) it->setCalEnabled( enable ); 1039 if ( it->calID() == id ) it->setCalEnabled( enable );
1040 1040
1041} 1041}
1042 1042
1043void CalendarLocal::setReadOnly( int id, bool enable ) 1043void CalendarLocal::setReadOnly( int id, bool enable )
1044{ 1044{
1045 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 1045 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1046 if ( it->calID() == id ) it->setReadOnly( enable ); 1046 if ( it->calID() == id ) it->setReadOnly( enable );
1047 1047
1048 for ( Event *it = mEventList.first(); it; it = mEventList.next() ) 1048 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1049 if ( it->calID() == id ) it->setReadOnly( enable ); 1049 if ( it->calID() == id ) it->setReadOnly( enable );
1050 1050
1051 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 1051 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1052 if ( it->calID() == id ) it->setReadOnly( enable ); 1052 if ( it->calID() == id ) it->setReadOnly( enable );