summaryrefslogtreecommitdiffabout
path: root/gammu
authorzautrix <zautrix>2004-09-12 15:24:11 (UTC)
committer zautrix <zautrix>2004-09-12 15:24:11 (UTC)
commita222c2f7369eeefd19454c973c0cc48300f72bec (patch) (unidiff)
tree6f01a5922ea622add6960f3fad703e8e8f099caa /gammu
parentb2dede5d5735e2b4ab5afd51cf6a2c46d9be9b26 (diff)
downloadkdepimpi-a222c2f7369eeefd19454c973c0cc48300f72bec.zip
kdepimpi-a222c2f7369eeefd19454c973c0cc48300f72bec.tar.gz
kdepimpi-a222c2f7369eeefd19454c973c0cc48300f72bec.tar.bz2
many phone sync fixes
Diffstat (limited to 'gammu') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/service/gsmcal.c4
-rw-r--r--gammu/emb/gammu/gammu.c6
2 files changed, 7 insertions, 3 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
@@ -471,18 +471,18 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda
471 ToDo->Entries[ToDo->EntriesNum].EntryType = TODO_TEXT; 471 ToDo->Entries[ToDo->EntriesNum].EntryType = TODO_TEXT;
472 CopyUnicodeString(ToDo->Entries[ToDo->EntriesNum].Text,Buff); 472 CopyUnicodeString(ToDo->Entries[ToDo->EntriesNum].Text,Buff);
473 ToDo->EntriesNum++; 473 ToDo->EntriesNum++;
474 } 474 }
475 if (ReadVCALText(Line, "PRIORITY", Buff)) { 475 if (ReadVCALText(Line, "PRIORITY", Buff)) {
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;
479 if (atoi(DecodeUnicodeString(Buff))<3) ToDo->Priority = GSM_Priority_High; 479 if (atoi(DecodeUnicodeString(Buff))<3) ToDo->Priority = GSM_Priority_High;
480 dbgprintf("atoi is %i %s\n",atoi(DecodeUnicodeString(Buff)),DecodeUnicodeString(Buff)); 480 dbgprintf("atoi is %i %s\n",atoi(DecodeUnicodeString(Buff)),DecodeUnicodeString(Buff));
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;
484 if (atoi(DecodeUnicodeString(Buff))<3) ToDo->Priority = GSM_Priority_High; 484 if (atoi(DecodeUnicodeString(Buff))<3) ToDo->Priority = GSM_Priority_High;
485 } 485 }
486 } 486 }
487 if (strstr(Line,"PERCENT-COMPLETE:100")) { 487 if (strstr(Line,"PERCENT-COMPLETE:100")) {
488 ToDo->Entries[ToDo->EntriesNum].EntryType = TODO_COMPLETED; 488 ToDo->Entries[ToDo->EntriesNum].EntryType = TODO_COMPLETED;
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
@@ -4624,12 +4624,13 @@ static void Restore(int argc, char *argv[])
4624 error=Phone->SetDateTime(&s, &date_time); 4624 error=Phone->SetDateTime(&s, &date_time);
4625 Print_Error(error); 4625 Print_Error(error);
4626 } 4626 }
4627 } 4627 }
4628 DoRestore = false; 4628 DoRestore = false;
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 */
4631 error = Phone->GetNextCalendar(&s,&Calendar,true); 4632 error = Phone->GetNextCalendar(&s,&Calendar,true);
4632 if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) { 4633 if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) {
4633 max = 0; 4634 max = 0;
4634 while (Backup.Calendar[max] != NULL) max++; 4635 while (Backup.Calendar[max] != NULL) max++;
4635 printmsgerr("%i entries in backup file\n",max); 4636 printmsgerr("%i entries in backup file\n",max);
@@ -4675,22 +4676,26 @@ static void Restore(int argc, char *argv[])
4675 } 4676 }
4676 4677
4677 DoRestore = false; 4678 DoRestore = false;
4678 if (Backup.ToDo[0] != NULL) { 4679 if (Backup.ToDo[0] != NULL) {
4679 error = Phone->GetToDoStatus(&s,&ToDoStatus); 4680 error = Phone->GetToDoStatus(&s,&ToDoStatus);
4680 if (error == ERR_NONE) { 4681 if (error == ERR_NONE) {
4682 error == ERR_NOTSUPPORTED;
4683 DoRestore = true;
4681 max = 0; 4684 max = 0;
4682 while (Backup.ToDo[max]!=NULL) max++; 4685 while (Backup.ToDo[max]!=NULL) max++;
4683 printmsgerr("%i entries in backup file\n",max); 4686 printmsgerr("%i entries in backup file\n",max);
4684 4687
4685 /*if (answer_yes("Restore ToDo")) */DoRestore = true; 4688 /*if (answer_yes("Restore ToDo")) */DoRestore = true;
4686 } 4689 }
4687 } 4690 }
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 }
4692 if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) { 4697 if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) {
4693 printmsgerr("Deleting old ToDo: "); 4698 printmsgerr("Deleting old ToDo: ");
4694 error=Phone->DeleteAllToDo(&s); 4699 error=Phone->DeleteAllToDo(&s);
4695 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) { 4700 if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
4696 while (1) { 4701 while (1) {
@@ -8371,13 +8376,12 @@ int main(int argc, char *argv[])
8371 if ( *tempC != 0 ) { 8376 if ( *tempC != 0 ) {
8372 fprintf(stderr,"Using connection %s \n",tempC); 8377 fprintf(stderr,"Using connection %s \n",tempC);
8373 con->Connection = strdup(tempC); 8378 con->Connection = strdup(tempC);
8374 con->DefaultConnection = false; 8379 con->DefaultConnection = false;
8375 } 8380 }
8376#endif 8381#endif
8377 argc = argc-3;
8378 8382
8379 8383
8380 /* Do we have enough parameters? */ 8384 /* Do we have enough parameters? */
8381 if (argc == 1 + start) { 8385 if (argc == 1 + start) {
8382 HelpGeneral(); 8386 HelpGeneral();
8383 printmsg("Too few parameters!\n"); 8387 printmsg("Too few parameters!\n");