-rw-r--r-- | libkcal/phoneformat.cpp | 60 |
1 files changed, 9 insertions, 51 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 11c68c5..e6d4879 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -872,55 +872,13 @@ 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 ); } |