author | zautrix <zautrix> | 2005-06-17 07:51:48 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-17 07:51:48 (UTC) |
commit | 825c34c11200f8ff0229cfb00b82b1880ef55b94 (patch) (side-by-side diff) | |
tree | 243df776d77afe55ca36ca8a78586a9e2fca1888 /libkcal/todo.cpp | |
parent | a04fff3ce192e0bebf9243a1fbedb97cf7108d2b (diff) | |
download | kdepimpi-825c34c11200f8ff0229cfb00b82b1880ef55b94.zip kdepimpi-825c34c11200f8ff0229cfb00b82b1880ef55b94.tar.gz kdepimpi-825c34c11200f8ff0229cfb00b82b1880ef55b94.tar.bz2 |
fixes
-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" ); |