-rw-r--r-- | libkcal/todo.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index e98af3c..d062492 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -64,16 +64,24 @@ Todo::~Todo() void Todo::setRunningFalse( QString s ) { if ( ! mRunning ) return; mRunning = false; mRunSaveTimer->stop(); saveRunningInfoToFile( s ); } +void Todo::stopRunning() +{ + if ( !mRunning ) + return; + if ( mRunSaveTimer ) + mRunSaveTimer->stop(); + mRunning = false; +} 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() ) ); @@ -90,17 +98,17 @@ void Todo::setRunning( bool run ) void Todo::saveRunningInfoToFile() { saveRunningInfoToFile( QString::null ); } void Todo::saveRunningInfoToFile( QString comment ) { //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); - if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { + if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 10 ) { qDebug("Running time < 30 seconds. Skipped. "); return; } QString dir = KGlobalSettings::timeTrackerDir(); //qDebug("%s ", dir.latin1()); QString file = "%1%2%3-%4%5%6-"; file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ); file.replace ( QRegExp (" "), "0" ); |