-rw-r--r-- | libkcal/calendarlocal.cpp | 1 | ||||
-rw-r--r-- | libkcal/icalformat.cpp | 17 | ||||
-rw-r--r-- | libkcal/icalformat.h | 3 | ||||
-rw-r--r-- | libkcal/todo.cpp | 7 |
4 files changed, 19 insertions, 9 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index e37a7ad..eef8327 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -67,2 +67,3 @@ CalendarLocal::~CalendarLocal() { + registerObserver( 0 ); if ( mDeleteIncidencesOnClose ) diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp index 5877406..6f3a799 100644 --- a/libkcal/icalformat.cpp +++ b/libkcal/icalformat.cpp @@ -52,4 +52,5 @@ using namespace KCal; -ICalFormat::ICalFormat( ) +ICalFormat::ICalFormat( bool pe ) { + mProcessEvents = pe; mImpl = new ICalFormatImpl( this ); @@ -191,3 +192,6 @@ QString ICalFormat::toString( Calendar *cal ) //qDebug(" todos "); - qApp->processEvents(); + if ( mProcessEvents ) { + //qDebug("mProcessEvents "); + qApp->processEvents(); + } } @@ -200,3 +204,4 @@ QString ICalFormat::toString( Calendar *cal ) //qDebug("events "); - qApp->processEvents(); + if ( mProcessEvents ) + qApp->processEvents(); } @@ -210,3 +215,4 @@ QString ICalFormat::toString( Calendar *cal ) //qDebug("journals "); - qApp->processEvents(); + if ( mProcessEvents ) + qApp->processEvents(); } @@ -215,3 +221,4 @@ QString ICalFormat::toString( Calendar *cal ) text = icalcomponent_as_ical_string( calendar ); - qApp->processEvents(); + if ( mProcessEvents ) + qApp->processEvents(); diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h index 485ab6e..a770dbb 100644 --- a/libkcal/icalformat.h +++ b/libkcal/icalformat.h @@ -42,3 +42,3 @@ class ICalFormat : public CalFormat { /** Create new iCalendar format. */ - ICalFormat( ); + ICalFormat( bool pe = true); virtual ~ICalFormat(); @@ -105,2 +105,3 @@ class ICalFormat : public CalFormat { private: + bool mProcessEvents; ICalFormatImpl *mImpl; diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 4ada2d8..7bf756a 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -68,3 +68,4 @@ void Todo::setRunningFalse( QString s ) mRunning = false; - mRunSaveTimer->stop(); + if ( mRunSaveTimer ) + mRunSaveTimer->stop(); saveRunningInfoToFile( s ); @@ -141,3 +142,3 @@ void Todo::saveRunningInfoToFile( QString comment ) cal.addIncidence( to ); - ICalFormat format; + ICalFormat format( false ); file = dir +"/" +file +".ics"; @@ -169,3 +170,3 @@ void Todo::saveParents() cal.addIncidence( par ); - ICalFormat format; + ICalFormat format( false ); format.save( &cal, file ); |