-rw-r--r-- | libkcal/todo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 29f725f..2201814 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -102,16 +102,17 @@ void Todo::setRunning( bool run ) mRunLastSave = QDateTime::currentDateTime(); if ( mRunning ) { restartSaveTimer( SAVETIMER_TIMEOUT_SECONDS ); mRunStart = QDateTime::currentDateTime(); } else { mRunSaveTimer->stop(); saveRunningInfoToFile(); } + mLastSavedFileName = ""; } void Todo::saveRunningInfo( QString comment, QDateTime start, QDateTime end ) { if ( !mRunning) return; mRunning = false; mRunStart = start; mRunEnd = end; saveRunningInfoToFile( comment ); @@ -185,16 +186,22 @@ void Todo::saveRunningInfoToFile( QString comment ) else to->setDescription( "TT-Note: " + comment +"\n" + des ); } cal.addIncidence( to ); ICalFormat format( false ); file = dir +"/" +file +".ics"; format.save( &cal, file ); saveParents(); + if ( !mLastSavedFileName.isEmpty() ) { + if ( mLastSavedFileName != file ) { + QFile::remove( mLastSavedFileName ); + } + } + mLastSavedFileName = file; #ifndef DESKTOP_VERSION //QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); #endif } void Todo::saveParents() { if (!relatedTo() ) return; |