summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/phoneformat.cpp8
-rw-r--r--libkcal/sharpformat.cpp2
2 files changed, 8 insertions, 2 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 94744fb..bc1b863 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -149,42 +149,44 @@ public:
149 printmsg("Contact : %d\n",ToDo->Entries[j].Number); 149 printmsg("Contact : %d\n",ToDo->Entries[j].Number);
150 } 150 }
151#endif 151#endif
152 break; 152 break;
153 case TODO_PHONE: 153 case TODO_PHONE:
154#if 0 154#if 0
155 // not supported 155 // not supported
156 printmsg("Phone : \"%s\"\n",DecodeUnicodeConsole(ToDo->Entries[j].Text)); 156 printmsg("Phone : \"%s\"\n",DecodeUnicodeConsole(ToDo->Entries[j].Text));
157#endif 157#endif
158 break; 158 break;
159 } 159 }
160 } 160 }
161 QString alarmString = ""; 161 QString alarmString = "na";
162 if ( alarm ) { 162 if ( alarm ) {
163 Alarm *alarm; 163 Alarm *alarm;
164 if ( todo->alarms().count() > 0 ) 164 if ( todo->alarms().count() > 0 )
165 alarm = todo->alarms().first(); 165 alarm = todo->alarms().first();
166 else { 166 else {
167 alarm = new Alarm( todo ); 167 alarm = new Alarm( todo );
168 todo->addAlarm( alarm ); 168 todo->addAlarm( alarm );
169 } 169 }
170 alarm->setType( Alarm::Audio ); 170 alarm->setType( Alarm::Audio );
171 alarm->setEnabled( true ); 171 alarm->setEnabled( true );
172 int alarmOffset = alarmDt.secsTo( todo->dtStart() ); 172 int alarmOffset = alarmDt.secsTo( todo->dtStart() );
173 alarm->setStartOffset( -alarmOffset ); 173 alarm->setStartOffset( -alarmOffset );
174 alarmString = QString::number( alarmOffset ); 174 alarmString = QString::number( alarmOffset );
175 } else { 175 } else {
176 Alarm *alarm; 176 Alarm *alarm;
177 if ( todo->alarms().count() > 0 ) { 177 if ( todo->alarms().count() > 0 ) {
178 alarm = todo->alarms().first(); 178 alarm = todo->alarms().first();
179 alarm->setType( Alarm::Audio );
180 alarm->setStartOffset( -60*15 );
179 alarm->setEnabled( false ); 181 alarm->setEnabled( false );
180 } 182 }
181 } 183 }
182 // csum ***************************************** 184 // csum *****************************************
183 QStringList attList; 185 QStringList attList;
184 uint cSum; 186 uint cSum;
185 if ( todo->hasDueDate() ) 187 if ( todo->hasDueDate() )
186 attList << dtToString ( todo->dtDue() ); 188 attList << dtToString ( todo->dtDue() );
187 attList << QString::number( id ); 189 attList << QString::number( id );
188 attList << todo->summary(); 190 attList << todo->summary();
189 attList << completedString; 191 attList << completedString;
190 attList << QString::number( todo->priority() ); 192 attList << QString::number( todo->priority() );
@@ -432,43 +434,45 @@ public:
432 r->setYearly( Recurrence::rYearlyMonth, freq, endDate ); 434 r->setYearly( Recurrence::rYearlyMonth, freq, endDate );
433 else 435 else
434 r->setYearly( Recurrence::rYearlyMonth, freq, -1 ); 436 r->setYearly( Recurrence::rYearlyMonth, freq, -1 );
435 r->addYearlyNum( startDate.month() ); 437 r->addYearlyNum( startDate.month() );
436 } 438 }
437 } else { 439 } else {
438 event->recurrence()->unsetRecurs(); 440 event->recurrence()->unsetRecurs();
439 } 441 }
440 442
441 QStringList categoryList; 443 QStringList categoryList;
442 categoryList << getCategory( Note ); 444 categoryList << getCategory( Note );
443 event->setCategories( categoryList ); 445 event->setCategories( categoryList );
444 QString alarmString = ""; 446 QString alarmString = "na";
445 // strange 0 semms to mean: alarm enabled 447 // strange 0 semms to mean: alarm enabled
446 if ( alarm ) { 448 if ( alarm ) {
447 Alarm *alarm; 449 Alarm *alarm;
448 if ( event->alarms().count() > 0 ) 450 if ( event->alarms().count() > 0 )
449 alarm = event->alarms().first(); 451 alarm = event->alarms().first();
450 else { 452 else {
451 alarm = new Alarm( event ); 453 alarm = new Alarm( event );
452 event->addAlarm( alarm ); 454 event->addAlarm( alarm );
453 } 455 }
454 alarm->setType( Alarm::Audio ); 456 alarm->setType( Alarm::Audio );
455 alarm->setEnabled( true ); 457 alarm->setEnabled( true );
456 int alarmOffset = alarmDt.secsTo( event->dtStart() ); 458 int alarmOffset = alarmDt.secsTo( event->dtStart() );
457 alarm->setStartOffset( -alarmOffset ); 459 alarm->setStartOffset( -alarmOffset );
458 alarmString = QString::number( alarmOffset ); 460 alarmString = QString::number( alarmOffset );
459 } else { 461 } else {
460 Alarm *alarm; 462 Alarm *alarm;
461 if ( event->alarms().count() > 0 ) { 463 if ( event->alarms().count() > 0 ) {
462 alarm = event->alarms().first(); 464 alarm = event->alarms().first();
465 alarm->setType( Alarm::Audio );
466 alarm->setStartOffset( -60*15 );
463 alarm->setEnabled( false ); 467 alarm->setEnabled( false );
464 } 468 }
465 } 469 }
466 // csum ***************************************** 470 // csum *****************************************
467 QStringList attList; 471 QStringList attList;
468 uint cSum; 472 uint cSum;
469 attList << dtToString ( event->dtStart() ); 473 attList << dtToString ( event->dtStart() );
470 attList << dtToString ( event->dtEnd() ); 474 attList << dtToString ( event->dtEnd() );
471 attList << QString::number( id ); 475 attList << QString::number( id );
472 attList << event->summary(); 476 attList << event->summary();
473 attList << event->location(); 477 attList << event->location();
474 attList << alarmString; 478 attList << alarmString;
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index f8b066d..defdb09 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -180,24 +180,26 @@ class SharpParser : public QObject
180 else { 180 else {
181 alarm = new Alarm( event ); 181 alarm = new Alarm( event );
182 event->addAlarm( alarm ); 182 event->addAlarm( alarm );
183 } 183 }
184 alarm->setType( Alarm::Audio ); 184 alarm->setType( Alarm::Audio );
185 alarm->setEnabled( true ); 185 alarm->setEnabled( true );
186 int alarmOffset = attList[9].toInt(); 186 int alarmOffset = attList[9].toInt();
187 alarm->setStartOffset( alarmOffset * -60 ); 187 alarm->setStartOffset( alarmOffset * -60 );
188 } else { 188 } else {
189 Alarm *alarm; 189 Alarm *alarm;
190 if ( event->alarms().count() > 0 ) { 190 if ( event->alarms().count() > 0 ) {
191 alarm = event->alarms().first(); 191 alarm = event->alarms().first();
192 alarm->setType( Alarm::Audio );
193 alarm->setStartOffset( -60*15 );
192 alarm->setEnabled( false ); 194 alarm->setEnabled( false );
193 } 195 }
194 } 196 }
195 197
196 mCalendar->addEvent( event); 198 mCalendar->addEvent( event);
197 } else if ( qName == "Todo" ) { 199 } else if ( qName == "Todo" ) {
198 Todo *todo; 200 Todo *todo;
199 201
200 todo = existingCalendar->todo( "Sharp_DTM", attList[0] ); 202 todo = existingCalendar->todo( "Sharp_DTM", attList[0] );
201 if (todo ) 203 if (todo )
202 todo = (Todo*)todo->clone(); 204 todo = (Todo*)todo->clone();
203 else 205 else