author | zautrix <zautrix> | 2005-09-25 02:09:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-09-25 02:09:22 (UTC) |
commit | 3bbc14431e854bc3d8870b5ba12d64f6e1af6eb6 (patch) (unidiff) | |
tree | 0d88d48dc1b9198c9c2deed6b55c70deffcfeadd /libkcal | |
parent | 181bc87d92ecc48cb07c288cb2d135d8fde56716 (diff) | |
download | kdepimpi-3bbc14431e854bc3d8870b5ba12d64f6e1af6eb6.zip kdepimpi-3bbc14431e854bc3d8870b5ba12d64f6e1af6eb6.tar.gz kdepimpi-3bbc14431e854bc3d8870b5ba12d64f6e1af6eb6.tar.bz2 |
todo timer fix
-rw-r--r-- | libkcal/todo.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index f7d40ad..70a7711 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -26,12 +26,16 @@ | |||
26 | #include <qfileinfo.h> | 26 | #include <qfileinfo.h> |
27 | 27 | ||
28 | #include "calendarlocal.h" | 28 | #include "calendarlocal.h" |
29 | #include "icalformat.h" | 29 | #include "icalformat.h" |
30 | #include "todo.h" | 30 | #include "todo.h" |
31 | 31 | ||
32 | #ifndef DESKTOP_VERSION | ||
33 | #include <qpe/qpeapplication.h> | ||
34 | #endif | ||
35 | |||
32 | #define SAVETIMER_TIMEOUT_SECONDS 300 | 36 | #define SAVETIMER_TIMEOUT_SECONDS 300 |
33 | //#define SAVETIMER_TIMEOUT_SECONDS 8 | 37 | //#define SAVETIMER_TIMEOUT_SECONDS 8 |
34 | #define SAVETIMER_TIMEOUT_RETRY_SECONDS 5 | 38 | #define SAVETIMER_TIMEOUT_RETRY_SECONDS 5 |
35 | 39 | ||
36 | using namespace KCal; | 40 | using namespace KCal; |
37 | 41 | ||
@@ -136,24 +140,26 @@ void Todo::timerSlotSaveRunningInfoToFile() | |||
136 | } | 140 | } |
137 | // qDebug("KO Todo::saveTimerTimeout restarting! millisecs %d", msecs - ( ( mCurrentTimerDelay * 1000 ) + 50 ) ); | 141 | // qDebug("KO Todo::saveTimerTimeout restarting! millisecs %d", msecs - ( ( mCurrentTimerDelay * 1000 ) + 50 ) ); |
138 | if ( msecs > ( ( mCurrentTimerDelay * 1000 ) + 50 )) { | 142 | if ( msecs > ( ( mCurrentTimerDelay * 1000 ) + 50 )) { |
139 | qDebug("KO Todo::saveTimerTimeout restarting! millisecs %d", msecs - ( ( mCurrentTimerDelay * 1000 ) + 50 ) ); | 143 | qDebug("KO Todo::saveTimerTimeout restarting! millisecs %d", msecs - ( ( mCurrentTimerDelay * 1000 ) + 50 ) ); |
140 | restartSaveTimer( SAVETIMER_TIMEOUT_RETRY_SECONDS ); | 144 | restartSaveTimer( SAVETIMER_TIMEOUT_RETRY_SECONDS ); |
141 | return; | 145 | return; |
142 | |||
143 | } | 146 | } |
144 | restartSaveTimer( SAVETIMER_TIMEOUT_SECONDS ); | 147 | restartSaveTimer( SAVETIMER_TIMEOUT_SECONDS ); |
145 | saveRunningInfoToFile( QString::null ); | 148 | saveRunningInfoToFile( QString::null ); |
146 | } | 149 | } |
147 | void Todo::saveRunningInfoToFile() | 150 | void Todo::saveRunningInfoToFile() |
148 | { | 151 | { |
149 | mRunEnd = QDateTime::currentDateTime(); | 152 | mRunEnd = QDateTime::currentDateTime(); |
150 | saveRunningInfoToFile( QString::null ); | 153 | saveRunningInfoToFile( QString::null ); |
151 | } | 154 | } |
152 | void Todo::saveRunningInfoToFile( QString comment ) | 155 | void Todo::saveRunningInfoToFile( QString comment ) |
153 | { | 156 | { |
157 | #ifndef DESKTOP_VERSION | ||
158 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); | ||
159 | #endif | ||
154 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); | 160 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); |
155 | if ( mRunStart.secsTo ( mRunEnd) < 15 ) { | 161 | if ( mRunStart.secsTo ( mRunEnd) < 15 ) { |
156 | qDebug("Running time < 15 seconds. Skipped. "); | 162 | qDebug("Running time < 15 seconds. Skipped. "); |
157 | return; | 163 | return; |
158 | } | 164 | } |
159 | QString dir = KGlobalSettings::timeTrackerDir(); | 165 | QString dir = KGlobalSettings::timeTrackerDir(); |
@@ -181,13 +187,15 @@ void Todo::saveRunningInfoToFile( QString comment ) | |||
181 | } | 187 | } |
182 | cal.addIncidence( to ); | 188 | cal.addIncidence( to ); |
183 | ICalFormat format( false ); | 189 | ICalFormat format( false ); |
184 | file = dir +"/" +file +".ics"; | 190 | file = dir +"/" +file +".ics"; |
185 | format.save( &cal, file ); | 191 | format.save( &cal, file ); |
186 | saveParents(); | 192 | saveParents(); |
187 | 193 | #ifndef DESKTOP_VERSION | |
194 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); | ||
195 | #endif | ||
188 | } | 196 | } |
189 | void Todo::saveParents() | 197 | void Todo::saveParents() |
190 | { | 198 | { |
191 | if (!relatedTo() ) | 199 | if (!relatedTo() ) |
192 | return; | 200 | return; |
193 | Incidence * inc = relatedTo(); | 201 | Incidence * inc = relatedTo(); |