-rw-r--r-- | libkcal/todo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 42274ff..e98af3c 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -79,24 +79,28 @@ void Todo::setRunning( bool run ) | |||
79 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); | 79 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); |
80 | } | 80 | } |
81 | mRunning = run; | 81 | mRunning = run; |
82 | if ( mRunning ) { | 82 | if ( mRunning ) { |
83 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min | 83 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min |
84 | mRunStart = QDateTime::currentDateTime(); | 84 | mRunStart = QDateTime::currentDateTime(); |
85 | } else { | 85 | } else { |
86 | mRunSaveTimer->stop(); | 86 | mRunSaveTimer->stop(); |
87 | saveRunningInfoToFile(); | 87 | saveRunningInfoToFile(); |
88 | } | 88 | } |
89 | } | 89 | } |
90 | 90 | ||
91 | void Todo::saveRunningInfoToFile() | ||
92 | { | ||
93 | saveRunningInfoToFile( QString::null ); | ||
94 | } | ||
91 | void Todo::saveRunningInfoToFile( QString comment ) | 95 | void Todo::saveRunningInfoToFile( QString comment ) |
92 | { | 96 | { |
93 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); | 97 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); |
94 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { | 98 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { |
95 | qDebug("Running time < 30 seconds. Skipped. "); | 99 | qDebug("Running time < 30 seconds. Skipped. "); |
96 | return; | 100 | return; |
97 | } | 101 | } |
98 | QString dir = KGlobalSettings::timeTrackerDir(); | 102 | QString dir = KGlobalSettings::timeTrackerDir(); |
99 | //qDebug("%s ", dir.latin1()); | 103 | //qDebug("%s ", dir.latin1()); |
100 | QString file = "%1%2%3-%4%5%6-"; | 104 | QString file = "%1%2%3-%4%5%6-"; |
101 | 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 ); | 105 | 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 ); |
102 | file.replace ( QRegExp (" "), "0" ); | 106 | file.replace ( QRegExp (" "), "0" ); |