author | zautrix <zautrix> | 2005-09-25 02:28:24 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-09-25 02:28:24 (UTC) |
commit | fa126dfea03b4ebed9a4eed4f2104f93abb72e22 (patch) (unidiff) | |
tree | dab730835ae807e407b928623a85294558d756cb | |
parent | 3bbc14431e854bc3d8870b5ba12d64f6e1af6eb6 (diff) | |
download | kdepimpi-fa126dfea03b4ebed9a4eed4f2104f93abb72e22.zip kdepimpi-fa126dfea03b4ebed9a4eed4f2104f93abb72e22.tar.gz kdepimpi-fa126dfea03b4ebed9a4eed4f2104f93abb72e22.tar.bz2 |
todo timer fix
-rw-r--r-- | korganizer/main.cpp | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 8 | ||||
-rw-r--r-- | libkcal/todo.cpp | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 9410c6a..4a0e24f 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -93,25 +93,25 @@ int main( int argc, char **argv ) | |||
93 | a.showMainWidget(&m ); | 93 | a.showMainWidget(&m ); |
94 | #else | 94 | #else |
95 | a.setMainWidget(&m ); | 95 | a.setMainWidget(&m ); |
96 | m.show(); | 96 | m.show(); |
97 | //m.resize( 800, 600 ); | 97 | //m.resize( 800, 600 ); |
98 | //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 98 | //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
99 | #endif | 99 | #endif |
100 | if ( argc > 1 ) { | 100 | if ( argc > 1 ) { |
101 | QCString command = argv[1]; | 101 | QCString command = argv[1]; |
102 | if ( argc > 2 ) | 102 | if ( argc > 2 ) |
103 | command += argv[2]; | 103 | command += argv[2]; |
104 | m.recieve(command, QByteArray() ); | 104 | m.recieve(command, QByteArray() ); |
105 | 105 | ||
106 | } | 106 | } |
107 | 107 | ||
108 | #ifndef DESKTOP_VERSION | 108 | #ifndef DESKTOP_VERSION |
109 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); | 109 | // QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); |
110 | #endif | 110 | #endif |
111 | a.exec(); | 111 | a.exec(); |
112 | dumpMissing(); | 112 | dumpMissing(); |
113 | 113 | ||
114 | KPimGlobalPrefs::instance()->writeConfig(); | 114 | KPimGlobalPrefs::instance()->writeConfig(); |
115 | } | 115 | } |
116 | qDebug("KO: Bye! "); | 116 | qDebug("KO: Bye! "); |
117 | } | 117 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 05e5087..c597138 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -2043,33 +2043,33 @@ void MainWindow::save() | |||
2043 | mSaveTimerStart = QDateTime::currentDateTime(); | 2043 | mSaveTimerStart = QDateTime::currentDateTime(); |
2044 | mSaveDelay = msec/1000; | 2044 | mSaveDelay = msec/1000; |
2045 | return; | 2045 | return; |
2046 | } | 2046 | } |
2047 | } | 2047 | } |
2048 | if ( mView->viewManager()->journalView() ) | 2048 | if ( mView->viewManager()->journalView() ) |
2049 | mView->viewManager()->journalView()->checkModified(); | 2049 | mView->viewManager()->journalView()->checkModified(); |
2050 | if ( !mCalendarModifiedFlag ) { | 2050 | if ( !mCalendarModifiedFlag ) { |
2051 | qDebug("KO: Calendar not modified. Nothing saved."); | 2051 | qDebug("KO: Calendar not modified. Nothing saved."); |
2052 | return; | 2052 | return; |
2053 | } | 2053 | } |
2054 | if ( mSyncManager->blockSave() ) { | 2054 | if ( mSyncManager->blockSave() ) { |
2055 | slotModifiedChanged( true ); | 2055 | slotModifiedChanged( true ); |
2056 | return; | 2056 | return; |
2057 | } | 2057 | } |
2058 | #ifndef DESKTOP_VERSION | 2058 | #ifndef DESKTOP_VERSION |
2059 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); | 2059 | // QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); |
2060 | #endif | 2060 | #endif |
2061 | mSaveDelay = 0; | 2061 | mSaveDelay = 0; |
2062 | mSyncManager->setBlockSave(true); | 2062 | mSyncManager->setBlockSave(true); |
2063 | if ( mView->checkAllFileVersions() ) { | 2063 | if ( mView->checkAllFileVersions() ) { |
2064 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ | 2064 | if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ |
2065 | QDate reference ( 2000,1,1); | 2065 | QDate reference ( 2000,1,1); |
2066 | int daysTo = reference.daysTo ( QDate::currentDate() ); | 2066 | int daysTo = reference.daysTo ( QDate::currentDate() ); |
2067 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { | 2067 | if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { |
2068 | backupAllFiles(); | 2068 | backupAllFiles(); |
2069 | } | 2069 | } |
2070 | ; // KPimGlobalPrefs::instance()->mLastBackupDate | 2070 | ; // KPimGlobalPrefs::instance()->mLastBackupDate |
2071 | } | 2071 | } |
2072 | QTime neededSaveTime; | 2072 | QTime neededSaveTime; |
2073 | neededSaveTime.start(); | 2073 | neededSaveTime.start(); |
2074 | if ( !isMinimized () ) | 2074 | if ( !isMinimized () ) |
2075 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 2075 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
@@ -2078,33 +2078,33 @@ void MainWindow::save() | |||
2078 | mCalendarModifiedFlag = false; | 2078 | mCalendarModifiedFlag = false; |
2079 | int msNeeded = neededSaveTime.elapsed(); | 2079 | int msNeeded = neededSaveTime.elapsed(); |
2080 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 2080 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
2081 | QString savemes; | 2081 | QString savemes; |
2082 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 2082 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
2083 | if ( !isMinimized () ) | 2083 | if ( !isMinimized () ) |
2084 | setCaption(savemes); | 2084 | setCaption(savemes); |
2085 | else | 2085 | else |
2086 | qDebug(savemes); | 2086 | qDebug(savemes); |
2087 | } else { | 2087 | } else { |
2088 | setCaption(i18n("Saving cancelled!")); | 2088 | setCaption(i18n("Saving cancelled!")); |
2089 | mCalendarModifiedFlag = false; | 2089 | mCalendarModifiedFlag = false; |
2090 | slotModifiedChanged( true ); | 2090 | slotModifiedChanged( true ); |
2091 | } | 2091 | } |
2092 | mSyncManager->setBlockSave( false ); | 2092 | mSyncManager->setBlockSave( false ); |
2093 | #ifndef DESKTOP_VERSION | 2093 | #ifndef DESKTOP_VERSION |
2094 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); | 2094 | //QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); |
2095 | #endif | 2095 | #endif |
2096 | } | 2096 | } |
2097 | 2097 | ||
2098 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 2098 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
2099 | { | 2099 | { |
2100 | if ( !e->isAutoRepeat() ) { | 2100 | if ( !e->isAutoRepeat() ) { |
2101 | mFlagKeyPressed = false; | 2101 | mFlagKeyPressed = false; |
2102 | } | 2102 | } |
2103 | } | 2103 | } |
2104 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 2104 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
2105 | { | 2105 | { |
2106 | qApp->processEvents(); | 2106 | qApp->processEvents(); |
2107 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 2107 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
2108 | e->ignore(); | 2108 | e->ignore(); |
2109 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 2109 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
2110 | return; | 2110 | return; |
@@ -2499,38 +2499,38 @@ void MainWindow::configureAgenda( int item ) | |||
2499 | } | 2499 | } |
2500 | 2500 | ||
2501 | void MainWindow::saveCalendar() | 2501 | void MainWindow::saveCalendar() |
2502 | { | 2502 | { |
2503 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2503 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
2504 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 2504 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
2505 | bupDir = KGlobalSettings::backupDataDir(); | 2505 | bupDir = KGlobalSettings::backupDataDir(); |
2506 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); | 2506 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); |
2507 | QString bupHint; | 2507 | QString bupHint; |
2508 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) | 2508 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) |
2509 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); | 2509 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); |
2510 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; | 2510 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; |
2511 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; | 2511 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; |
2512 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 2512 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
2513 | save(); | 2513 | save(); |
2514 | #ifndef DESKTOP_VERSION | 2514 | #ifndef DESKTOP_VERSION |
2515 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); | 2515 | //QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); |
2516 | #endif | 2516 | #endif |
2517 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; | 2517 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; |
2518 | backupAllFiles(); | 2518 | backupAllFiles(); |
2519 | #ifndef DESKTOP_VERSION | 2519 | #ifndef DESKTOP_VERSION |
2520 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); | 2520 | //QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); |
2521 | #endif | 2521 | #endif |
2522 | } | 2522 | } |
2523 | void MainWindow::loadCalendar() | 2523 | void MainWindow::loadCalendar() |
2524 | { | 2524 | { |
2525 | 2525 | ||
2526 | 2526 | ||
2527 | #if 0 | 2527 | #if 0 |
2528 | QString fn = KOPrefs::instance()->mLastLoadFile; | 2528 | QString fn = KOPrefs::instance()->mLastLoadFile; |
2529 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 2529 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
2530 | 2530 | ||
2531 | if ( fn == "" ) | 2531 | if ( fn == "" ) |
2532 | return; | 2532 | return; |
2533 | QFileInfo info; | 2533 | QFileInfo info; |
2534 | info.setFile( fn ); | 2534 | info.setFile( fn ); |
2535 | QString mess; | 2535 | QString mess; |
2536 | bool loadbup = true; | 2536 | bool loadbup = true; |
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 70a7711..29f725f 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -142,33 +142,33 @@ void Todo::timerSlotSaveRunningInfoToFile() | |||
142 | if ( msecs > ( ( mCurrentTimerDelay * 1000 ) + 50 )) { | 142 | if ( msecs > ( ( mCurrentTimerDelay * 1000 ) + 50 )) { |
143 | qDebug("KO Todo::saveTimerTimeout restarting! millisecs %d", msecs - ( ( mCurrentTimerDelay * 1000 ) + 50 ) ); | 143 | qDebug("KO Todo::saveTimerTimeout restarting! millisecs %d", msecs - ( ( mCurrentTimerDelay * 1000 ) + 50 ) ); |
144 | restartSaveTimer( SAVETIMER_TIMEOUT_RETRY_SECONDS ); | 144 | restartSaveTimer( SAVETIMER_TIMEOUT_RETRY_SECONDS ); |
145 | return; | 145 | return; |
146 | } | 146 | } |
147 | restartSaveTimer( SAVETIMER_TIMEOUT_SECONDS ); | 147 | restartSaveTimer( SAVETIMER_TIMEOUT_SECONDS ); |
148 | saveRunningInfoToFile( QString::null ); | 148 | saveRunningInfoToFile( QString::null ); |
149 | } | 149 | } |
150 | void Todo::saveRunningInfoToFile() | 150 | void Todo::saveRunningInfoToFile() |
151 | { | 151 | { |
152 | mRunEnd = QDateTime::currentDateTime(); | 152 | mRunEnd = QDateTime::currentDateTime(); |
153 | saveRunningInfoToFile( QString::null ); | 153 | saveRunningInfoToFile( QString::null ); |
154 | } | 154 | } |
155 | void Todo::saveRunningInfoToFile( QString comment ) | 155 | void Todo::saveRunningInfoToFile( QString comment ) |
156 | { | 156 | { |
157 | #ifndef DESKTOP_VERSION | 157 | #ifndef DESKTOP_VERSION |
158 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); | 158 | //QPEApplication::setTempScreenSaverMode ( QPEApplication::Disable ); |
159 | #endif | 159 | #endif |
160 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); | 160 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); |
161 | if ( mRunStart.secsTo ( mRunEnd) < 15 ) { | 161 | if ( mRunStart.secsTo ( mRunEnd) < 15 ) { |
162 | qDebug("Running time < 15 seconds. Skipped. "); | 162 | qDebug("Running time < 15 seconds. Skipped. "); |
163 | return; | 163 | return; |
164 | } | 164 | } |
165 | QString dir = KGlobalSettings::timeTrackerDir(); | 165 | QString dir = KGlobalSettings::timeTrackerDir(); |
166 | //qDebug("%s ", dir.latin1()); | 166 | //qDebug("%s ", dir.latin1()); |
167 | QString file = "%1%2%3-%4%5%6-"; | 167 | QString file = "%1%2%3-%4%5%6-"; |
168 | 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 ); | 168 | 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 ); |
169 | file.replace ( QRegExp (" "), "0" ); | 169 | file.replace ( QRegExp (" "), "0" ); |
170 | file += uid(); | 170 | file += uid(); |
171 | //qDebug("File %s ",file.latin1() ); | 171 | //qDebug("File %s ",file.latin1() ); |
172 | CalendarLocal cal; | 172 | CalendarLocal cal; |
173 | cal.setLocalTime(); | 173 | cal.setLocalTime(); |
174 | Todo * to = (Todo*) clone(); | 174 | Todo * to = (Todo*) clone(); |
@@ -178,33 +178,33 @@ void Todo::saveRunningInfoToFile( QString comment ) | |||
178 | to->setDtDue( mRunEnd ); | 178 | to->setDtDue( mRunEnd ); |
179 | to->setHasDueDate( true ); | 179 | to->setHasDueDate( true ); |
180 | to->setUid( file ); | 180 | to->setUid( file ); |
181 | if ( !comment.isEmpty() ) { | 181 | if ( !comment.isEmpty() ) { |
182 | QString des = to->description(); | 182 | QString des = to->description(); |
183 | if ( des.isEmpty () ) | 183 | if ( des.isEmpty () ) |
184 | to->setDescription( "TT-Note: " + comment ); | 184 | to->setDescription( "TT-Note: " + comment ); |
185 | else | 185 | else |
186 | to->setDescription( "TT-Note: " + comment +"\n" + des ); | 186 | to->setDescription( "TT-Note: " + comment +"\n" + des ); |
187 | } | 187 | } |
188 | cal.addIncidence( to ); | 188 | cal.addIncidence( to ); |
189 | ICalFormat format( false ); | 189 | ICalFormat format( false ); |
190 | file = dir +"/" +file +".ics"; | 190 | file = dir +"/" +file +".ics"; |
191 | format.save( &cal, file ); | 191 | format.save( &cal, file ); |
192 | saveParents(); | 192 | saveParents(); |
193 | #ifndef DESKTOP_VERSION | 193 | #ifndef DESKTOP_VERSION |
194 | QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); | 194 | //QPEApplication::setTempScreenSaverMode ( QPEApplication::Enable ); |
195 | #endif | 195 | #endif |
196 | } | 196 | } |
197 | void Todo::saveParents() | 197 | void Todo::saveParents() |
198 | { | 198 | { |
199 | if (!relatedTo() ) | 199 | if (!relatedTo() ) |
200 | return; | 200 | return; |
201 | Incidence * inc = relatedTo(); | 201 | Incidence * inc = relatedTo(); |
202 | if ( inc->typeID() != todoID ) | 202 | if ( inc->typeID() != todoID ) |
203 | return; | 203 | return; |
204 | Todo* to = (Todo*)inc; | 204 | Todo* to = (Todo*)inc; |
205 | bool saveTodo = false; | 205 | bool saveTodo = false; |
206 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; | 206 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; |
207 | QFileInfo fi ( file ); | 207 | QFileInfo fi ( file ); |
208 | if ( fi.exists() ) { | 208 | if ( fi.exists() ) { |
209 | if ( fi.lastModified () < to->lastModified ()) | 209 | if ( fi.lastModified () < to->lastModified ()) |
210 | saveTodo = true; | 210 | saveTodo = true; |