-rw-r--r-- | libkcal/calendar.h | 1 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 6 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 1 | ||||
-rw-r--r-- | libkcal/todo.cpp | 4 |
4 files changed, 10 insertions, 2 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 3b7b183..2efa355 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -77,6 +77,7 @@ public: virtual void addCalendar( Calendar* ) = 0; virtual bool addCalendarFile( QString name, int id ) = 0; virtual void setSyncEventsReadOnly() = 0; + virtual void stopAllTodos() = 0; /** Sync changes in memory to persistant storage. diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 8c4dde1..18f1af8 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -147,6 +147,12 @@ bool CalendarLocal::save( const QString &fileName, CalFormat *format ) return storage.save(); } +void CalendarLocal::stopAllTodos() +{ + for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() ) + it->setRunning( false ); + +} void CalendarLocal::close() { diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index 0286b48..d32597f 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h @@ -46,6 +46,7 @@ class CalendarLocal : public Calendar void addCalendar( Calendar* ); bool addCalendarFile( QString name, int id ); void setSyncEventsReadOnly(); + void stopAllTodos(); /** Loads a calendar on disk in vCalendar or iCalendar format into the current calendar. Any information already present is lost. diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 9a8b6e4..5260051 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -111,8 +111,8 @@ void Todo::saveRunningInfoToFile() void Todo::saveRunningInfoToFile( QString comment ) { //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); - if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 10 ) { - qDebug("Running time < 30 seconds. Skipped. "); + if ( mRunStart.secsTo ( mRunEnd) < 15 ) { + qDebug("Running time < 15 seconds. Skipped. "); return; } QString dir = KGlobalSettings::timeTrackerDir(); |