summaryrefslogtreecommitdiffabout
path: root/libkcal/phoneformat.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/phoneformat.cpp') (more/less context) (show 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 3555dc6..281434e 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -287,27 +287,25 @@ ulong PhoneFormat::getCsum( const QStringList & attList)
#include <stdlib.h>
#define DEBUGMODE false
bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
{
QString fileName;
#ifdef _WIN32_
fileName = locateLocal("tmp", "phonefile.vcs");
#else
fileName = "/tmp/phonefile.vcs";
#endif
QString command;
- int ret = PhoneAccess::readFromPhone( fileName );
- if ( ret != 0 ) {
- qDebug("Error::command returned %d", ret);
+ if ( ! PhoneAccess::readFromPhone( fileName )) {
return false;
}
VCalFormat vfload;
vfload.setLocalTime ( true );
qDebug("loading file ...");
if ( ! vfload.load( calendar, fileName ) )
return false;
QPtrList<Event> er = calendar->rawEvents();
Event* ev = er.first();
qDebug("reading events... ");
while ( ev ) {
@@ -478,26 +476,29 @@ void PhoneFormat::afterSave( Incidence* inc)
}
bool PhoneFormat::writeToPhone( Calendar * calendar)
{
#ifdef _WIN32_
QString fileName = locateLocal("tmp", "tempfile.vcs");
#else
QString fileName = "/tmp/kdepimtemp.vcs";
#endif
VCalFormat vfsave;
vfsave.setLocalTime ( true );
+ QString id = calendar->timeZoneId();
+ calendar->setLocalTime();
if ( ! vfsave.save( calendar, fileName ) )
return false;
+ calendar->setTimeZoneId( id );
return PhoneAccess::writeToPhone( fileName );
}
bool PhoneFormat::save( Calendar *calendar)
{
QLabel status ( i18n(" Opening device ..."), 0 );
int w = status.sizeHint().width()+20 ;
if ( w < 200 ) w = 230;
int h = status.sizeHint().height()+20 ;
int dw = QApplication::desktop()->width();
int dh = QApplication::desktop()->height();
status.setCaption(i18n("Writing to phone...") );
status.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );