summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2004-08-08 09:33:57 (UTC)
committer zautrix <zautrix>2004-08-08 09:33:57 (UTC)
commit71eba6589af91448b84bfd409439115972203e9e (patch) (unidiff)
treebb904ef144f9ae4ca2da5f95faceb68bc02d113e /libkcal
parentad825350a6967b6e0273c0a5916693853b70d242 (diff)
downloadkdepimpi-71eba6589af91448b84bfd409439115972203e9e.zip
kdepimpi-71eba6589af91448b84bfd409439115972203e9e.tar.gz
kdepimpi-71eba6589af91448b84bfd409439115972203e9e.tar.bz2
small fix
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/phoneformat.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index c97b43d..238b0ef 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -162,67 +162,68 @@ public:
162#endif 162#endif
163 break; 163 break;
164 case TODO_PHONE: 164 case TODO_PHONE:
165#if 0 165#if 0
166 // not supported 166 // not supported
167 printmsg("Phone : \"%s\"\n",DecodeUnicodeConsole(ToDo->Entries[j].Text)); 167 printmsg("Phone : \"%s\"\n",DecodeUnicodeConsole(ToDo->Entries[j].Text));
168#endif 168#endif
169 break; 169 break;
170 } 170 }
171 } 171 }
172 QString alarmString = ""; 172 QString alarmString = "";
173 // strange 0 semms to mean: alarm enabled 173 // strange 0 semms to mean: alarm enabled
174 if ( alarm ) { 174 if ( alarm ) {
175 Alarm *alarm; 175 Alarm *alarm;
176 if ( todo->alarms().count() > 0 ) 176 if ( todo->alarms().count() > 0 )
177 alarm = todo->alarms().first(); 177 alarm = todo->alarms().first();
178 else { 178 else {
179 alarm = new Alarm( todo ); 179 alarm = new Alarm( todo );
180 todo->addAlarm( alarm ); 180 todo->addAlarm( alarm );
181 } 181 }
182 alarm->setType( Alarm::Audio ); 182 alarm->setType( Alarm::Audio );
183 alarm->setEnabled( true ); 183 alarm->setEnabled( true );
184 int alarmOffset = alarmDt.secsTo( todo->dtStart() ); 184 int alarmOffset = alarmDt.secsTo( todo->dtStart() );
185 alarm->setStartOffset( alarmOffset ); 185 alarm->setStartOffset( alarmOffset );
186 alarmString = QString::number( alarmOffset ); 186 alarmString = QString::number( alarmOffset );
187 } 187 }
188 // csum ***************************************** 188 // csum *****************************************
189 QStringList attList; 189 QStringList attList;
190 uint cSum; 190 uint cSum;
191 if ( todo->hasDueDate() ) 191 if ( todo->hasDueDate() )
192 attList << dtToString ( todo->dtDue() ); 192 attList << dtToString ( todo->dtDue() );
193 attList << QString::number( id ); 193 attList << QString::number( id );
194 attList << todo->summary(); 194 attList << todo->summary();
195 attList << completedString; 195 attList << completedString;
196 attList << alarmString; 196 attList << QString::number( todo->priority() );
197 attList << alarmString;
197 attList << todo->categoriesStr(); 198 attList << todo->categoriesStr();
198 attList << todo->secrecyStr(); 199 attList << todo->secrecyStr();
199 cSum = PhoneFormat::getCsum(attList ); 200 cSum = PhoneFormat::getCsum(attList );
200 todo->setCsum( mProfileName, QString::number( cSum )); 201 todo->setCsum( mProfileName, QString::number( cSum ));
201 mCalendar->addTodo( todo); 202 mCalendar->addTodo( todo);
202 203
203 return true; 204 return true;
204 } 205 }
205 bool readEvent( Calendar *existingCalendar, GSM_CalendarEntry*Note) 206 bool readEvent( Calendar *existingCalendar, GSM_CalendarEntry*Note)
206 { 207 {
207 208
208 int id = Note->Location; 209 int id = Note->Location;
209 Event *event; 210 Event *event;
210 event = existingCalendar->event( mProfileName ,QString::number( id ) ); 211 event = existingCalendar->event( mProfileName ,QString::number( id ) );
211 if ( event ) 212 if ( event )
212 event = (Event*)event->clone(); 213 event = (Event*)event->clone();
213 else 214 else
214 event = new Event; 215 event = new Event;
215 event->setID( mProfileName,QString::number( id ) ); 216 event->setID( mProfileName,QString::number( id ) );
216 event->setTempSyncStat(SYNC_TEMPSTATE_NEW_EXTERNAL ); 217 event->setTempSyncStat(SYNC_TEMPSTATE_NEW_EXTERNAL );
217 218
218 219
219 int i = 0; 220 int i = 0;
220 bool repeating = false; 221 bool repeating = false;
221 int repeat_dayofweek = -1; 222 int repeat_dayofweek = -1;
222 int repeat_day = -1; 223 int repeat_day = -1;
223 int repeat_weekofmonth = -1; 224 int repeat_weekofmonth = -1;
224 int repeat_month = -1; 225 int repeat_month = -1;
225 int repeat_frequency = -1; 226 int repeat_frequency = -1;
226 int rec_type = -1; 227 int rec_type = -1;
227 GSM_DateTime repeat_startdate = {0,0,0,0,0,0,0}; 228 GSM_DateTime repeat_startdate = {0,0,0,0,0,0,0};
228 GSM_DateTime repeat_stopdate = {0,0,0,0,0,0,0}; 229 GSM_DateTime repeat_stopdate = {0,0,0,0,0,0,0};
@@ -645,65 +646,65 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal ,QString profi
645 646
646 /* We want to use only one file descriptor for global and state machine debug output */ 647 /* We want to use only one file descriptor for global and state machine debug output */
647 s.Config[i].UseGlobalDebugFile = true; 648 s.Config[i].UseGlobalDebugFile = true;
648 649
649 650
650 651
651 /* We wanted to read just user specified configuration. */ 652 /* We wanted to read just user specified configuration. */
652 {break;} 653 {break;}
653 } 654 }
654 655
655 int error=GSM_InitConnection(&s,3); 656 int error=GSM_InitConnection(&s,3);
656 qDebug(" init %d %d", error, ERR_NONE); 657 qDebug(" init %d %d", error, ERR_NONE);
657 if ( error != ERR_NONE ) 658 if ( error != ERR_NONE )
658 return false; 659 return false;
659 // fromString2Cal( calendar, existngCal, &s, "Event" ); 660 // fromString2Cal( calendar, existngCal, &s, "Event" );
660 GSM_Phone_Functions*Phone; 661 GSM_Phone_Functions*Phone;
661 GSM_CalendarEntrynote; 662 GSM_CalendarEntrynote;
662 bool refresh= true; 663 bool refresh= true;
663 Phone=s.Phone.Functions; 664 Phone=s.Phone.Functions;
664 bool gshutdown = false; 665 bool gshutdown = false;
665 PhoneParser handler( calendar, profileName ); 666 PhoneParser handler( calendar, profileName );
666 int ccc = 0; 667 int ccc = 0;
667 while (!gshutdown && ccc++ < 10 ) { 668 while (!gshutdown && ccc++ < 10 ) {
668 669
669 qDebug("readEvent %d ", ccc); 670 qDebug("readEvent %d ", ccc);
670 error=Phone->GetNextCalendar(&s,&note,refresh); 671 error=Phone->GetNextCalendar(&s,&note,refresh);
671 if (error == ERR_EMPTY) break; 672 if (error == ERR_EMPTY) break;
672 handler.readEvent( existingCal, &note ); 673 handler.readEvent( existingCal, &note );
673 } 674 }
674 675
675 bool start = true; 676 bool start = true;
676 GSM_ToDoEntry ToDo; 677 GSM_ToDoEntry ToDo;
677 int ccc = 0; 678 ccc = 0;
678 while (!gshutdown) { 679 while (!gshutdown) {
679 error = Phone->GetNextToDo(&s, &ToDo, start); 680 error = Phone->GetNextToDo(&s, &ToDo, start);
680 if (error == ERR_EMPTY) break; 681 if (error == ERR_EMPTY) break;
681 start = false; 682 start = false;
682 qDebug("readTodo %d ", ++ccc); 683 qDebug("readTodo %d ", ++ccc);
683 handler.readTodo( existingCal, &ToDo, &s); 684 handler.readTodo( existingCal, &ToDo, &s);
684 685
685 } 686 }
686 687
687 error=GSM_TerminateConnection(&s); 688 error=GSM_TerminateConnection(&s);
688 689
689 return true; 690 return true;
690} 691}
691 692
692bool PhoneFormat::save( Calendar *calendar) 693bool PhoneFormat::save( Calendar *calendar)
693{ 694{
694#if 0 695#if 0
695 QLabel status ( i18n("Processing/adding events ..."), 0 ); 696 QLabel status ( i18n("Processing/adding events ..."), 0 );
696 int w = status.sizeHint().width()+20 ; 697 int w = status.sizeHint().width()+20 ;
697 if ( w < 200 ) w = 200; 698 if ( w < 200 ) w = 200;
698 int h = status.sizeHint().height()+20 ; 699 int h = status.sizeHint().height()+20 ;
699 int dw = QApplication::desktop()->width(); 700 int dw = QApplication::desktop()->width();
700 int dh = QApplication::desktop()->height(); 701 int dh = QApplication::desktop()->height();
701 status.setCaption(i18n("Writing DTM Data") ); 702 status.setCaption(i18n("Writing DTM Data") );
702 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 703 status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
703 status.show(); 704 status.show();
704 status.raise(); 705 status.raise();
705 qApp->processEvents(); 706 qApp->processEvents();
706 bool debug = DEBUGMODE; 707 bool debug = DEBUGMODE;
707 QString codec = "utf8"; 708 QString codec = "utf8";
708 QString answer; 709 QString answer;
709 QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n"; 710 QString ePrefix = "CARDID,CATEGORY,DSRP,PLCE,MEM1,TIM1,TIM2,ADAY,ARON,ARMN,ARSD,RTYP,RFRQ,RPOS,RDYS,REND,REDT,ALSD,ALED,MDAY\n";