From 4f05a9fcbb9e54184aef93883886aaf865104463 Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 09 Aug 2004 18:02:44 +0000 Subject: more syncing --- (limited to 'libkcal/phoneformat.cpp') diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 11c68c5..e6d4879 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -870,59 +870,17 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal) } void PhoneFormat::event2GSM( Event* ev, GSM_CalendarEntry*Note ) { - + QString eText = vfconverter.eventToString( ev ); + int pos = 0; + GSM_ToDoEntry dummy; + GSM_DecodeVCALENDAR_VTODO( (unsigned char*)eText.latin1(), &pos, Note , &dummy, Nokia_VCalendar, Nokia_VToDo ); } -void PhoneFormat::todo2GSM( Todo* todo, GSM_ToDoEntry *gsm ) +void PhoneFormat::todo2GSM( Todo* todo, GSM_ToDoEntry *gsmTodo ) { -#if 0 - QStringList list; - list.append( QString::number( todo->zaurusId() ) ); - list.append( todo->categories().join(",") ); - - if ( todo->hasStartDate() ) { - list.append( dtToString( todo->dtStart()) ); - } else - list.append( QString() ); - - if ( todo->hasDueDate() ) { - QTime tim; - if ( todo->doesFloat()) { - list.append( dtToString( QDateTime(todo->dtDue().date(),QTime( 0,0,0 )), false)) ; - } else { - list.append( dtToString(todo->dtDue() ) ); - } - } else - list.append( QString() ); - - if ( todo->isCompleted() ) { - list.append( dtToString( todo->completed()) ); - list.append( "0" ); // yes 0 == completed - } else { - list.append( dtToString( todo->completed()) ); - list.append( "1" ); - } - list.append( QString::number( todo->priority() )); - if( ! todo->summary().isEmpty() ) - list.append( todo->summary() ); - else - list.append( "" ); - if (! todo->description().isEmpty() ) - list.append( todo->description() ); - else - list.append( "" ); - for(QStringList::Iterator it=list.begin(); - it!=list.end(); ++it){ - QString& s = (*it); - s.replace(QRegExp("\""), "\"\""); - if(s.contains(QRegExp("[,\"\r\n]")) || s.stripWhiteSpace() != s){ - s.prepend('\"'); - s.append('\"'); - } else if(s.isEmpty() && !s.isNull()){ - s = "\"\""; - } - } - return list.join(","); -#endif + QString tText = vfconverter.todoToString( todo ); + int pos = 0; + GSM_CalendarEntry dummy; + GSM_DecodeVCALENDAR_VTODO( (unsigned char*)tText.latin1(), &pos, &dummy, gsmTodo, Nokia_VCalendar, Nokia_VToDo ); } void PhoneFormat::afterSave( Incidence* inc) { -- cgit v0.9.0.2