summaryrefslogtreecommitdiffabout
path: root/gammu
Side-by-side diff
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
@@ -465,30 +465,30 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda
if (ReadVCALText(Line, "AALARM", Buff)) {
ToDo->Entries[ToDo->EntriesNum].EntryType = TODO_ALARM_DATETIME;
ReadVCALDateTime(DecodeUnicodeString(Buff), &ToDo->Entries[ToDo->EntriesNum].Date);
ToDo->EntriesNum++;
}
if (ReadVCALText(Line, "SUMMARY", Buff)) {
ToDo->Entries[ToDo->EntriesNum].EntryType = TODO_TEXT;
CopyUnicodeString(ToDo->Entries[ToDo->EntriesNum].Text,Buff);
ToDo->EntriesNum++;
}
if (ReadVCALText(Line, "PRIORITY", Buff)) {
if (ToDoVer == SonyEricsson_VToDo) {
- ToDo->Priority = GSM_Priority_Low;
+ ToDo->Priority = GSM_Priority_Medium;
if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low;
if (atoi(DecodeUnicodeString(Buff))<3) ToDo->Priority = GSM_Priority_High;
dbgprintf("atoi is %i %s\n",atoi(DecodeUnicodeString(Buff)),DecodeUnicodeString(Buff));
} else if (ToDoVer == Nokia_VToDo) {
- ToDo->Priority = GSM_Priority_Low;
+ ToDo->Priority = GSM_Priority_Medium;
if (atoi(DecodeUnicodeString(Buff))>3) ToDo->Priority = GSM_Priority_Low;
if (atoi(DecodeUnicodeString(Buff))<3) ToDo->Priority = GSM_Priority_High;
}
}
if (strstr(Line,"PERCENT-COMPLETE:100")) {
ToDo->Entries[ToDo->EntriesNum].EntryType = TODO_COMPLETED;
ToDo->Entries[ToDo->EntriesNum].Number = 1;
ToDo->EntriesNum++;
}
break;
}
}
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
@@ -4618,24 +4618,25 @@ static void Restore(int argc, char *argv[])
}
if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) {
if (/*answer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/ true ) {
GSM_GetCurrentDateTime(&date_time);
error=Phone->SetDateTime(&s, &date_time);
Print_Error(error);
}
}
DoRestore = false;
if (Backup.Calendar[0] != NULL) {
+ DoRestore = true;
/* N6110 doesn't support getting calendar status */
error = Phone->GetNextCalendar(&s,&Calendar,true);
if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) {
max = 0;
while (Backup.Calendar[max] != NULL) max++;
printmsgerr("%i entries in backup file\n",max);
DoRestore = true;
/*
if (answer_yes("Restore calendar notes")) {
Past = answer_yes("Restore notes from the past");
DoRestore = true;
}
@@ -4669,34 +4670,38 @@ static void Restore(int argc, char *argv[])
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.ToDo[0] != NULL) {
error = Phone->GetToDoStatus(&s,&ToDoStatus);
if (error == ERR_NONE) {
+ error == ERR_NOTSUPPORTED;
+ DoRestore = true;
max = 0;
while (Backup.ToDo[max]!=NULL) max++;
printmsgerr("%i entries in backup file\n",max);
/*if (answer_yes("Restore ToDo")) */DoRestore = true;
}
}
if (DoRestore) {
+ if ( max > 0 ) {
ToDo = *Backup.ToDo[0];
error = Phone->SetToDo(&s,&ToDo);
+ }
}
if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) {
printmsgerr("Deleting old ToDo: ");
error=Phone->DeleteAllToDo(&s);
if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
while (1) {
error = Phone->GetNextToDo(&s,&ToDo,true);
if (error != ERR_NONE) break;
error = Phone->DeleteToDo(&s,&ToDo);
Print_Error(error);
printmsgerr("*");
}
@@ -8365,25 +8370,24 @@ int main(int argc, char *argv[])
if ( *tempC != 0 ) {
fprintf(stderr,"Using device %s \n",tempC);
con->Device = strdup(tempC);
con->DefaultDevice = false;
}
tempC = argv[argc-3]+2;
if ( *tempC != 0 ) {
fprintf(stderr,"Using connection %s \n",tempC);
con->Connection = strdup(tempC);
con->DefaultConnection = false;
}
#endif
- argc = argc-3;
/* Do we have enough parameters? */
if (argc == 1 + start) {
HelpGeneral();
printmsg("Too few parameters!\n");
exit(-2);
}
/* Check used version vs. compiled */
if (!mystrncasecmp(GetGammuVersion(),VERSION,0)) {
printmsg("ERROR: version of installed libGammu.so (%s) is different to version of Gammu (%s)\n",