summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/phoneformat.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 0bc9125..2ad1b5a 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -275,25 +275,26 @@ ulong PhoneFormat::getCsum( const QStringList & attList)
275//extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum); 275//extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum);
276#include <stdlib.h> 276#include <stdlib.h>
277#define DEBUGMODE false 277#define DEBUGMODE false
278bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) 278bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
279{ 279{
280 280
281 QString fileName; 281 QString fileName;
282#ifdef _WIN32_ 282#ifdef _WIN32_
283 fileName = locateLocal("data", "korganizer") + "\\tempfile.vcs"; 283 fileName = locateLocal("data", "korganizer") + "\\tempfile.vcs";
284#else 284#else
285 fileName = "/tmp/kdepimtemp.vcs"; 285 fileName = "/tmp/kdepimtemp.vcs";
286#endif 286#endif
287 QString command ="./kammu --backup " + fileName + " -yes"; 287 QString command ="./kammu --backup " + fileName + " -yes -C" +
288 mConnection +" -D" + mDevice +" -M" + mModel;
288 int ret = system ( command.latin1() ); 289 int ret = system ( command.latin1() );
289 if ( ret != 0 ) 290 if ( ret != 0 )
290 return false; 291 return false;
291 VCalFormat vfload; 292 VCalFormat vfload;
292 vfload.setLocalTime ( true ); 293 vfload.setLocalTime ( true );
293 if ( ! vfload.load( calendar, fileName ) ) 294 if ( ! vfload.load( calendar, fileName ) )
294 return false; 295 return false;
295 QPtrList<Event> er = calendar->rawEvents(); 296 QPtrList<Event> er = calendar->rawEvents();
296 Event* ev = er.first(); 297 Event* ev = er.first();
297 while ( ev ) { 298 while ( ev ) {
298 int id = ev->pilotId(); 299 int id = ev->pilotId();
299 Event *event; 300 Event *event;
@@ -479,25 +480,26 @@ bool PhoneFormat::save( Calendar *calendar)
479 while ( to ) { 480 while ( to ) {
480 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { 481 if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) {
481 calendar->deleteTodo( to ); 482 calendar->deleteTodo( to );
482 } 483 }
483 to = tl.next(); 484 to = tl.next();
484 } 485 }
485 // 3 save file 486 // 3 save file
486 VCalFormat vfsave; 487 VCalFormat vfsave;
487 vfsave.setLocalTime ( true ); 488 vfsave.setLocalTime ( true );
488 if ( ! vfsave.save( calendar, fileName ) ) 489 if ( ! vfsave.save( calendar, fileName ) )
489 return false; 490 return false;
490 // 4 call kammu 491 // 4 call kammu
491 QString command ="./kammu --restore " + fileName ; 492 QString command ="./kammu --restore " + fileName + " -C" +
493 mConnection +" -D" + mDevice +" -M" + mModel;;
492 int ret = system ( command.latin1() ); 494 int ret = system ( command.latin1() );
493 if ( ret != 0 ) 495 if ( ret != 0 )
494 return false; 496 return false;
495 // 5 reread data 497 // 5 reread data
496 message = i18n(" Rereading all data ... "); 498 message = i18n(" Rereading all data ... ");
497 status.setText ( message ); 499 status.setText ( message );
498 qApp->processEvents(); 500 qApp->processEvents();
499 CalendarLocal* calendarTemp = new CalendarLocal(); 501 CalendarLocal* calendarTemp = new CalendarLocal();
500 calendarTemp->setTimeZoneId( calendar->timeZoneId()); 502 calendarTemp->setTimeZoneId( calendar->timeZoneId());
501 if ( ! load( calendarTemp,calendar) ){ 503 if ( ! load( calendarTemp,calendar) ){
502 qDebug("error reloading calendar "); 504 qDebug("error reloading calendar ");
503 delete calendarTemp; 505 delete calendarTemp;