summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-08-08 20:46:59 (UTC)
committer zautrix <zautrix>2004-08-08 20:46:59 (UTC)
commit3a769cd15cfdb8e19e5fec2088c59aadeed4800a (patch) (unidiff)
tree93b3dee16f7ae02c762f1cfd63864b3676ac65cb
parent957c13e21844ca75e337fc1c864554dd2240fc78 (diff)
downloadkdepimpi-3a769cd15cfdb8e19e5fec2088c59aadeed4800a.zip
kdepimpi-3a769cd15cfdb8e19e5fec2088c59aadeed4800a.tar.gz
kdepimpi-3a769cd15cfdb8e19e5fec2088c59aadeed4800a.tar.bz2
Fixed reading from phone
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/phoneformat.cpp47
1 files changed, 39 insertions, 8 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 238b0ef..1a9ccbc 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -98,2 +98,4 @@ public:
98 for (j=0;j<ToDo->EntriesNum;j++) { 98 for (j=0;j<ToDo->EntriesNum;j++) {
99
100 //qDebug(" for todo %d",ToDo->Location );
99 switch (ToDo->Entries[j].EntryType) { 101 switch (ToDo->Entries[j].EntryType) {
@@ -123,3 +125,4 @@ public:
123 case TODO_TEXT: 125 case TODO_TEXT:
124 todo->setSummary( QString ( (const char*) ToDo->Entries[j].Text )); 126 //qDebug(" text *%s* ", (const char*) DecodeUnicodeConsole(ToDo->Entries[j].Text ));
127 todo->setSummary( QString::fromUtf8 ( (const char*)DecodeUnicodeConsole(ToDo->Entries[j].Text )));
125 break; 128 break;
@@ -236,3 +239,3 @@ public:
236 239
237 qDebug(" for "); 240 //qDebug(" for ev");
238 switch (Note->Entries[i].EntryType) { 241 switch (Note->Entries[i].EntryType) {
@@ -272,6 +275,7 @@ public:
272 case CAL_TEXT: 275 case CAL_TEXT:
273 event->setSummary( QString ( (const char*) Note->Entries[i].Text )); 276 //qDebug(" ev text %s", DecodeUnicodeConsole(Note->Entries[i].Text) );
277 event->setSummary( QString::fromUtf8 ( (const char*)DecodeUnicodeConsole( Note->Entries[i].Text )));
274 break; 278 break;
275 case CAL_LOCATION: 279 case CAL_LOCATION:
276 event->setLocation(QString ((const char*) Note->Entries[i].Text )); 280 event->setLocation(QString::fromUtf8 ((const char*) DecodeUnicodeConsole(Note->Entries[i].Text) ));
277 break; 281 break;
@@ -614,2 +618,3 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal ,QString profi
614 s.ConfigNum = 0; 618 s.ConfigNum = 0;
619#if 0
615 static char*cp; 620 static char*cp;
@@ -655,2 +660,27 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal ,QString profi
655 660
661#endif
662 setlocale(LC_ALL, "");
663 GSM_ReadConfig(NULL, &s.Config[0], 0);
664 s.ConfigNum = 1;
665 GSM_Config *cfg = &s.Config[0];
666 di.coding = "utf8";
667 if ( ! connection.isEmpty() ) {
668 cfg->Connection = strdup(connection.latin1());
669 cfg->DefaultConnection = false;
670 qDebug("Connection set %s ", cfg->Connection );
671
672 }
673 if ( ! device.isEmpty() ) {
674 cfg->Device = strdup(device.latin1());
675 cfg->DefaultDevice = false;
676 qDebug("Device set %s ", cfg->Device);
677
678 }
679 if ( ! model.isEmpty() ) {
680 strcpy(cfg->Model,model.latin1() );
681 cfg->DefaultModel = false;
682 qDebug("Model set %s ",cfg->Model );
683
684
685 }
656 int error=GSM_InitConnection(&s,3); 686 int error=GSM_InitConnection(&s,3);
@@ -662,3 +692,3 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal ,QString profi
662 GSM_CalendarEntrynote; 692 GSM_CalendarEntrynote;
663 bool refresh= true; 693 bool start = true;
664 Phone=s.Phone.Functions; 694 Phone=s.Phone.Functions;
@@ -667,7 +697,8 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal ,QString profi
667 int ccc = 0; 697 int ccc = 0;
668 while (!gshutdown && ccc++ < 10 ) { 698 while (!gshutdown && ccc++ < 3) {
669 699
670 qDebug("readEvent %d ", ccc); 700 qDebug("readEvent %d ", ccc);
671 error=Phone->GetNextCalendar(&s,&note,refresh); 701 error=Phone->GetNextCalendar(&s,&note,start);
672 if (error == ERR_EMPTY) break; 702 if (error == ERR_EMPTY) break;
703 start = false;
673 handler.readEvent( existingCal, &note ); 704 handler.readEvent( existingCal, &note );
@@ -675,3 +706,3 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal ,QString profi
675 706
676 bool start = true; 707 start = true;
677 GSM_ToDoEntry ToDo; 708 GSM_ToDoEntry ToDo;