-rw-r--r-- | libkcal/phoneformat.cpp | 16 | ||||
-rw-r--r-- | libkcal/sharpformat.cpp | 8 |
2 files changed, 22 insertions, 2 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 7e1c9cd..94744fb 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -167,14 +167,20 @@ public: alarm = new Alarm( todo ); todo->addAlarm( alarm ); } alarm->setType( Alarm::Audio ); alarm->setEnabled( true ); int alarmOffset = alarmDt.secsTo( todo->dtStart() ); - alarm->setStartOffset( alarmOffset ); + alarm->setStartOffset( -alarmOffset ); alarmString = QString::number( alarmOffset ); + } else { + Alarm *alarm; + if ( todo->alarms().count() > 0 ) { + alarm = todo->alarms().first(); + alarm->setEnabled( false ); + } } // csum ***************************************** QStringList attList; uint cSum; if ( todo->hasDueDate() ) attList << dtToString ( todo->dtDue() ); @@ -445,14 +451,20 @@ public: alarm = new Alarm( event ); event->addAlarm( alarm ); } alarm->setType( Alarm::Audio ); alarm->setEnabled( true ); int alarmOffset = alarmDt.secsTo( event->dtStart() ); - alarm->setStartOffset( alarmOffset ); + alarm->setStartOffset( -alarmOffset ); alarmString = QString::number( alarmOffset ); + } else { + Alarm *alarm; + if ( event->alarms().count() > 0 ) { + alarm = event->alarms().first(); + alarm->setEnabled( false ); + } } // csum ***************************************** QStringList attList; uint cSum; attList << dtToString ( event->dtStart() ); attList << dtToString ( event->dtEnd() ); diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index 4e54fdf..f8b066d 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -162,12 +162,14 @@ class SharpParser : public QObject if ( hasEndDate ) r->setYearly( Recurrence::rYearlyMonth, freq, endDate ); else r->setYearly( Recurrence::rYearlyMonth, freq, -1 ); r->addYearlyNum( startDate.month() ); } + } else { + event->recurrence()->unsetRecurs(); } QString categoryList = attList[1] ; event->setCategories( lookupCategories( categoryList ) ); // strange 0 semms to mean: alarm enabled @@ -180,12 +182,18 @@ class SharpParser : public QObject event->addAlarm( alarm ); } alarm->setType( Alarm::Audio ); alarm->setEnabled( true ); int alarmOffset = attList[9].toInt(); alarm->setStartOffset( alarmOffset * -60 ); + } else { + Alarm *alarm; + if ( event->alarms().count() > 0 ) { + alarm = event->alarms().first(); + alarm->setEnabled( false ); + } } mCalendar->addEvent( event); } else if ( qName == "Todo" ) { Todo *todo; |