-rw-r--r-- | gammu/emb/common/service/gsmcal.c | 4 | ||||
-rw-r--r-- | gammu/emb/gammu/gammu.c | 6 | ||||
-rw-r--r-- | libkcal/phoneformat.cpp | 42 |
3 files changed, 36 insertions, 16 deletions
diff --git a/gammu/emb/common/service/gsmcal.c b/gammu/emb/common/service/gsmcal.c index ddf9790..0ea8e06 100644 --- a/gammu/emb/common/service/gsmcal.c +++ b/gammu/emb/common/service/gsmcal.c | |||
@@ -476,3 +476,3 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda | |||
476 | if (ToDoVer == SonyEricsson_VToDo) { | 476 | if (ToDoVer == SonyEricsson_VToDo) { |
477 | ToDo->Priority = GSM_Priority_Low; | 477 | ToDo->Priority = GSM_Priority_Medium; |
478 | if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low; | 478 | if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low; |
@@ -481,3 +481,3 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda | |||
481 | } else if (ToDoVer == Nokia_VToDo) { | 481 | } else if (ToDoVer == Nokia_VToDo) { |
482 | ToDo->Priority = GSM_Priority_Low; | 482 | ToDo->Priority = GSM_Priority_Medium; |
483 | if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low; | 483 | if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low; |
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c index a3b93a8..997485a 100644 --- a/gammu/emb/gammu/gammu.c +++ b/gammu/emb/gammu/gammu.c | |||
@@ -4629,2 +4629,3 @@ static void Restore(int argc, char *argv[]) | |||
4629 | if (Backup.Calendar[0] != NULL) { | 4629 | if (Backup.Calendar[0] != NULL) { |
4630 | DoRestore = true; | ||
4630 | /* N6110 doesn't support getting calendar status */ | 4631 | /* N6110 doesn't support getting calendar status */ |
@@ -4680,2 +4681,4 @@ static void Restore(int argc, char *argv[]) | |||
4680 | if (error == ERR_NONE) { | 4681 | if (error == ERR_NONE) { |
4682 | error == ERR_NOTSUPPORTED; | ||
4683 | DoRestore = true; | ||
4681 | max = 0; | 4684 | max = 0; |
@@ -4688,4 +4691,6 @@ static void Restore(int argc, char *argv[]) | |||
4688 | if (DoRestore) { | 4691 | if (DoRestore) { |
4692 | if ( max > 0 ) { | ||
4689 | ToDo = *Backup.ToDo[0]; | 4693 | ToDo = *Backup.ToDo[0]; |
4690 | error = Phone->SetToDo(&s,&ToDo); | 4694 | error = Phone->SetToDo(&s,&ToDo); |
4695 | } | ||
4691 | } | 4696 | } |
@@ -8376,3 +8381,2 @@ int main(int argc, char *argv[]) | |||
8376 | #endif | 8381 | #endif |
8377 | argc = argc-3; | ||
8378 | 8382 | ||
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 6df639f..ef69bce 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp | |||
@@ -131,3 +131,6 @@ ulong PhoneFormat::getCsumTodo( Todo* todo ) | |||
131 | attList << completedString; | 131 | attList << completedString; |
132 | attList << QString::number( todo->priority() ); | 132 | int prio = todo->priority(); |
133 | if( prio == 2 ) prio = 1; | ||
134 | if (prio == 4 ) prio = 5 ; | ||
135 | attList << QString::number( prio ); | ||
133 | QString alarmString = "na"; | 136 | QString alarmString = "na"; |
@@ -256,3 +259,3 @@ ulong PhoneFormat::getCsum( const QStringList & attList) | |||
256 | { | 259 | { |
257 | int max = attList.count() -1; | 260 | int max = attList.count(); |
258 | ulong cSum = 0; | 261 | ulong cSum = 0; |
@@ -260,3 +263,3 @@ ulong PhoneFormat::getCsum( const QStringList & attList) | |||
260 | int add; | 263 | int add; |
261 | for ( i = 1; i < max ; ++i ) { | 264 | for ( i = 0; i < max ; ++i ) { |
262 | QString s = attList[i]; | 265 | QString s = attList[i]; |
@@ -269,3 +272,4 @@ ulong PhoneFormat::getCsum( const QStringList & attList) | |||
269 | mul = mul * mul; | 272 | mul = mul * mul; |
270 | add = add * mul *i*i*i; | 273 | int ii = i+1; |
274 | add = add * mul *ii*ii*ii; | ||
271 | cSum += add; | 275 | cSum += add; |
@@ -273,5 +277,8 @@ ulong PhoneFormat::getCsum( const QStringList & attList) | |||
273 | } | 277 | } |
278 | if ( i == 0 ) | ||
279 | qDebug("csum: i == 0 %d ", cSum); | ||
280 | |||
274 | } | 281 | } |
275 | //QString dump = attList.join(","); | 282 | QString dump = attList.join(","); |
276 | //qDebug("csum: %s", dump.latin1()); | 283 | qDebug("csum: %d %s", cSum,dump.latin1()); |
277 | 284 | ||
@@ -292,4 +299,3 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
292 | #endif | 299 | #endif |
293 | QString command ="./kammu --backup " + fileName + " -yes -C" + | 300 | QString command ="./kammu --backup " + fileName + " -yes" ; |
294 | mConnection +" -D" + mDevice +" -M" + mModel; | ||
295 | int ret = system ( command.latin1() ); | 301 | int ret = system ( command.latin1() ); |
@@ -346,2 +352,4 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | |||
346 | if ( event ) { | 352 | if ( event ) { |
353 | qDebug("copy todo %s ", event->summary().latin1()); | ||
354 | |||
347 | event = (Todo*)event->clone(); | 355 | event = (Todo*)event->clone(); |
@@ -377,3 +385,4 @@ void PhoneFormat::copyEvent( Event* to, Event* from ) | |||
377 | QPtrListIterator<Alarm> it( from->alarms() ); | 385 | QPtrListIterator<Alarm> it( from->alarms() ); |
378 | to->clearAlarms(); | 386 | if ( it.current() ) |
387 | to->clearAlarms(); | ||
379 | const Alarm *a; | 388 | const Alarm *a; |
@@ -416,3 +425,4 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) | |||
416 | QPtrListIterator<Alarm> it( from->alarms() ); | 425 | QPtrListIterator<Alarm> it( from->alarms() ); |
417 | to->clearAlarms(); | 426 | if ( it.current() ) |
427 | to->clearAlarms(); | ||
418 | const Alarm *a; | 428 | const Alarm *a; |
@@ -445,3 +455,8 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) | |||
445 | } | 455 | } |
446 | to->setPriority(from->priority()); | 456 | if( to->priority() == 2 && from->priority() == 1 ) |
457 | ; //skip | ||
458 | else if (to->priority() == 4 && from->priority() == 5 ) | ||
459 | ; | ||
460 | else | ||
461 | to->setPriority(from->priority()); | ||
447 | 462 | ||
@@ -454,2 +469,3 @@ void PhoneFormat::afterSave( Incidence* inc) | |||
454 | inc->removeID( mProfileName ); | 469 | inc->removeID( mProfileName ); |
470 | #if 0 | ||
455 | if ( inc->type() == "Event") | 471 | if ( inc->type() == "Event") |
@@ -459,2 +475,3 @@ void PhoneFormat::afterSave( Incidence* inc) | |||
459 | inc->setCsum( mProfileName, QString::number( csum )); | 475 | inc->setCsum( mProfileName, QString::number( csum )); |
476 | #endif | ||
460 | inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); | 477 | inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
@@ -508,4 +525,3 @@ bool PhoneFormat::save( Calendar *calendar) | |||
508 | // 4 call kammu | 525 | // 4 call kammu |
509 | QString command ="./kammu --restore " + fileName + " -C" + | 526 | QString command ="./kammu --restore " + fileName ; |
510 | mConnection +" -D" + mDevice +" -M" + mModel; | ||
511 | int ret; | 527 | int ret; |