author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /libkcal/phoneformat.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | libkcal/phoneformat.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 900fc04..794e4b4 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp | |||
@@ -9,41 +9,42 @@ | |||
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. |
10 | 10 | ||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <qdatetime.h> | 22 | #include <qdatetime.h> |
23 | #include <qstring.h> | 23 | #include <qstring.h> |
24 | #include <qapplication.h> | 24 | #include <qapplication.h> |
25 | #include <qptrlist.h> | 25 | #include <q3ptrlist.h> |
26 | #include <qregexp.h> | 26 | #include <qregexp.h> |
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qclipboard.h> | 28 | #include <qclipboard.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qtextstream.h> | 30 | #include <q3textstream.h> |
31 | #include <qtextcodec.h> | 31 | #include <qtextcodec.h> |
32 | #include <qdir.h> | 32 | #include <qdir.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <QDesktopWidget> | ||
34 | 35 | ||
35 | #include <kdebug.h> | 36 | #include <kdebug.h> |
36 | #include <klocale.h> | 37 | #include <klocale.h> |
37 | #include <kglobal.h> | 38 | #include <kglobal.h> |
38 | #include <kmessagebox.h> | 39 | #include <kmessagebox.h> |
39 | #include <phoneaccess.h> | 40 | #include <phoneaccess.h> |
40 | 41 | ||
41 | #include "calendar.h" | 42 | #include "calendar.h" |
42 | #include "alarm.h" | 43 | #include "alarm.h" |
43 | #include "recurrence.h" | 44 | #include "recurrence.h" |
44 | #include "calendarlocal.h" | 45 | #include "calendarlocal.h" |
45 | 46 | ||
46 | #include "phoneformat.h" | 47 | #include "phoneformat.h" |
47 | #include "syncdefines.h" | 48 | #include "syncdefines.h" |
48 | 49 | ||
49 | using namespace KCal; | 50 | using namespace KCal; |
@@ -188,33 +189,33 @@ ulong PhoneFormat::getCsumEvent( Event* event ) | |||
188 | days += 1 << (i-1); | 189 | days += 1 << (i-1); |
189 | } | 190 | } |
190 | } | 191 | } |
191 | list.append( QString::number( days ) ); | 192 | list.append( QString::number( days ) ); |
192 | } | 193 | } |
193 | //pending weekdays | 194 | //pending weekdays |
194 | writeEndDate = true; | 195 | writeEndDate = true; |
195 | 196 | ||
196 | break; | 197 | break; |
197 | case Recurrence::rMonthlyPos:// 2 | 198 | case Recurrence::rMonthlyPos:// 2 |
198 | list.append( "2" ); | 199 | list.append( "2" ); |
199 | list.append( QString::number( rec->frequency()) );//12 | 200 | list.append( QString::number( rec->frequency()) );//12 |
200 | 201 | ||
201 | writeEndDate = true; | 202 | writeEndDate = true; |
202 | { | 203 | { |
203 | int count = 1; | 204 | int count = 1; |
204 | QPtrList<Recurrence::rMonthPos> rmp; | 205 | Q3PtrList<Recurrence::rMonthPos> rmp; |
205 | rmp = rec->monthPositions(); | 206 | rmp = rec->monthPositions(); |
206 | if ( rmp.first()->negative ) | 207 | if ( rmp.first()->negative ) |
207 | count = 5 - rmp.first()->rPos - 1; | 208 | count = 5 - rmp.first()->rPos - 1; |
208 | else | 209 | else |
209 | count = rmp.first()->rPos - 1; | 210 | count = rmp.first()->rPos - 1; |
210 | list.append( QString::number( count ) ); | 211 | list.append( QString::number( count ) ); |
211 | 212 | ||
212 | } | 213 | } |
213 | 214 | ||
214 | list.append( "0" ); | 215 | list.append( "0" ); |
215 | break; | 216 | break; |
216 | case Recurrence::rMonthlyDay:// 3 | 217 | case Recurrence::rMonthlyDay:// 3 |
217 | list.append( "3" ); | 218 | list.append( "3" ); |
218 | list.append( QString::number( rec->frequency()) );//12 | 219 | list.append( QString::number( rec->frequency()) );//12 |
219 | list.append( "0" ); | 220 | list.append( "0" ); |
220 | list.append( "0" ); | 221 | list.append( "0" ); |
@@ -228,33 +229,33 @@ ulong PhoneFormat::getCsumEvent( Event* event ) | |||
228 | writeEndDate = true; | 229 | writeEndDate = true; |
229 | break; | 230 | break; |
230 | 231 | ||
231 | default: | 232 | default: |
232 | list.append( "255" ); | 233 | list.append( "255" ); |
233 | list.append( QString() ); | 234 | list.append( QString() ); |
234 | list.append( "0" ); | 235 | list.append( "0" ); |
235 | list.append( QString() ); | 236 | list.append( QString() ); |
236 | list.append( "0" ); | 237 | list.append( "0" ); |
237 | list.append( "20991231T000000" ); | 238 | list.append( "20991231T000000" ); |
238 | break; | 239 | break; |
239 | } | 240 | } |
240 | if ( writeEndDate ) { | 241 | if ( writeEndDate ) { |
241 | 242 | ||
242 | if ( rec->endDate().isValid() ) { // 15 + 16 | 243 | if ( rec->endDate().isValid() ) { // 15 + 16 |
243 | list.append( "1" ); | 244 | list.append( "1" ); |
244 | list.append( PhoneParser::dtToString( rec->endDate()) ); | 245 | list.append( PhoneParser::dtToString( (QDateTime)rec->endDate()) ); |
245 | } else { | 246 | } else { |
246 | list.append( "0" ); | 247 | list.append( "0" ); |
247 | list.append( "20991231T000000" ); | 248 | list.append( "20991231T000000" ); |
248 | } | 249 | } |
249 | 250 | ||
250 | } | 251 | } |
251 | attList << list.join(""); | 252 | attList << list.join(""); |
252 | attList << event->categoriesStr(); | 253 | attList << event->categoriesStr(); |
253 | //qDebug("csum cat %s", event->categoriesStr().latin1()); | 254 | //qDebug("csum cat %s", event->categoriesStr().latin1()); |
254 | 255 | ||
255 | attList << event->secrecyStr(); | 256 | attList << event->secrecyStr(); |
256 | return PhoneFormat::getCsum(attList ); | 257 | return PhoneFormat::getCsum(attList ); |
257 | } | 258 | } |
258 | ulong PhoneFormat::getCsum( const QStringList & attList) | 259 | ulong PhoneFormat::getCsum( const QStringList & attList) |
259 | { | 260 | { |
260 | int max = attList.count(); | 261 | int max = attList.count(); |
@@ -292,33 +293,33 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
292 | QString fileName; | 293 | QString fileName; |
293 | #ifdef DESKTOP_VERSION | 294 | #ifdef DESKTOP_VERSION |
294 | fileName = locateLocal("tmp", "phonefile.vcs"); | 295 | fileName = locateLocal("tmp", "phonefile.vcs"); |
295 | #else | 296 | #else |
296 | fileName = "/tmp/phonefile.vcs"; | 297 | fileName = "/tmp/phonefile.vcs"; |
297 | #endif | 298 | #endif |
298 | QString command; | 299 | QString command; |
299 | if ( ! PhoneAccess::readFromPhone( fileName )) { | 300 | if ( ! PhoneAccess::readFromPhone( fileName )) { |
300 | return false; | 301 | return false; |
301 | } | 302 | } |
302 | VCalFormat vfload; | 303 | VCalFormat vfload; |
303 | vfload.setLocalTime ( true ); | 304 | vfload.setLocalTime ( true ); |
304 | qDebug("loading file ..."); | 305 | qDebug("loading file ..."); |
305 | 306 | ||
306 | if ( ! vfload.load( calendar, fileName ) ) | 307 | if ( ! vfload.load( calendar, fileName ) ) |
307 | return false; | 308 | return false; |
308 | QPtrList<Event> er = calendar->rawEvents(); | 309 | Q3PtrList<Event> er = calendar->rawEvents(); |
309 | Event* ev = er.first(); | 310 | Event* ev = er.first(); |
310 | qDebug("reading events... "); | 311 | qDebug("reading events... "); |
311 | while ( ev ) { | 312 | while ( ev ) { |
312 | QStringList cat = ev->categories(); | 313 | QStringList cat = ev->categories(); |
313 | if ( cat.contains( "MeetingDEF" )) { | 314 | if ( cat.contains( "MeetingDEF" )) { |
314 | ev->setCategories( QStringList() ); | 315 | ev->setCategories( QStringList() ); |
315 | } else | 316 | } else |
316 | if ( cat.contains( "Birthday" )) { | 317 | if ( cat.contains( "Birthday" )) { |
317 | ev->setFloats( true ); | 318 | ev->setFloats( true ); |
318 | QDate da = ev->dtStart().date(); | 319 | QDate da = ev->dtStart().date(); |
319 | ev->setDtStart( QDateTime( da) ); | 320 | ev->setDtStart( QDateTime( da) ); |
320 | ev->setDtEnd( QDateTime( da.addDays(1)) ); | 321 | ev->setDtEnd( QDateTime( da.addDays(1)) ); |
321 | 322 | ||
322 | } | 323 | } |
323 | uint cSum; | 324 | uint cSum; |
324 | cSum = PhoneFormat::getCsumEvent( ev ); | 325 | cSum = PhoneFormat::getCsumEvent( ev ); |
@@ -327,33 +328,33 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
327 | event = existingCal->event( mProfileName ,QString::number( id ) ); | 328 | event = existingCal->event( mProfileName ,QString::number( id ) ); |
328 | if ( event ) { | 329 | if ( event ) { |
329 | event = (Event*)event->clone(); | 330 | event = (Event*)event->clone(); |
330 | copyEvent( event, ev ); | 331 | copyEvent( event, ev ); |
331 | calendar->deleteEvent( ev ); | 332 | calendar->deleteEvent( ev ); |
332 | calendar->addEvent( event); | 333 | calendar->addEvent( event); |
333 | } | 334 | } |
334 | else | 335 | else |
335 | event = ev; | 336 | event = ev; |
336 | event->setCsum( mProfileName, QString::number( cSum )); | 337 | event->setCsum( mProfileName, QString::number( cSum )); |
337 | event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); | 338 | event->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); |
338 | event->setID( mProfileName,QString::number( id ) ); | 339 | event->setID( mProfileName,QString::number( id ) ); |
339 | ev = er.next(); | 340 | ev = er.next(); |
340 | } | 341 | } |
341 | { | 342 | { |
342 | qDebug("reading todos... "); | 343 | qDebug("reading todos... "); |
343 | QPtrList<Todo> tr = calendar->rawTodos(); | 344 | Q3PtrList<Todo> tr = calendar->rawTodos(); |
344 | Todo* ev = tr.first(); | 345 | Todo* ev = tr.first(); |
345 | while ( ev ) { | 346 | while ( ev ) { |
346 | 347 | ||
347 | QStringList cat = ev->categories(); | 348 | QStringList cat = ev->categories(); |
348 | if ( cat.contains( "MeetingDEF" )) { | 349 | if ( cat.contains( "MeetingDEF" )) { |
349 | ev->setCategories( QStringList() ); | 350 | ev->setCategories( QStringList() ); |
350 | } | 351 | } |
351 | int id = ev->pilotId(); | 352 | int id = ev->pilotId(); |
352 | uint cSum; | 353 | uint cSum; |
353 | cSum = PhoneFormat::getCsumTodo( ev ); | 354 | cSum = PhoneFormat::getCsumTodo( ev ); |
354 | Todo *event; | 355 | Todo *event; |
355 | event = existingCal->todo( mProfileName ,QString::number( id ) ); | 356 | event = existingCal->todo( mProfileName ,QString::number( id ) ); |
356 | if ( event ) { | 357 | if ( event ) { |
357 | //qDebug("copy todo %s ", event->summary().latin1()); | 358 | //qDebug("copy todo %s ", event->summary().latin1()); |
358 | 359 | ||
359 | event = (Todo*)event->clone(); | 360 | event = (Todo*)event->clone(); |
@@ -452,76 +453,76 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) | |||
452 | to->setCompleted( true ); | 453 | to->setCompleted( true ); |
453 | if( from->completed().isValid() ) | 454 | if( from->completed().isValid() ) |
454 | to->setCompleted( from->completed() ); | 455 | to->setCompleted( from->completed() ); |
455 | } else { | 456 | } else { |
456 | // set percentcomplete only, if to->isCompleted() | 457 | // set percentcomplete only, if to->isCompleted() |
457 | if ( to->isCompleted() ) | 458 | if ( to->isCompleted() ) |
458 | to->setPercentComplete(from->percentComplete()); | 459 | to->setPercentComplete(from->percentComplete()); |
459 | } | 460 | } |
460 | if( to->priority() == 2 && from->priority() == 1 ) | 461 | if( to->priority() == 2 && from->priority() == 1 ) |
461 | ; //skip | 462 | ; //skip |
462 | else if (to->priority() == 4 && from->priority() == 5 ) | 463 | else if (to->priority() == 4 && from->priority() == 5 ) |
463 | ; | 464 | ; |
464 | else | 465 | else |
465 | to->setPriority(from->priority()); | 466 | to->setPriority(from->priority()); |
466 | 467 | ||
467 | } | 468 | } |
468 | #include <qcstring.h> | 469 | #include <q3cstring.h> |
469 | 470 | ||
470 | void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) | 471 | void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) |
471 | { | 472 | { |
472 | inc->setID( mProfileName, id ); | 473 | inc->setID( mProfileName, id ); |
473 | inc->setCsum( mProfileName, csum); | 474 | inc->setCsum( mProfileName, csum); |
474 | inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); | 475 | inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
475 | 476 | ||
476 | } | 477 | } |
477 | 478 | ||
478 | bool PhoneFormat::writeToPhone( Calendar * calendar) | 479 | bool PhoneFormat::writeToPhone( Calendar * calendar) |
479 | { | 480 | { |
480 | #ifdef DESKTOP_VERSION | 481 | #ifdef DESKTOP_VERSION |
481 | QString fileName = locateLocal("tmp", "phonefile.vcs"); | 482 | QString fileName = locateLocal("tmp", "phonefile.vcs"); |
482 | #else | 483 | #else |
483 | QString fileName = "/tmp/phonefile.vcs"; | 484 | QString fileName = "/tmp/phonefile.vcs"; |
484 | #endif | 485 | #endif |
485 | 486 | ||
486 | VCalFormat vfsave; | 487 | VCalFormat vfsave; |
487 | vfsave.setLocalTime ( true ); | 488 | vfsave.setLocalTime ( true ); |
488 | QString id = calendar->timeZoneId(); | 489 | QString id = calendar->timeZoneId(); |
489 | calendar->setLocalTime(); | 490 | calendar->setLocalTime(); |
490 | if ( ! vfsave.save( calendar, fileName ) ) | 491 | if ( ! vfsave.save( calendar, fileName ) ) |
491 | return false; | 492 | return false; |
492 | calendar->setTimeZoneId( id ); | 493 | calendar->setTimeZoneId( id ); |
493 | return PhoneAccess::writeToPhone( fileName ); | 494 | return PhoneAccess::writeToPhone( fileName ); |
494 | } | 495 | } |
495 | bool PhoneFormat::save( Calendar *calendar) | 496 | bool PhoneFormat::save( Calendar *calendar) |
496 | { | 497 | { |
497 | 498 | ||
498 | 499 | ||
499 | // 1 remove events which should be deleted | 500 | // 1 remove events which should be deleted |
500 | QPtrList<Event> er = calendar->rawEvents(); | 501 | Q3PtrList<Event> er = calendar->rawEvents(); |
501 | Event* ev = er.first(); | 502 | Event* ev = er.first(); |
502 | while ( ev ) { | 503 | while ( ev ) { |
503 | if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { | 504 | if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { |
504 | calendar->deleteEvent( ev ); | 505 | calendar->deleteEvent( ev ); |
505 | } else { | 506 | } else { |
506 | 507 | ||
507 | } | 508 | } |
508 | ev = er.next(); | 509 | ev = er.next(); |
509 | } | 510 | } |
510 | // 2 remove todos which should be deleted | 511 | // 2 remove todos which should be deleted |
511 | QPtrList<Todo> tl = calendar->rawTodos(); | 512 | Q3PtrList<Todo> tl = calendar->rawTodos(); |
512 | Todo* to = tl.first(); | 513 | Todo* to = tl.first(); |
513 | while ( to ) { | 514 | while ( to ) { |
514 | if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { | 515 | if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { |
515 | calendar->deleteTodo( to ); | 516 | calendar->deleteTodo( to ); |
516 | } else { | 517 | } else { |
517 | if ( to->isCompleted()) { | 518 | if ( to->isCompleted()) { |
518 | calendar->deleteTodo( to ); | 519 | calendar->deleteTodo( to ); |
519 | } | 520 | } |
520 | } | 521 | } |
521 | to = tl.next(); | 522 | to = tl.next(); |
522 | } | 523 | } |
523 | // 3 save file | 524 | // 3 save file |
524 | if ( !writeToPhone( calendar ) ) | 525 | if ( !writeToPhone( calendar ) ) |
525 | return false; | 526 | return false; |
526 | QLabel status ( i18n(" Opening device ..."), 0 ); | 527 | QLabel status ( i18n(" Opening device ..."), 0 ); |
527 | int w = status.sizeHint().width()+20 ; | 528 | int w = status.sizeHint().width()+20 ; |
@@ -539,61 +540,61 @@ bool PhoneFormat::save( Calendar *calendar) | |||
539 | message = i18n(" Rereading all data ... "); | 540 | message = i18n(" Rereading all data ... "); |
540 | status.setText ( message ); | 541 | status.setText ( message ); |
541 | qApp->processEvents(); | 542 | qApp->processEvents(); |
542 | CalendarLocal* calendarTemp = new CalendarLocal(); | 543 | CalendarLocal* calendarTemp = new CalendarLocal(); |
543 | calendarTemp->setTimeZoneId( calendar->timeZoneId()); | 544 | calendarTemp->setTimeZoneId( calendar->timeZoneId()); |
544 | if ( ! load( calendarTemp,calendar) ){ | 545 | if ( ! load( calendarTemp,calendar) ){ |
545 | qDebug("error reloading calendar "); | 546 | qDebug("error reloading calendar "); |
546 | delete calendarTemp; | 547 | delete calendarTemp; |
547 | return false; | 548 | return false; |
548 | } | 549 | } |
549 | // 6 compare data | 550 | // 6 compare data |
550 | 551 | ||
551 | //algo 6 compare event | 552 | //algo 6 compare event |
552 | er = calendar->rawEvents(); | 553 | er = calendar->rawEvents(); |
553 | ev = er.first(); | 554 | ev = er.first(); |
554 | message = i18n(" Comparing event # "); | 555 | message = i18n(" Comparing event # "); |
555 | QPtrList<Event> er1 = calendarTemp->rawEvents(); | 556 | Q3PtrList<Event> er1 = calendarTemp->rawEvents(); |
556 | Event* ev1; | 557 | Event* ev1; |
557 | int procCount = 0; | 558 | int procCount = 0; |
558 | while ( ev ) { | 559 | while ( ev ) { |
559 | //qDebug("event new ID %s",ev->summary().latin1()); | 560 | //qDebug("event new ID %s",ev->summary().latin1()); |
560 | status.setText ( message + QString::number ( ++procCount ) ); | 561 | status.setText ( message + QString::number ( ++procCount ) ); |
561 | qApp->processEvents(); | 562 | qApp->processEvents(); |
562 | ev1 = er1.first(); | 563 | ev1 = er1.first(); |
563 | while ( ev1 ) { | 564 | while ( ev1 ) { |
564 | if ( ev->contains( ev1 ) ) { | 565 | if ( ev->contains( ev1 ) ) { |
565 | afterSave( ev ,ev1->getID(mProfileName),ev1->getCsum(mProfileName)); | 566 | afterSave( ev ,ev1->getID(mProfileName),ev1->getCsum(mProfileName)); |
566 | er1.remove( ev1 ); | 567 | er1.remove( ev1 ); |
567 | break; | 568 | break; |
568 | } | 569 | } |
569 | ev1 = er1.next(); | 570 | ev1 = er1.next(); |
570 | } | 571 | } |
571 | if ( ! ev1 ) { | 572 | if ( ! ev1 ) { |
572 | // ev->removeID(mProfileName); | 573 | // ev->removeID(mProfileName); |
573 | qDebug("ERROR: No event found on phone for %s ", ev->summary().latin1()); | 574 | qDebug("ERROR: No event found on phone for %s ", ev->summary().latin1()); |
574 | } | 575 | } |
575 | 576 | ||
576 | 577 | ||
577 | ev = er.next(); | 578 | ev = er.next(); |
578 | } | 579 | } |
579 | //algo 6 compare todo | 580 | //algo 6 compare todo |
580 | tl = calendar->rawTodos(); | 581 | tl = calendar->rawTodos(); |
581 | to = tl.first(); | 582 | to = tl.first(); |
582 | procCount = 0; | 583 | procCount = 0; |
583 | QPtrList<Todo> tl1 = calendarTemp->rawTodos(); | 584 | Q3PtrList<Todo> tl1 = calendarTemp->rawTodos(); |
584 | Todo* to1 ; | 585 | Todo* to1 ; |
585 | message = i18n(" Comparing todo # "); | 586 | message = i18n(" Comparing todo # "); |
586 | while ( to ) { | 587 | while ( to ) { |
587 | status.setText ( message + QString::number ( ++procCount ) ); | 588 | status.setText ( message + QString::number ( ++procCount ) ); |
588 | qApp->processEvents(); | 589 | qApp->processEvents(); |
589 | Todo* to1 = tl1.first(); | 590 | Todo* to1 = tl1.first(); |
590 | while ( to1 ) { | 591 | while ( to1 ) { |
591 | if ( to->contains( to1 ) ) { | 592 | if ( to->contains( to1 ) ) { |
592 | afterSave( to ,to1->getID(mProfileName),to1->getCsum(mProfileName)); | 593 | afterSave( to ,to1->getID(mProfileName),to1->getCsum(mProfileName)); |
593 | tl1.remove( to1 ); | 594 | tl1.remove( to1 ); |
594 | break; | 595 | break; |
595 | } | 596 | } |
596 | to1 = tl1.next(); | 597 | to1 = tl1.next(); |
597 | } | 598 | } |
598 | if ( ! to1 ) { | 599 | if ( ! to1 ) { |
599 | //to->removeID(mProfileName); | 600 | //to->removeID(mProfileName); |