summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp2
-rw-r--r--libkcal/icalformatimpl.cpp11
-rw-r--r--libkcal/journal.cpp2
3 files changed, 10 insertions, 5 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index eef8327..5baa7dc 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -235,49 +235,49 @@ bool CalendarLocal::load( const QString &fileName )
235 FileStorage storage( this, fileName ); 235 FileStorage storage( this, fileName );
236 return storage.load(); 236 return storage.load();
237} 237}
238 238
239bool CalendarLocal::save( const QString &fileName, CalFormat *format ) 239bool CalendarLocal::save( const QString &fileName, CalFormat *format )
240{ 240{
241 FileStorage storage( this, fileName, format ); 241 FileStorage storage( this, fileName, format );
242 return storage.save(); 242 return storage.save();
243} 243}
244 244
245void CalendarLocal::stopAllTodos() 245void CalendarLocal::stopAllTodos()
246{ 246{
247 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) 247 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
248 it->setRunning( false ); 248 it->setRunning( false );
249 249
250} 250}
251void CalendarLocal::close() 251void CalendarLocal::close()
252{ 252{
253 253
254 Todo * i; 254 Todo * i;
255 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false); 255 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false);
256 256
257 mEventList.setAutoDelete( true ); 257 mEventList.setAutoDelete( true );
258 mTodoList.setAutoDelete( true ); 258 mTodoList.setAutoDelete( true );
259 mJournalList.setAutoDelete( false ); 259 mJournalList.setAutoDelete( true );
260 260
261 mEventList.clear(); 261 mEventList.clear();
262 mTodoList.clear(); 262 mTodoList.clear();
263 mJournalList.clear(); 263 mJournalList.clear();
264 264
265 mEventList.setAutoDelete( false ); 265 mEventList.setAutoDelete( false );
266 mTodoList.setAutoDelete( false ); 266 mTodoList.setAutoDelete( false );
267 mJournalList.setAutoDelete( false ); 267 mJournalList.setAutoDelete( false );
268 268
269 setModified( false ); 269 setModified( false );
270} 270}
271 271
272bool CalendarLocal::addAnniversaryNoDup( Event *event ) 272bool CalendarLocal::addAnniversaryNoDup( Event *event )
273{ 273{
274 QString cat; 274 QString cat;
275 bool isBirthday = true; 275 bool isBirthday = true;
276 if( event->categoriesStr() == i18n( "Anniversary" ) ) { 276 if( event->categoriesStr() == i18n( "Anniversary" ) ) {
277 isBirthday = false; 277 isBirthday = false;
278 cat = i18n( "Anniversary" ); 278 cat = i18n( "Anniversary" );
279 } else if( event->categoriesStr() == i18n( "Birthday" ) ) { 279 } else if( event->categoriesStr() == i18n( "Birthday" ) ) {
280 isBirthday = true; 280 isBirthday = true;
281 cat = i18n( "Birthday" ); 281 cat = i18n( "Birthday" );
282 } else { 282 } else {
283 qDebug("addAnniversaryNoDup called without fitting category! "); 283 qDebug("addAnniversaryNoDup called without fitting category! ");
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index f349681..53aa039 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -981,49 +981,49 @@ FreeBusy *ICalFormatImpl::readFreeBusy(icalcomponent *vfreebusy)
981 icaltimetype icaltime; 981 icaltimetype icaltime;
982 icalperiodtype icalperiod; 982 icalperiodtype icalperiod;
983 QDateTime period_start, period_end; 983 QDateTime period_start, period_end;
984 984
985 while (p) { 985 while (p) {
986 icalproperty_kind kind = icalproperty_isa(p); 986 icalproperty_kind kind = icalproperty_isa(p);
987 switch (kind) { 987 switch (kind) {
988 988
989 case ICAL_DTSTART_PROPERTY: // start date and time 989 case ICAL_DTSTART_PROPERTY: // start date and time
990 icaltime = icalproperty_get_dtstart(p); 990 icaltime = icalproperty_get_dtstart(p);
991 freebusy->setDtStart(readICalDateTime(icaltime)); 991 freebusy->setDtStart(readICalDateTime(icaltime));
992 break; 992 break;
993 993
994 case ICAL_DTEND_PROPERTY: // start End Date and Time 994 case ICAL_DTEND_PROPERTY: // start End Date and Time
995 icaltime = icalproperty_get_dtend(p); 995 icaltime = icalproperty_get_dtend(p);
996 freebusy->setDtEnd(readICalDateTime(icaltime)); 996 freebusy->setDtEnd(readICalDateTime(icaltime));
997 break; 997 break;
998 998
999 case ICAL_FREEBUSY_PROPERTY: //Any FreeBusy Times 999 case ICAL_FREEBUSY_PROPERTY: //Any FreeBusy Times
1000 icalperiod = icalproperty_get_freebusy(p); 1000 icalperiod = icalproperty_get_freebusy(p);
1001 period_start = readICalDateTime(icalperiod.start); 1001 period_start = readICalDateTime(icalperiod.start);
1002 period_end = readICalDateTime(icalperiod.end); 1002 period_end = readICalDateTime(icalperiod.end);
1003 freebusy->addPeriod(period_start, period_end); 1003 freebusy->addPeriod(period_start, period_end);
1004 break; 1004 break;
1005 1005
1006 default: 1006 default:
1007 kdDebug(5800) << "ICALFormat::readIncidence(): Unknown property: " << kind 1007 kdDebug(5800) << "ICALFormat::readIncidence(): Unknown property: " << kind
1008 << endl; 1008 << endl;
1009 break; 1009 break;
1010 } 1010 }
1011 p = icalcomponent_get_next_property(vfreebusy,ICAL_ANY_PROPERTY); 1011 p = icalcomponent_get_next_property(vfreebusy,ICAL_ANY_PROPERTY);
1012 } 1012 }
1013 1013
1014 return freebusy; 1014 return freebusy;
1015} 1015}
1016 1016
1017Journal *ICalFormatImpl::readJournal(icalcomponent *vjournal) 1017Journal *ICalFormatImpl::readJournal(icalcomponent *vjournal)
1018{ 1018{
1019 Journal *journal = new Journal; 1019 Journal *journal = new Journal;
1020 1020
1021 readIncidence(vjournal,journal); 1021 readIncidence(vjournal,journal);
1022 1022
1023 if ( !journal->dtStart().isValid() && journal->created().isValid() ) { 1023 if ( !journal->dtStart().isValid() && journal->created().isValid() ) {
1024 journal->setDtStart( journal->created() ); 1024 journal->setDtStart( journal->created() );
1025 } 1025 }
1026 return journal; 1026 return journal;
1027} 1027}
1028 1028
1029Attendee *ICalFormatImpl::readAttendee(icalproperty *attendee) 1029Attendee *ICalFormatImpl::readAttendee(icalproperty *attendee)
@@ -1923,67 +1923,70 @@ bool ICalFormatImpl::populate( Calendar *cal, icalcomponent *calendar)
1923 readCustomProperties(calendar, cal); 1923 readCustomProperties(calendar, cal);
1924 1924
1925// TODO: set time zone 1925// TODO: set time zone
1926#if 0 1926#if 0
1927 // set the time zone 1927 // set the time zone
1928 if ((curVO = isAPropertyOf(vcal, VCTimeZoneProp)) != 0) { 1928 if ((curVO = isAPropertyOf(vcal, VCTimeZoneProp)) != 0) {
1929 char *s = fakeCString(vObjectUStringZValue(curVO)); 1929 char *s = fakeCString(vObjectUStringZValue(curVO));
1930 cal->setTimeZone(s); 1930 cal->setTimeZone(s);
1931 deleteStr(s); 1931 deleteStr(s);
1932 } 1932 }
1933#endif 1933#endif
1934 1934
1935 // Store all events with a relatedTo property in a list for post-processing 1935 // Store all events with a relatedTo property in a list for post-processing
1936 mEventsRelate.clear(); 1936 mEventsRelate.clear();
1937 mTodosRelate.clear(); 1937 mTodosRelate.clear();
1938 // TODO: make sure that only actually added ecvens go to this lists. 1938 // TODO: make sure that only actually added ecvens go to this lists.
1939 1939
1940 icalcomponent *c; 1940 icalcomponent *c;
1941 1941
1942 // Iterate through all todos 1942 // Iterate through all todos
1943 c = icalcomponent_get_first_component(calendar,ICAL_VTODO_COMPONENT); 1943 c = icalcomponent_get_first_component(calendar,ICAL_VTODO_COMPONENT);
1944 while (c) { 1944 while (c) {
1945// kdDebug(5800) << "----Todo found" << endl; 1945// kdDebug(5800) << "----Todo found" << endl;
1946 Todo *todo = readTodo(c); 1946 Todo *todo = readTodo(c);
1947 if (!cal->todo(todo->uid())) cal->addTodo(todo); 1947 if (!cal->todo(todo->uid()))
1948 cal->addTodo(todo);
1948 c = icalcomponent_get_next_component(calendar,ICAL_VTODO_COMPONENT); 1949 c = icalcomponent_get_next_component(calendar,ICAL_VTODO_COMPONENT);
1949 } 1950 }
1950 1951
1951 // Iterate through all events 1952 // Iterate through all events
1952 c = icalcomponent_get_first_component(calendar,ICAL_VEVENT_COMPONENT); 1953 c = icalcomponent_get_first_component(calendar,ICAL_VEVENT_COMPONENT);
1953 while (c) { 1954 while (c) {
1954// kdDebug(5800) << "----Event found" << endl; 1955// kdDebug(5800) << "----Event found" << endl;
1955 Event *event = readEvent(c); 1956 Event *event = readEvent(c);
1956 if (!cal->event(event->uid())) cal->addEvent(event); 1957 if (!cal->event(event->uid()))
1958 cal->addEvent(event);
1957 c = icalcomponent_get_next_component(calendar,ICAL_VEVENT_COMPONENT); 1959 c = icalcomponent_get_next_component(calendar,ICAL_VEVENT_COMPONENT);
1958 } 1960 }
1959 1961
1960 // Iterate through all journals 1962 // Iterate through all journals
1961 c = icalcomponent_get_first_component(calendar,ICAL_VJOURNAL_COMPONENT); 1963 c = icalcomponent_get_first_component(calendar,ICAL_VJOURNAL_COMPONENT);
1962 while (c) { 1964 while (c) {
1963// kdDebug(5800) << "----Journal found" << endl; 1965// kdDebug(5800) << "----Journal found" << endl;
1964 Journal *journal = readJournal(c); 1966 Journal *journal = readJournal(c);
1965 if (!cal->journal(journal->uid())) cal->addJournal(journal); 1967 if (!cal->journal(journal->uid()))
1968 cal->addJournal(journal);
1966 c = icalcomponent_get_next_component(calendar,ICAL_VJOURNAL_COMPONENT); 1969 c = icalcomponent_get_next_component(calendar,ICAL_VJOURNAL_COMPONENT);
1967 } 1970 }
1968 1971
1969#if 0 1972#if 0
1970 initPropIterator(&i, vcal); 1973 initPropIterator(&i, vcal);
1971 1974
1972 // go through all the vobjects in the vcal 1975 // go through all the vobjects in the vcal
1973 while (moreIteration(&i)) { 1976 while (moreIteration(&i)) {
1974 curVO = nextVObject(&i); 1977 curVO = nextVObject(&i);
1975 1978
1976 /************************************************************************/ 1979 /************************************************************************/
1977 1980
1978 // now, check to see that the object is an event or todo. 1981 // now, check to see that the object is an event or todo.
1979 if (strcmp(vObjectName(curVO), VCEventProp) == 0) { 1982 if (strcmp(vObjectName(curVO), VCEventProp) == 0) {
1980 1983
1981 if ((curVOProp = isAPropertyOf(curVO, KPilotStatusProp)) != 0) { 1984 if ((curVOProp = isAPropertyOf(curVO, KPilotStatusProp)) != 0) {
1982 char *s; 1985 char *s;
1983 s = fakeCString(vObjectUStringZValue(curVOProp)); 1986 s = fakeCString(vObjectUStringZValue(curVOProp));
1984 // check to see if event was deleted by the kpilot conduit 1987 // check to see if event was deleted by the kpilot conduit
1985 if (atoi(s) == Event::SYNCDEL) { 1988 if (atoi(s) == Event::SYNCDEL) {
1986 deleteStr(s); 1989 deleteStr(s);
1987 goto SKIP; 1990 goto SKIP;
1988 } 1991 }
1989 deleteStr(s); 1992 deleteStr(s);
diff --git a/libkcal/journal.cpp b/libkcal/journal.cpp
index 859161f..c4e4474 100644
--- a/libkcal/journal.cpp
+++ b/libkcal/journal.cpp
@@ -3,47 +3,49 @@
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include "journal.h" 21#include "journal.h"
22 22
23using namespace KCal; 23using namespace KCal;
24 24
25Journal::Journal() 25Journal::Journal()
26{ 26{
27 qDebug("New JJJ ");
27} 28}
28 29
29Journal::~Journal() 30Journal::~Journal()
30{ 31{
32 qDebug("delete JJJ ");
31} 33}
32 34
33Incidence *Journal::clone() 35Incidence *Journal::clone()
34{ 36{
35 return new Journal(*this); 37 return new Journal(*this);
36} 38}
37 39
38 40
39bool KCal::operator==( const Journal& j1, const Journal& j2 ) 41bool KCal::operator==( const Journal& j1, const Journal& j2 )
40{ 42{
41 return operator==( (const Incidence&)j1, (const Incidence&)j2 ); 43 return operator==( (const Incidence&)j1, (const Incidence&)j2 );
42} 44}
43 45
44 46
45QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const 47QDateTime Journal::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
46{ 48{
47 *ok = false; 49 *ok = false;
48 return QDateTime (); 50 return QDateTime ();
49} 51}