summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp4
-rw-r--r--libkcal/todo.cpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 00a43e5..e75df70 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -73,24 +73,28 @@ bool CalendarLocal::load( const QString &fileName )
FileStorage storage( this, fileName );
return storage.load();
}
bool CalendarLocal::save( const QString &fileName, CalFormat *format )
{
FileStorage storage( this, fileName, format );
return storage.save();
}
void CalendarLocal::close()
{
+
+ Todo * i;
+ for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false);
+
mEventList.setAutoDelete( true );
mTodoList.setAutoDelete( true );
mJournalList.setAutoDelete( false );
mEventList.clear();
mTodoList.clear();
mJournalList.clear();
mEventList.setAutoDelete( false );
mTodoList.setAutoDelete( false );
mJournalList.setAutoDelete( false );
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index b89abce..5e6ac22 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -56,24 +56,25 @@ Todo::Todo(const Todo &t) : QObject(),Incidence(t)
}
Todo::~Todo()
{
setRunning( false );
//qDebug("Todo::~Todo() ");
}
void Todo::setRunning( bool run )
{
if ( run == mRunning )
return;
+ //qDebug("Todo::setRunning %d ", run);
if ( !mRunSaveTimer ) {
mRunSaveTimer = new QTimer ( this );
connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) );
}
mRunning = run;
if ( mRunning ) {
mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min
mRunStart = QDateTime::currentDateTime();
} else {
mRunSaveTimer->stop();
saveRunningInfoToFile();
}