From 27ffa2e08ebb38e71f613af3a214750442418e2c Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 27 Jul 2005 23:40:19 +0000 Subject: fixcxcx --- (limited to 'libkcal') diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index e37a7ad..eef8327 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -65,6 +65,7 @@ void CalendarLocal::init() CalendarLocal::~CalendarLocal() { + registerObserver( 0 ); if ( mDeleteIncidencesOnClose ) close(); } diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index 5877406..6f3a799 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp @@ -50,8 +50,9 @@ extern "C" { using namespace KCal; -ICalFormat::ICalFormat( ) +ICalFormat::ICalFormat( bool pe ) { + mProcessEvents = pe; mImpl = new ICalFormatImpl( this ); tzOffsetMin = 0; //qDebug("new ICalFormat() "); @@ -189,7 +190,10 @@ QString ICalFormat::toString( Calendar *cal ) component = mImpl->writeTodo(qlt.current()); icalcomponent_add_component(calendar,component); //qDebug(" todos "); - qApp->processEvents(); + if ( mProcessEvents ) { + //qDebug("mProcessEvents "); + qApp->processEvents(); + } } // events QPtrList events = cal->rawEvents(); @@ -198,7 +202,8 @@ QString ICalFormat::toString( Calendar *cal ) component = mImpl->writeEvent(ev); icalcomponent_add_component(calendar,component); //qDebug("events "); - qApp->processEvents(); + if ( mProcessEvents ) + qApp->processEvents(); } // journals @@ -208,12 +213,14 @@ QString ICalFormat::toString( Calendar *cal ) component = mImpl->writeJournal(j); icalcomponent_add_component(calendar,component); //qDebug("journals "); - qApp->processEvents(); + if ( mProcessEvents ) + qApp->processEvents(); } const char *text; QString ret =""; text = icalcomponent_as_ical_string( calendar ); - qApp->processEvents(); + if ( mProcessEvents ) + qApp->processEvents(); // text = "BEGIN:VCALENDAR\nPRODID\n :-//K Desktop Environment//NONSGML libkcal 3.1//EN\nVERSION\n :2.0\nBEGIN:VEVENT\nDTSTAMP\n :20031231T213514Z\nORGANIZER\n :MAILTO:lutz@putz.de\nCREATED\n :20031231T213513Z\nUID\n :libkcal-1295166342.120\nSEQUENCE\n :0\nLAST-MODIFIED\n :20031231T213513Z\nSUMMARY\n :test1\nCLASS\n :PUBLIC\nPRIORITY\n :3\nDTSTART\n :20040101T090000Z\nDTEND\n :20040101T110000Z\nTRANSP\n :OPAQUE\nEND:VEVENT\nEND:VCALENDAR\n"; diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h index 485ab6e..a770dbb 100644 --- a/libkcal/icalformat.h +++ b/libkcal/icalformat.h @@ -40,7 +40,7 @@ class ICalFormatImpl; class ICalFormat : public CalFormat { public: /** Create new iCalendar format. */ - ICalFormat( ); + ICalFormat( bool pe = true); virtual ~ICalFormat(); /** @@ -103,6 +103,7 @@ class ICalFormat : public CalFormat { bool utc() const; private: + bool mProcessEvents; ICalFormatImpl *mImpl; QString mTimeZoneId; QCString mTzString; diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 4ada2d8..7bf756a 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -66,7 +66,8 @@ void Todo::setRunningFalse( QString s ) if ( ! mRunning ) return; mRunning = false; - mRunSaveTimer->stop(); + if ( mRunSaveTimer ) + mRunSaveTimer->stop(); saveRunningInfoToFile( s ); } void Todo::stopRunning() @@ -139,7 +140,7 @@ void Todo::saveRunningInfoToFile( QString comment ) to->setDescription( "TT-Note: " + comment +"\n" + des ); } cal.addIncidence( to ); - ICalFormat format; + ICalFormat format( false ); file = dir +"/" +file +".ics"; format.save( &cal, file ); saveParents(); @@ -167,7 +168,7 @@ void Todo::saveParents() cal.setLocalTime(); Todo * par = (Todo *) to->clone(); cal.addIncidence( par ); - ICalFormat format; + ICalFormat format( false ); format.save( &cal, file ); } to->saveParents(); -- cgit v0.9.0.2