-rw-r--r-- | libkcal/phoneformat.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index c39413e..3555dc6 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp | |||
@@ -270,58 +270,54 @@ ulong PhoneFormat::getCsum( const QStringList & attList) | |||
270 | add = s[k].unicode (); | 270 | add = s[k].unicode (); |
271 | if ( k < 16 ) | 271 | if ( k < 16 ) |
272 | mul = mul * mul; | 272 | mul = mul * mul; |
273 | int ii = i+1; | 273 | int ii = i+1; |
274 | add = add * mul *ii*ii*ii; | 274 | add = add * mul *ii*ii*ii; |
275 | cSum += add; | 275 | cSum += add; |
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
279 | } | 279 | } |
280 | //QString dump = attList.join(","); | 280 | //QString dump = attList.join(","); |
281 | //qDebug("csum: %d %s", cSum,dump.latin1()); | 281 | //qDebug("csum: %d %s", cSum,dump.latin1()); |
282 | 282 | ||
283 | return cSum; | 283 | return cSum; |
284 | 284 | ||
285 | } | 285 | } |
286 | //extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum); | 286 | //extern "C" GSM_Error GSM_InitConnection(GSM_StateMachine *s, int ReplyNum); |
287 | #include <stdlib.h> | 287 | #include <stdlib.h> |
288 | #define DEBUGMODE false | 288 | #define DEBUGMODE false |
289 | bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) | 289 | bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) |
290 | { | 290 | { |
291 | 291 | ||
292 | QString fileName; | 292 | QString fileName; |
293 | #ifdef _WIN32_ | 293 | #ifdef _WIN32_ |
294 | fileName = locateLocal("tmp", "tempfile.vcs"); | 294 | fileName = locateLocal("tmp", "phonefile.vcs"); |
295 | #else | 295 | #else |
296 | fileName = "/tmp/kdepimtemp.vcs"; | 296 | fileName = "/tmp/phonefile.vcs"; |
297 | #endif | 297 | #endif |
298 | #ifdef DESKTOP_VERSION | 298 | QString command; |
299 | QString command ="./kammu --backup " + fileName + " -yes" ; | 299 | int ret = PhoneAccess::readFromPhone( fileName ); |
300 | #else | ||
301 | QString command ="kammu --backup " + fileName + " -yes" ; | ||
302 | #endif | ||
303 | int ret = system ( command.latin1() ); | ||
304 | if ( ret != 0 ) { | 300 | if ( ret != 0 ) { |
305 | qDebug("Error::command returned %d", ret); | 301 | qDebug("Error::command returned %d", ret); |
306 | return false; | 302 | return false; |
307 | } | 303 | } |
308 | VCalFormat vfload; | 304 | VCalFormat vfload; |
309 | vfload.setLocalTime ( true ); | 305 | vfload.setLocalTime ( true ); |
310 | qDebug("loading file ..."); | 306 | qDebug("loading file ..."); |
311 | 307 | ||
312 | if ( ! vfload.load( calendar, fileName ) ) | 308 | if ( ! vfload.load( calendar, fileName ) ) |
313 | return false; | 309 | return false; |
314 | QPtrList<Event> er = calendar->rawEvents(); | 310 | QPtrList<Event> er = calendar->rawEvents(); |
315 | Event* ev = er.first(); | 311 | Event* ev = er.first(); |
316 | qDebug("reading events... "); | 312 | qDebug("reading events... "); |
317 | while ( ev ) { | 313 | while ( ev ) { |
318 | QStringList cat = ev->categories(); | 314 | QStringList cat = ev->categories(); |
319 | if ( cat.contains( "MeetingDEF" )) { | 315 | if ( cat.contains( "MeetingDEF" )) { |
320 | ev->setCategories( QStringList() ); | 316 | ev->setCategories( QStringList() ); |
321 | } | 317 | } |
322 | int id = ev->pilotId(); | 318 | int id = ev->pilotId(); |
323 | Event *event; | 319 | Event *event; |
324 | event = existingCal->event( mProfileName ,QString::number( id ) ); | 320 | event = existingCal->event( mProfileName ,QString::number( id ) ); |
325 | if ( event ) { | 321 | if ( event ) { |
326 | event = (Event*)event->clone(); | 322 | event = (Event*)event->clone(); |
327 | copyEvent( event, ev ); | 323 | copyEvent( event, ev ); |