summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-08-09 11:15:24 (UTC)
committer zautrix <zautrix>2004-08-09 11:15:24 (UTC)
commite0ba2d4770094974ec4a2a48af436a7df9a055bc (patch) (unidiff)
tree52752d9fcff91934e43b27dd6926ead31c44f4f7
parent2d3e20244a156485f6001aa82c4494dfce177b8f (diff)
downloadkdepimpi-e0ba2d4770094974ec4a2a48af436a7df9a055bc.zip
kdepimpi-e0ba2d4770094974ec4a2a48af436a7df9a055bc.tar.gz
kdepimpi-e0ba2d4770094974ec4a2a48af436a7df9a055bc.tar.bz2
more fixes
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
@@ -137,66 +137,68 @@ public:
137 // not supported 137 // not supported
138 entry.Location = ToDo->Entries[j].Number; 138 entry.Location = ToDo->Entries[j].Number;
139 entry.MemoryType = MEM_ME; 139 entry.MemoryType = MEM_ME;
140 error=Phone->GetMemory(s, &entry); 140 error=Phone->GetMemory(s, &entry);
141 if (error == ERR_NONE) { 141 if (error == ERR_NONE) {
142 name = GSM_PhonebookGetEntryName(&entry); 142 name = GSM_PhonebookGetEntryName(&entry);
143 if (name != NULL) { 143 if (name != NULL) {
144 printmsg("Contact ID : \"%s\" (%d)\n", DecodeUnicodeConsole(name), ToDo->Entries[j].Number); 144 printmsg("Contact ID : \"%s\" (%d)\n", DecodeUnicodeConsole(name), ToDo->Entries[j].Number);
145 } else { 145 } else {
146 printmsg("Contact ID : %d\n",ToDo->Entries[j].Number); 146 printmsg("Contact ID : %d\n",ToDo->Entries[j].Number);
147 } 147 }
148 } else { 148 } else {
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() );
191 attList << alarmString; 193 attList << alarmString;
192 attList << todo->categoriesStr(); 194 attList << todo->categoriesStr();
193 attList << todo->secrecyStr(); 195 attList << todo->secrecyStr();
194 cSum = PhoneFormat::getCsum(attList ); 196 cSum = PhoneFormat::getCsum(attList );
195 todo->setCsum( mProfileName, QString::number( cSum )); 197 todo->setCsum( mProfileName, QString::number( cSum ));
196 mCalendar->addTodo( todo); 198 mCalendar->addTodo( todo);
197 199
198 return true; 200 return true;
199 } 201 }
200 bool readEvent( Calendar *existingCalendar, GSM_CalendarEntry*Note) 202 bool readEvent( Calendar *existingCalendar, GSM_CalendarEntry*Note)
201 { 203 {
202 204
@@ -420,67 +422,69 @@ public:
420 r->addMonthlyDay( startDate.day() ); 422 r->addMonthlyDay( startDate.day() );
421 } else if ( rtype == 2 ) { 423 } else if ( rtype == 2 ) {
422 if ( hasEndDate ) 424 if ( hasEndDate )
423 r->setMonthly( Recurrence::rMonthlyPos, freq, endDate ); 425 r->setMonthly( Recurrence::rMonthlyPos, freq, endDate );
424 else 426 else
425 r->setMonthly( Recurrence::rMonthlyPos, freq, -1 ); 427 r->setMonthly( Recurrence::rMonthlyPos, freq, -1 );
426 QBitArray days( 7 ); 428 QBitArray days( 7 );
427 days.fill( false ); 429 days.fill( false );
428 days.setBit( dayOfWeek - 1 ); 430 days.setBit( dayOfWeek - 1 );
429 r->addMonthlyPos( pos, days ); 431 r->addMonthlyPos( pos, days );
430 } else if ( rtype == 4 ) { 432 } else if ( rtype == 4 ) {
431 if ( hasEndDate ) 433 if ( hasEndDate )
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;
475 attList << recurString; 479 attList << recurString;
476 attList << event->categoriesStr(); 480 attList << event->categoriesStr();
477 attList << event->secrecyStr(); 481 attList << event->secrecyStr();
478 cSum = PhoneFormat::getCsum(attList ); 482 cSum = PhoneFormat::getCsum(attList );
479 event->setCsum( mProfileName, QString::number( cSum )); 483 event->setCsum( mProfileName, QString::number( cSum ));
480 mCalendar->addEvent( event); 484 mCalendar->addEvent( event);
481 485
482 return true; 486 return true;
483 } 487 }
484 488
485 489
486 QDateTime fromGSM ( GSM_DateTime*dtp, bool useTz = true ) { 490 QDateTime fromGSM ( GSM_DateTime*dtp, bool useTz = true ) {
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index f8b066d..defdb09 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -168,48 +168,50 @@ class SharpParser : public QObject
168 } else { 168 } else {
169 event->recurrence()->unsetRecurs(); 169 event->recurrence()->unsetRecurs();
170 } 170 }
171 171
172 QString categoryList = attList[1] ; 172 QString categoryList = attList[1] ;
173 event->setCategories( lookupCategories( categoryList ) ); 173 event->setCategories( lookupCategories( categoryList ) );
174 174
175 // strange 0 semms to mean: alarm enabled 175 // strange 0 semms to mean: alarm enabled
176 if ( attList[8] == "0" ) { 176 if ( attList[8] == "0" ) {
177 Alarm *alarm; 177 Alarm *alarm;
178 if ( event->alarms().count() > 0 ) 178 if ( event->alarms().count() > 0 )
179 alarm = event->alarms().first(); 179 alarm = event->alarms().first();
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
204 todo = new Todo; 206 todo = new Todo;
205 207
206//CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1 208//CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1
207// 0 1 2 3 4 5 6 7 8 209// 0 1 2 3 4 5 6 7 8
208//1,,,,,1,4,Loch zumachen,"" 210//1,,,,,1,4,Loch zumachen,""
209//3,Privat,20040317T000000,20040318T000000,20040319T000000,0,5,Call bbb,"notes123 bbb gggg ""bb "" " 211//3,Privat,20040317T000000,20040318T000000,20040319T000000,0,5,Call bbb,"notes123 bbb gggg ""bb "" "
210//2,"Familie,Freunde,Holiday",20040318T000000,20040324T000000,20040317T000000,1,2,tod2,notes 212//2,"Familie,Freunde,Holiday",20040318T000000,20040324T000000,20040317T000000,1,2,tod2,notes
211 213
212 todo->setID( "Sharp_DTM", attList[0]); 214 todo->setID( "Sharp_DTM", attList[0]);
213 todo->setCsum( "Sharp_DTM", QString::number( cSum )); 215 todo->setCsum( "Sharp_DTM", QString::number( cSum ));
214 todo->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); 216 todo->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL );
215 217