summaryrefslogtreecommitdiffabout
path: root/libkcal/phoneformat.cpp
Unidiff
Diffstat (limited to 'libkcal/phoneformat.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/phoneformat.cpp60
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
@@ -871,57 +871,15 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
871void PhoneFormat::event2GSM( Event* ev, GSM_CalendarEntry*Note ) 871void PhoneFormat::event2GSM( Event* ev, GSM_CalendarEntry*Note )
872{ 872{
873 873 QString eText = vfconverter.eventToString( ev );
874 int pos = 0;
875 GSM_ToDoEntry dummy;
876 GSM_DecodeVCALENDAR_VTODO( (unsigned char*)eText.latin1(), &pos, Note , &dummy, Nokia_VCalendar, Nokia_VToDo );
874} 877}
875void PhoneFormat::todo2GSM( Todo* todo, GSM_ToDoEntry *gsm ) 878void PhoneFormat::todo2GSM( Todo* todo, GSM_ToDoEntry *gsmTodo )
876{ 879{
877#if 0 880 QString tText = vfconverter.todoToString( todo );
878 QStringList list; 881 int pos = 0;
879 list.append( QString::number( todo->zaurusId() ) ); 882 GSM_CalendarEntry dummy;
880 list.append( todo->categories().join(",") ); 883 GSM_DecodeVCALENDAR_VTODO( (unsigned char*)tText.latin1(), &pos, &dummy, gsmTodo, Nokia_VCalendar, Nokia_VToDo );
881
882 if ( todo->hasStartDate() ) {
883 list.append( dtToString( todo->dtStart()) );
884 } else
885 list.append( QString() );
886
887 if ( todo->hasDueDate() ) {
888 QTime tim;
889 if ( todo->doesFloat()) {
890 list.append( dtToString( QDateTime(todo->dtDue().date(),QTime( 0,0,0 )), false)) ;
891 } else {
892 list.append( dtToString(todo->dtDue() ) );
893 }
894 } else
895 list.append( QString() );
896
897 if ( todo->isCompleted() ) {
898 list.append( dtToString( todo->completed()) );
899 list.append( "0" ); // yes 0 == completed
900 } else {
901 list.append( dtToString( todo->completed()) );
902 list.append( "1" );
903 }
904 list.append( QString::number( todo->priority() ));
905 if( ! todo->summary().isEmpty() )
906 list.append( todo->summary() );
907 else
908 list.append( "" );
909 if (! todo->description().isEmpty() )
910 list.append( todo->description() );
911 else
912 list.append( "" );
913 for(QStringList::Iterator it=list.begin();
914 it!=list.end(); ++it){
915 QString& s = (*it);
916 s.replace(QRegExp("\""), "\"\"");
917 if(s.contains(QRegExp("[,\"\r\n]")) || s.stripWhiteSpace() != s){
918 s.prepend('\"');
919 s.append('\"');
920 } else if(s.isEmpty() && !s.isNull()){
921 s = "\"\"";
922 }
923 }
924 return list.join(",");
925#endif
926} 884}
927void PhoneFormat::afterSave( Incidence* inc) 885void PhoneFormat::afterSave( Incidence* inc)