author | zautrix <zautrix> | 2004-10-18 09:08:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-18 09:08:13 (UTC) |
commit | 56990d318b15eacf7d3cc7425ab62f68da099ddf (patch) (side-by-side diff) | |
tree | b2f021bd75bc6a08fa8fc51a07ce1755b8e4a95e /libkcal | |
parent | 1712d92ea25b220273859d985bc7211fa7a97a39 (diff) | |
download | kdepimpi-56990d318b15eacf7d3cc7425ab62f68da099ddf.zip kdepimpi-56990d318b15eacf7d3cc7425ab62f68da099ddf.tar.gz kdepimpi-56990d318b15eacf7d3cc7425ab62f68da099ddf.tar.bz2 |
fix of tmp file path for desktop version
-rw-r--r-- | libkcal/phoneformat.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 101db57..900fc04 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -269,49 +269,49 @@ ulong PhoneFormat::getCsum( const QStringList & attList) int mul = k +1; add = s[k].unicode (); if ( k < 16 ) mul = mul * mul; int ii = i+1; add = add * mul *ii*ii*ii; cSum += add; } } } //QString dump = attList.join(","); //qDebug("csum: %d %s", cSum,dump.latin1()); return cSum; } //extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum); #include <stdlib.h> #define DEBUGMODE false bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) { QString fileName; -#ifdef _WIN32_ +#ifdef DESKTOP_VERSION fileName = locateLocal("tmp", "phonefile.vcs"); #else fileName = "/tmp/phonefile.vcs"; #endif QString command; 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 ) { QStringList cat = ev->categories(); if ( cat.contains( "MeetingDEF" )) { ev->setCategories( QStringList() ); } else if ( cat.contains( "Birthday" )) { ev->setFloats( true ); @@ -456,49 +456,49 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) // set percentcomplete only, if to->isCompleted() if ( to->isCompleted() ) to->setPercentComplete(from->percentComplete()); } if( to->priority() == 2 && from->priority() == 1 ) ; //skip else if (to->priority() == 4 && from->priority() == 5 ) ; else to->setPriority(from->priority()); } #include <qcstring.h> void PhoneFormat::afterSave( Incidence* inc,const QString& id ,const QString& csum) { inc->setID( mProfileName, id ); inc->setCsum( mProfileName, csum); inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); } bool PhoneFormat::writeToPhone( Calendar * calendar) { -#ifdef _WIN32_ +#ifdef DESKTOP_VERSION QString fileName = locateLocal("tmp", "phonefile.vcs"); #else QString fileName = "/tmp/phonefile.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) { // 1 remove events which should be deleted QPtrList<Event> er = calendar->rawEvents(); Event* ev = er.first(); while ( ev ) { if ( ev->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { calendar->deleteEvent( ev ); |