author | zautrix <zautrix> | 2004-10-15 14:26:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-15 14:26:07 (UTC) |
commit | 4f276d80bd977401d656851515474cc00c661e5b (patch) (unidiff) | |
tree | 0d3a747bef0431ef791b69876f5bda554f9ca83f /libkcal | |
parent | c2fb960297c4b08980921c818a4d347057732390 (diff) | |
download | kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.zip kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.gz kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.bz2 |
many phone and sync fixes
-rw-r--r-- | libkcal/event.cpp | 46 | ||||
-rw-r--r-- | libkcal/event.h | 2 | ||||
-rw-r--r-- | libkcal/phoneformat.cpp | 104 | ||||
-rw-r--r-- | libkcal/phoneformat.h | 2 | ||||
-rw-r--r-- | libkcal/todo.cpp | 58 | ||||
-rw-r--r-- | libkcal/todo.h | 1 | ||||
-rw-r--r-- | libkcal/vcalformat.cpp | 141 |
7 files changed, 227 insertions, 127 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index dfa265b..7256f05 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -58,2 +58,48 @@ bool KCal::operator==( const Event& e1, const Event& e2 ) | |||
58 | 58 | ||
59 | bool Event::contains ( Event* from ) | ||
60 | { | ||
61 | |||
62 | if ( !from->summary().isEmpty() ) | ||
63 | if ( !summary().startsWith( from->summary() )) | ||
64 | return false; | ||
65 | if ( from->dtStart().isValid() ) | ||
66 | if (dtStart() != from->dtStart() ) | ||
67 | return false; | ||
68 | if ( from->dtEnd().isValid() ) | ||
69 | if ( dtEnd() != from->dtEnd() ) | ||
70 | return false; | ||
71 | if ( !from->location().isEmpty() ) | ||
72 | if ( !location().startsWith( from->location() ) ) | ||
73 | return false; | ||
74 | if ( !from->description().isEmpty() ) | ||
75 | if ( !description().startsWith( from->description() )) | ||
76 | return false; | ||
77 | if ( from->alarms().count() ) { | ||
78 | Alarm *a = from->alarms().first(); | ||
79 | if ( a->enabled() ){ | ||
80 | if ( !alarms().count() ) | ||
81 | return false; | ||
82 | Alarm *b = alarms().first(); | ||
83 | if( ! b->enabled() ) | ||
84 | return false; | ||
85 | if ( ! (a->offset() == b->offset() )) | ||
86 | return false; | ||
87 | } | ||
88 | } | ||
89 | QStringList cat = categories(); | ||
90 | QStringList catFrom = from->categories(); | ||
91 | QString nCat; | ||
92 | int iii; | ||
93 | for ( iii = 0; iii < catFrom.count();++iii ) { | ||
94 | nCat = catFrom[iii]; | ||
95 | if ( !nCat.isEmpty() ) | ||
96 | if ( !cat.contains( nCat )) { | ||
97 | return false; | ||
98 | } | ||
99 | } | ||
100 | if ( from->doesRecur() ) | ||
101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) | ||
102 | return false; | ||
103 | return true; | ||
104 | } | ||
59 | 105 | ||
diff --git a/libkcal/event.h b/libkcal/event.h index 2a8bd95..3bc8adc 100644 --- a/libkcal/event.h +++ b/libkcal/event.h | |||
@@ -73,2 +73,4 @@ class Event : public Incidence | |||
73 | 73 | ||
74 | bool contains ( Event*); | ||
75 | |||
74 | private: | 76 | private: |
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 281434e..101db57 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp | |||
@@ -314,3 +314,12 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
314 | ev->setCategories( QStringList() ); | 314 | ev->setCategories( QStringList() ); |
315 | } else | ||
316 | if ( cat.contains( "Birthday" )) { | ||
317 | ev->setFloats( true ); | ||
318 | QDate da = ev->dtStart().date(); | ||
319 | ev->setDtStart( QDateTime( da) ); | ||
320 | ev->setDtEnd( QDateTime( da.addDays(1)) ); | ||
321 | |||
315 | } | 322 | } |
323 | uint cSum; | ||
324 | cSum = PhoneFormat::getCsumEvent( ev ); | ||
316 | int id = ev->pilotId(); | 325 | int id = ev->pilotId(); |
@@ -326,4 +335,2 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
326 | event = ev; | 335 | event = ev; |
327 | uint cSum; | ||
328 | cSum = PhoneFormat::getCsumEvent( event ); | ||
329 | event->setCsum( mProfileName, QString::number( cSum )); | 336 | event->setCsum( mProfileName, QString::number( cSum )); |
@@ -344,2 +351,4 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
344 | int id = ev->pilotId(); | 351 | int id = ev->pilotId(); |
352 | uint cSum; | ||
353 | cSum = PhoneFormat::getCsumTodo( ev ); | ||
345 | Todo *event; | 354 | Todo *event; |
@@ -356,4 +365,2 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
356 | event = ev; | 365 | event = ev; |
357 | uint cSum; | ||
358 | cSum = PhoneFormat::getCsumTodo( event ); | ||
359 | event->setCsum( mProfileName, QString::number( cSum )); | 366 | event->setCsum( mProfileName, QString::number( cSum )); |
@@ -384,7 +391,3 @@ void PhoneFormat::copyEvent( Event* to, Event* from ) | |||
384 | b->setEnabled( a->enabled() ); | 391 | b->setEnabled( a->enabled() ); |
385 | if ( a->hasStartOffset() ) { | 392 | b->setStartOffset(Duration( a->offset() ) ); |
386 | b->setStartOffset( a->startOffset() ); | ||
387 | } | ||
388 | if ( a->hasTime() ) | ||
389 | b->setTime( a->time() ); | ||
390 | 393 | ||
@@ -403,4 +406,6 @@ void PhoneFormat::copyEvent( Event* to, Event* from ) | |||
403 | to->setCategories( cat ); | 406 | to->setCategories( cat ); |
404 | Recurrence * r = new Recurrence( *from->recurrence(),to); | 407 | if ( from->doesRecur() ) { |
405 | to->setRecurrence( r ) ; | 408 | Recurrence * r = new Recurrence( *from->recurrence(),to); |
409 | to->setRecurrence( r ) ; | ||
410 | } | ||
406 | 411 | ||
@@ -410,6 +415,10 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) | |||
410 | { | 415 | { |
411 | if ( from->dtStart().isValid() ) | 416 | if ( from->hasStartDate() ) { |
417 | to->setHasStartDate( true ); | ||
412 | to->setDtStart( from->dtStart() ); | 418 | to->setDtStart( from->dtStart() ); |
413 | if ( from->dtDue().isValid() ) | 419 | } |
420 | if ( from->hasDueDate() ){ | ||
421 | to->setHasDueDate( true ); | ||
414 | to->setDtDue( from->dtDue() ); | 422 | to->setDtDue( from->dtDue() ); |
423 | } | ||
415 | if ( !from->location().isEmpty() ) | 424 | if ( !from->location().isEmpty() ) |
@@ -426,6 +435,3 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) | |||
426 | b->setEnabled( a->enabled() ); | 435 | b->setEnabled( a->enabled() ); |
427 | if ( a->hasStartOffset() ) | 436 | b->setStartOffset(Duration( a->offset() ) ); |
428 | b->setStartOffset( a->startOffset() ); | ||
429 | if ( a->hasTime() ) | ||
430 | b->setTime( a->time() ); | ||
431 | } | 437 | } |
@@ -463,12 +469,6 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) | |||
463 | 469 | ||
464 | void PhoneFormat::afterSave( Incidence* inc) | 470 | void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) |
465 | { | 471 | { |
466 | uint csum; | 472 | inc->setID( mProfileName, id ); |
467 | inc->removeID( mProfileName ); | 473 | inc->setCsum( mProfileName, csum); |
468 | if ( inc->type() == "Event") | ||
469 | csum = PhoneFormat::getCsumEvent( (Event*) inc ); | ||
470 | else | ||
471 | csum = PhoneFormat::getCsumTodo( (Todo*) inc ); | ||
472 | inc->setCsum( mProfileName, QString::number( csum )); | ||
473 | |||
474 | inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); | 474 | inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
@@ -480,5 +480,5 @@ bool PhoneFormat::writeToPhone( Calendar * calendar) | |||
480 | #ifdef _WIN32_ | 480 | #ifdef _WIN32_ |
481 | QString fileName = locateLocal("tmp", "tempfile.vcs"); | 481 | QString fileName = locateLocal("tmp", "phonefile.vcs"); |
482 | #else | 482 | #else |
483 | QString fileName = "/tmp/kdepimtemp.vcs"; | 483 | QString fileName = "/tmp/phonefile.vcs"; |
484 | #endif | 484 | #endif |
@@ -496,14 +496,3 @@ bool PhoneFormat::save( Calendar *calendar) | |||
496 | { | 496 | { |
497 | QLabel status ( i18n(" Opening device ..."), 0 ); | 497 | |
498 | int w = status.sizeHint().width()+20 ; | ||
499 | if ( w < 200 ) w = 230; | ||
500 | int h = status.sizeHint().height()+20 ; | ||
501 | int dw = QApplication::desktop()->width(); | ||
502 | int dh = QApplication::desktop()->height(); | ||
503 | status.setCaption(i18n("Writing to phone...") ); | ||
504 | status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
505 | status.show(); | ||
506 | status.raise(); | ||
507 | qApp->processEvents(); | ||
508 | QString message; | ||
509 | 498 | ||
@@ -536,3 +525,14 @@ bool PhoneFormat::save( Calendar *calendar) | |||
536 | return false; | 525 | return false; |
537 | 526 | QLabel status ( i18n(" Opening device ..."), 0 ); | |
527 | int w = status.sizeHint().width()+20 ; | ||
528 | if ( w < 200 ) w = 230; | ||
529 | int h = status.sizeHint().height()+20 ; | ||
530 | int dw = QApplication::desktop()->width(); | ||
531 | int dh = QApplication::desktop()->height(); | ||
532 | status.setCaption(i18n("Writing to phone...") ); | ||
533 | status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
534 | QString message; | ||
535 | status.show(); | ||
536 | status.raise(); | ||
537 | qApp->processEvents(); | ||
538 | // 5 reread data | 538 | // 5 reread data |
@@ -561,15 +561,7 @@ bool PhoneFormat::save( Calendar *calendar) | |||
561 | qApp->processEvents(); | 561 | qApp->processEvents(); |
562 | uint csum; | ||
563 | csum = PhoneFormat::getCsumEvent( ev ); | ||
564 | QString cSum = QString::number( csum ); | ||
565 | //ev->setCsum( mProfileName, cSum ); | ||
566 | //qDebug("Event cSum %s ", cSum.latin1()); | ||
567 | ev1 = er1.first(); | 562 | ev1 = er1.first(); |
568 | while ( ev1 ) { | 563 | while ( ev1 ) { |
569 | if ( ev1->getCsum( mProfileName ) == cSum ) { | 564 | if ( ev->contains( ev1 ) ) { |
565 | afterSave( ev ,ev1->getID(mProfileName),ev1->getCsum(mProfileName)); | ||
570 | er1.remove( ev1 ); | 566 | er1.remove( ev1 ); |
571 | afterSave( ev ); | ||
572 | ev->setID(mProfileName, ev1->getID(mProfileName) ); | ||
573 | //qDebug("Event found on phone for %s ", ev->summary().latin1()); | ||
574 | |||
575 | break; | 567 | break; |
@@ -596,13 +588,7 @@ bool PhoneFormat::save( Calendar *calendar) | |||
596 | qApp->processEvents(); | 588 | qApp->processEvents(); |
597 | uint csum; | ||
598 | csum = PhoneFormat::getCsumTodo( to ); | ||
599 | QString cSum = QString::number( csum ); | ||
600 | //to->setCsum( mProfileName, cSum ); | ||
601 | //qDebug("Todo cSum %s ", cSum.latin1()); | ||
602 | Todo* to1 = tl1.first(); | 589 | Todo* to1 = tl1.first(); |
603 | while ( to1 ) { | 590 | while ( to1 ) { |
604 | if ( to1->getCsum( mProfileName ) == cSum ) { | 591 | if ( to->contains( to1 ) ) { |
592 | afterSave( to ,to1->getID(mProfileName),to1->getCsum(mProfileName)); | ||
605 | tl1.remove( to1 ); | 593 | tl1.remove( to1 ); |
606 | afterSave( to ); | ||
607 | to->setID(mProfileName, to1->getID(mProfileName) ); | ||
608 | break; | 594 | break; |
diff --git a/libkcal/phoneformat.h b/libkcal/phoneformat.h index 001fd81..d11f68b 100644 --- a/libkcal/phoneformat.h +++ b/libkcal/phoneformat.h | |||
@@ -56,3 +56,3 @@ class PhoneFormat : public QObject { | |||
56 | QString mProfileName; | 56 | QString mProfileName; |
57 | void afterSave( Incidence* ); | 57 | void afterSave( Incidence* ,const QString&,const QString&); |
58 | }; | 58 | }; |
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 0c1e3e4..3d2de61 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -58,3 +58,61 @@ Incidence *Todo::clone() | |||
58 | 58 | ||
59 | bool Todo::contains ( Todo* from ) | ||
60 | { | ||
59 | 61 | ||
62 | if ( !from->summary().isEmpty() ) | ||
63 | if ( !summary().startsWith( from->summary() )) | ||
64 | return false; | ||
65 | if ( from->hasStartDate() ) { | ||
66 | if ( !hasStartDate() ) | ||
67 | return false; | ||
68 | if ( from->dtStart() != dtStart()) | ||
69 | return false; | ||
70 | } | ||
71 | if ( from->hasDueDate() ){ | ||
72 | if ( !hasDueDate() ) | ||
73 | return false; | ||
74 | if ( from->dtDue() != dtDue()) | ||
75 | return false; | ||
76 | } | ||
77 | if ( !from->location().isEmpty() ) | ||
78 | if ( !location().startsWith( from->location() ) ) | ||
79 | return false; | ||
80 | if ( !from->description().isEmpty() ) | ||
81 | if ( !description().startsWith( from->description() )) | ||
82 | return false; | ||
83 | if ( from->alarms().count() ) { | ||
84 | Alarm *a = from->alarms().first(); | ||
85 | if ( a->enabled() ){ | ||
86 | if ( !alarms().count() ) | ||
87 | return false; | ||
88 | Alarm *b = alarms().first(); | ||
89 | if( ! b->enabled() ) | ||
90 | return false; | ||
91 | if ( ! (a->offset() == b->offset() )) | ||
92 | return false; | ||
93 | } | ||
94 | } | ||
95 | |||
96 | QStringList cat = categories(); | ||
97 | QStringList catFrom = from->categories(); | ||
98 | QString nCat; | ||
99 | int iii; | ||
100 | for ( iii = 0; iii < catFrom.count();++iii ) { | ||
101 | nCat = catFrom[iii]; | ||
102 | if ( !nCat.isEmpty() ) | ||
103 | if ( !cat.contains( nCat )) { | ||
104 | return false; | ||
105 | } | ||
106 | } | ||
107 | if ( from->isCompleted() ) { | ||
108 | if ( !isCompleted() ) | ||
109 | return false; | ||
110 | } | ||
111 | if( priority() != from->priority() ) | ||
112 | return false; | ||
113 | |||
114 | |||
115 | return true; | ||
116 | |||
117 | } | ||
60 | bool KCal::operator==( const Todo& t1, const Todo& t2 ) | 118 | bool KCal::operator==( const Todo& t1, const Todo& t2 ) |
diff --git a/libkcal/todo.h b/libkcal/todo.h index 9aa92f8..0f22c59 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h | |||
@@ -101,2 +101,3 @@ class Todo : public Incidence | |||
101 | bool hasCompletedDate() const; | 101 | bool hasCompletedDate() const; |
102 | bool contains ( Todo*); | ||
102 | 103 | ||
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index a6ae1bc..df93209 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp | |||
@@ -64,3 +64,4 @@ bool VCalFormat::load(Calendar *calendar, const QString &fileName) | |||
64 | clearException(); | 64 | clearException(); |
65 | useLocalTime = mCalendar->isLocalTime(); | 65 | if ( ! useLocalTime ) |
66 | useLocalTime = mCalendar->isLocalTime(); | ||
66 | VObject *vcal = 0; | 67 | VObject *vcal = 0; |
@@ -92,3 +93,4 @@ bool VCalFormat::save(Calendar *calendar, const QString &fileName) | |||
92 | mCalendar = calendar; | 93 | mCalendar = calendar; |
93 | useLocalTime = mCalendar->isLocalTime(); | 94 | if ( ! useLocalTime ) |
95 | useLocalTime = mCalendar->isLocalTime(); | ||
94 | 96 | ||
@@ -1174,32 +1176,34 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) | |||
1174 | else if (tmpStr.left(2) == "YM") { | 1176 | else if (tmpStr.left(2) == "YM") { |
1175 | int index = tmpStr.find(' '); | 1177 | // we have to set this such that recurrence accepts addYearlyNum(tmpDay); |
1176 | int last = tmpStr.findRev(' ') + 1; | 1178 | anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, 1, -1); |
1177 | int rFreq = tmpStr.mid(2, (index-1)).toInt(); | 1179 | int index = tmpStr.find(' '); |
1178 | index += 1; | 1180 | int last = tmpStr.findRev(' ') + 1; |
1179 | short tmpMonth; | 1181 | int rFreq = tmpStr.mid(2, (index-1)).toInt(); |
1180 | if( index == last ) { | 1182 | index += 1; |
1181 | // e.g. YM1 #0 | 1183 | short tmpMonth; |
1182 | tmpMonth = anEvent->dtStart().date().month(); | 1184 | if( index == last ) { |
1183 | anEvent->recurrence()->addYearlyNum(tmpMonth); | 1185 | // e.g. YM1 #0 |
1184 | } | 1186 | tmpMonth = anEvent->dtStart().date().month(); |
1185 | else { | 1187 | anEvent->recurrence()->addYearlyNum(tmpMonth); |
1186 | // e.g. YM1 3 #0 | 1188 | } |
1187 | while (index < last) { | 1189 | else { |
1188 | int index2 = tmpStr.find(' ', index); | 1190 | // e.g. YM1 3 #0 |
1189 | tmpMonth = tmpStr.mid(index, (index2-index)).toShort(); | 1191 | while (index < last) { |
1190 | index = index2+1; | 1192 | int index2 = tmpStr.find(' ', index); |
1191 | anEvent->recurrence()->addYearlyNum(tmpMonth); | 1193 | tmpMonth = tmpStr.mid(index, (index2-index)).toShort(); |
1192 | } // while != # | 1194 | index = index2+1; |
1193 | } | 1195 | anEvent->recurrence()->addYearlyNum(tmpMonth); |
1194 | index = last; if (tmpStr.mid(index,1) == "#") index++; | 1196 | } // while != # |
1195 | if (tmpStr.find('T', index) != -1) { | 1197 | } |
1196 | QDate rEndDate = (ISOToQDateTime(tmpStr.mid(index, tmpStr.length()-index))).date(); | 1198 | index = last; if (tmpStr.mid(index,1) == "#") index++; |
1197 | anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, rEndDate); | 1199 | if (tmpStr.find('T', index) != -1) { |
1198 | } else { | 1200 | QDate rEndDate = (ISOToQDateTime(tmpStr.mid(index, tmpStr.length()-index))).date(); |
1199 | int rDuration = tmpStr.mid(index, tmpStr.length()-index).toInt(); | 1201 | anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, rEndDate); |
1200 | if (rDuration == 0) | 1202 | } else { |
1201 | anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, -1); | 1203 | int rDuration = tmpStr.mid(index, tmpStr.length()-index).toInt(); |
1202 | else | 1204 | if (rDuration == 0) |
1203 | anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, rDuration); | 1205 | anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, -1); |
1204 | } | 1206 | else |
1207 | anEvent->recurrence()->setYearly(Recurrence::rYearlyMonth, rFreq, rDuration); | ||
1208 | } | ||
1205 | } | 1209 | } |
@@ -1208,34 +1212,36 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) | |||
1208 | else if (tmpStr.left(2) == "YD") { | 1212 | else if (tmpStr.left(2) == "YD") { |
1209 | int index = tmpStr.find(' '); | 1213 | // we have to set this such that recurrence accepts addYearlyNum(tmpDay); |
1210 | int last = tmpStr.findRev(' ') + 1; | 1214 | anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, 1, -1); |
1211 | int rFreq = tmpStr.mid(2, (index-1)).toInt(); | 1215 | int index = tmpStr.find(' '); |
1212 | index += 1; | 1216 | int last = tmpStr.findRev(' ') + 1; |
1213 | short tmpDay; | 1217 | int rFreq = tmpStr.mid(2, (index-1)).toInt(); |
1214 | if( index == last ) { | 1218 | index += 1; |
1215 | // e.g. YD1 #0 | 1219 | short tmpDay; |
1216 | tmpDay = anEvent->dtStart().date().dayOfYear(); | 1220 | if( index == last ) { |
1217 | anEvent->recurrence()->addYearlyNum(tmpDay); | 1221 | // e.g. YD1 #0 |
1218 | } | 1222 | tmpDay = anEvent->dtStart().date().dayOfYear(); |
1219 | else { | 1223 | anEvent->recurrence()->addYearlyNum(tmpDay); |
1220 | // e.g. YD1 123 #0 | 1224 | } |
1221 | while (index < last) { | 1225 | else { |
1222 | int index2 = tmpStr.find(' ', index); | 1226 | // e.g. YD1 123 #0 |
1223 | tmpDay = tmpStr.mid(index, (index2-index)).toShort(); | 1227 | while (index < last) { |
1224 | index = index2+1; | 1228 | int index2 = tmpStr.find(' ', index); |
1225 | anEvent->recurrence()->addYearlyNum(tmpDay); | 1229 | tmpDay = tmpStr.mid(index, (index2-index)).toShort(); |
1226 | } // while != # | 1230 | index = index2+1; |
1227 | } | 1231 | anEvent->recurrence()->addYearlyNum(tmpDay); |
1228 | index = last; if (tmpStr.mid(index,1) == "#") index++; | 1232 | } // while != # |
1229 | if (tmpStr.find('T', index) != -1) { | 1233 | } |
1230 | QDate rEndDate = (ISOToQDateTime(tmpStr.mid(index, tmpStr.length()-index))).date(); | 1234 | index = last; if (tmpStr.mid(index,1) == "#") index++; |
1231 | anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, rEndDate); | 1235 | if (tmpStr.find('T', index) != -1) { |
1232 | } else { | 1236 | QDate rEndDate = (ISOToQDateTime(tmpStr.mid(index, tmpStr.length()-index))).date(); |
1233 | int rDuration = tmpStr.mid(index, tmpStr.length()-index).toInt(); | 1237 | anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, rEndDate); |
1234 | if (rDuration == 0) | 1238 | } else { |
1235 | anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, -1); | 1239 | int rDuration = tmpStr.mid(index, tmpStr.length()-index).toInt(); |
1236 | else | 1240 | if (rDuration == 0) |
1237 | anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, rDuration); | 1241 | anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, -1); |
1238 | } | 1242 | else |
1243 | anEvent->recurrence()->setYearly(Recurrence::rYearlyDay, rFreq, rDuration); | ||
1244 | } | ||
1239 | } else { | 1245 | } else { |
1240 | kdDebug(5800) << "we don't understand this type of recurrence!" << endl; | 1246 | kdDebug(5800) << "we don't understand this type of recurrence!" << endl; |
1241 | } // if | 1247 | } // if |
@@ -1538,8 +1544,9 @@ void VCalFormat::populate(VObject *vcal) | |||
1538 | if ((curVO = isAPropertyOf(vcal, VCTimeZoneProp)) != 0) { | 1544 | if ((curVO = isAPropertyOf(vcal, VCTimeZoneProp)) != 0) { |
1539 | char *s = fakeCString(vObjectUStringZValue(curVO)); | 1545 | if ( vObjectUStringZValue(curVO) != 0 ) { |
1540 | mCalendar->setTimeZone(s); | 1546 | char *s = fakeCString(vObjectUStringZValue(curVO)); |
1541 | deleteStr(s); | 1547 | mCalendar->setTimeZone(s); |
1548 | deleteStr(s); | ||
1549 | } | ||
1542 | } | 1550 | } |
1543 | 1551 | ||
1544 | |||
1545 | // Store all events with a relatedTo property in a list for post-processing | 1552 | // Store all events with a relatedTo property in a list for post-processing |