summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/todo.cpp10
-rw-r--r--libkcal/todo.h1
2 files changed, 10 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
@@ -68,8 +68,16 @@ void Todo::setRunningFalse( QString s )
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;
@@ -94,9 +102,9 @@ void Todo::saveRunningInfoToFile()
}
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();
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 6fc4d4b..42db025 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -121,8 +121,9 @@ namespace KCal {
bool isRunning() {return mRunning;}
bool hasRunningSub();
void setRunning( bool );
void setRunningFalse( QString );
+ void stopRunning();
int runTime();
QDateTime runStart () const { return mRunStart;}
public slots:
void saveRunningInfoToFile( QString st );