-rw-r--r-- | libkcal/todo.cpp | 4 | ||||
-rw-r--r-- | libkcal/todo.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 42274ff..e98af3c 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -83,16 +83,20 @@ void Todo::setRunning( bool run ) | |||
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(); |
diff --git a/libkcal/todo.h b/libkcal/todo.h index 501c2ba..6fc4d4b 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h | |||
@@ -120,17 +120,18 @@ namespace KCal { | |||
120 | bool setRecurDates(); | 120 | bool setRecurDates(); |
121 | bool isRunning() {return mRunning;} | 121 | bool isRunning() {return mRunning;} |
122 | bool hasRunningSub(); | 122 | bool hasRunningSub(); |
123 | void setRunning( bool ); | 123 | void setRunning( bool ); |
124 | void setRunningFalse( QString ); | 124 | void setRunningFalse( QString ); |
125 | int runTime(); | 125 | int runTime(); |
126 | QDateTime runStart () const { return mRunStart;} | 126 | QDateTime runStart () const { return mRunStart;} |
127 | public slots: | 127 | public slots: |
128 | void saveRunningInfoToFile( QString st = QString::null ); | 128 | void saveRunningInfoToFile( QString st ); |
129 | void saveRunningInfoToFile( ); | ||
129 | void saveParents(); | 130 | void saveParents(); |
130 | private: | 131 | private: |
131 | bool mRunning; | 132 | bool mRunning; |
132 | QTimer * mRunSaveTimer; | 133 | QTimer * mRunSaveTimer; |
133 | QDateTime mRunStart; | 134 | QDateTime mRunStart; |
134 | bool accept(Visitor &v) { return v.visit(this); } | 135 | bool accept(Visitor &v) { return v.visit(this); } |
135 | 136 | ||
136 | QDateTime mDtDue; // due date of todo | 137 | QDateTime mDtDue; // due date of todo |