summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/phoneformat.cpp7
-rw-r--r--libkdepim/phoneaccess.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 3555dc6..281434e 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -293,15 +293,13 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
293#ifdef _WIN32_ 293#ifdef _WIN32_
294 fileName = locateLocal("tmp", "phonefile.vcs"); 294 fileName = locateLocal("tmp", "phonefile.vcs");
295#else 295#else
296 fileName = "/tmp/phonefile.vcs"; 296 fileName = "/tmp/phonefile.vcs";
297#endif 297#endif
298 QString command; 298 QString command;
299 int ret = PhoneAccess::readFromPhone( fileName ); 299 if ( ! PhoneAccess::readFromPhone( fileName )) {
300 if ( ret != 0 ) {
301 qDebug("Error::command returned %d", ret);
302 return false; 300 return false;
303 } 301 }
304 VCalFormat vfload; 302 VCalFormat vfload;
305 vfload.setLocalTime ( true ); 303 vfload.setLocalTime ( true );
306 qDebug("loading file ..."); 304 qDebug("loading file ...");
307 305
@@ -484,14 +482,17 @@ bool PhoneFormat::writeToPhone( Calendar * calendar)
484#else 482#else
485 QString fileName = "/tmp/kdepimtemp.vcs"; 483 QString fileName = "/tmp/kdepimtemp.vcs";
486#endif 484#endif
487 485
488 VCalFormat vfsave; 486 VCalFormat vfsave;
489 vfsave.setLocalTime ( true ); 487 vfsave.setLocalTime ( true );
488 QString id = calendar->timeZoneId();
489 calendar->setLocalTime();
490 if ( ! vfsave.save( calendar, fileName ) ) 490 if ( ! vfsave.save( calendar, fileName ) )
491 return false; 491 return false;
492 calendar->setTimeZoneId( id );
492 return PhoneAccess::writeToPhone( fileName ); 493 return PhoneAccess::writeToPhone( fileName );
493} 494}
494bool PhoneFormat::save( Calendar *calendar) 495bool PhoneFormat::save( Calendar *calendar)
495{ 496{
496 QLabel status ( i18n(" Opening device ..."), 0 ); 497 QLabel status ( i18n(" Opening device ..."), 0 );
497 int w = status.sizeHint().width()+20 ; 498 int w = status.sizeHint().width()+20 ;
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index 5fafa1f..8298aa6 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -160,13 +160,13 @@ bool PhoneAccess::readFromPhone( QString fileName)
160#endif 160#endif
161#else 161#else
162 QString command ="kammu --backup " + fileName + " -yes" ; 162 QString command ="kammu --backup " + fileName + " -yes" ;
163#endif 163#endif
164 int ret; 164 int ret;
165 while ( (ret = system ( command.latin1())) != 0 ) { 165 while ( (ret = system ( command.latin1())) != 0 ) {
166 qDebug("Error S::command returned %d.", ret); 166 qDebug("Error reading from phone:Command returned %d", ret);
167 int retval = KMessageBox::warningContinueCancel(0, 167 int retval = KMessageBox::warningContinueCancel(0,
168 i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel")); 168 i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel"));
169 if ( retval != KMessageBox::Continue ) 169 if ( retval != KMessageBox::Continue )
170 return false; 170 return false;
171 } 171 }
172 return true; 172 return true;