author | zautrix <zautrix> | 2004-08-09 11:07:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-09 11:07:44 (UTC) |
commit | 2d3e20244a156485f6001aa82c4494dfce177b8f (patch) (side-by-side diff) | |
tree | c5cc2cc6eaa79b6d6dd1c7dd27f29d3871d6a528 | |
parent | b51c65d86224ee7d77e672fcfba5ea92d55eed0e (diff) | |
download | kdepimpi-2d3e20244a156485f6001aa82c4494dfce177b8f.zip kdepimpi-2d3e20244a156485f6001aa82c4494dfce177b8f.tar.gz kdepimpi-2d3e20244a156485f6001aa82c4494dfce177b8f.tar.bz2 |
minor fixes
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | libkcal/phoneformat.cpp | 16 | ||||
-rw-r--r-- | libkcal/sharpformat.cpp | 8 |
3 files changed, 23 insertions, 3 deletions
@@ -1,27 +1,27 @@ ############################################################################# # Makefile for building: kopi-desktop -# Generated by qmake (1.07a) (Qt 3.3.2) on: Sun Aug 8 12:23:00 2004 +# Generated by qmake (1.07a) (Qt 3.3.3) on: Mon Aug 9 12:10:32 2004 # Project: kopi-desktop.pro # Template: subdirs # Command: $(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kopi-desktop.pro ############################################################################# MAKEFILE = Makefile QMAKE = qmake DEL_FILE = rm -f CHK_DIR_EXISTS= test -d MKDIR = mkdir -p INSTALL_FILE= INSTALL_DIR = SUBTARGETS = \ sub-gammu-emb-common \ sub-libical \ sub-libkcal \ sub-microkde \ sub-libkdepim \ sub-kabc \ sub-korganizer \ sub-kaddressbook \ sub-kabc-plugins-file \ sub-kabc-plugins-dir diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index 7e1c9cd..94744fb 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -149,50 +149,56 @@ public: printmsg("Contact : %d\n",ToDo->Entries[j].Number); } #endif break; case TODO_PHONE: #if 0 // not supported printmsg("Phone : \"%s\"\n",DecodeUnicodeConsole(ToDo->Entries[j].Text)); #endif break; } } QString alarmString = ""; if ( alarm ) { Alarm *alarm; if ( todo->alarms().count() > 0 ) alarm = todo->alarms().first(); else { 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() ); attList << QString::number( id ); attList << todo->summary(); attList << completedString; attList << QString::number( todo->priority() ); attList << alarmString; attList << todo->categoriesStr(); attList << todo->secrecyStr(); cSum = PhoneFormat::getCsum(attList ); todo->setCsum( mProfileName, QString::number( cSum )); mCalendar->addTodo( todo); return true; } bool readEvent( Calendar *existingCalendar, GSM_CalendarEntry* Note) { int id = Note->Location; Event *event; @@ -427,50 +433,56 @@ public: else r->setYearly( Recurrence::rYearlyMonth, freq, -1 ); r->addYearlyNum( startDate.month() ); } } else { event->recurrence()->unsetRecurs(); } QStringList categoryList; categoryList << getCategory( Note ); event->setCategories( categoryList ); QString alarmString = ""; // strange 0 semms to mean: alarm enabled if ( alarm ) { Alarm *alarm; if ( event->alarms().count() > 0 ) alarm = event->alarms().first(); else { 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() ); attList << QString::number( id ); attList << event->summary(); attList << event->location(); attList << alarmString; attList << recurString; attList << event->categoriesStr(); attList << event->secrecyStr(); cSum = PhoneFormat::getCsum(attList ); event->setCsum( mProfileName, QString::number( cSum )); mCalendar->addEvent( event); return true; } QDateTime fromGSM ( GSM_DateTime* dtp, bool useTz = true ) { QDateTime dt; int y,m,t,h,min,sec; diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index 4e54fdf..f8b066d 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -144,66 +144,74 @@ class SharpParser : public QObject if ( hasEndDate ) r->setWeekly( freq, weekDays, endDate ); else r->setWeekly( freq, weekDays, -1 ); } else if ( rtype == "3" ) { if ( hasEndDate ) r->setMonthly( Recurrence::rMonthlyDay, freq, endDate ); else r->setMonthly( Recurrence::rMonthlyDay, freq, -1 ); r->addMonthlyDay( startDate.day() ); } else if ( rtype == "2" ) { if ( hasEndDate ) r->setMonthly( Recurrence::rMonthlyPos, freq, endDate ); else r->setMonthly( Recurrence::rMonthlyPos, freq, -1 ); QBitArray days( 7 ); days.fill( false ); days.setBit( startDate.dayOfWeek() - 1 ); r->addMonthlyPos( pos, days ); } else if ( rtype == "4" ) { 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 if ( attList[8] == "0" ) { Alarm *alarm; if ( event->alarms().count() > 0 ) alarm = event->alarms().first(); else { alarm = new Alarm( event ); 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; todo = existingCalendar->todo( "Sharp_DTM", attList[0] ); if (todo ) todo = (Todo*)todo->clone(); else todo = new Todo; //CARDID,CATEGORY,ETDY,LTDY,FNDY,MARK,PRTY,TITL,MEM1 // 0 1 2 3 4 5 6 7 8 //1,,,,,1,4,Loch zumachen,"" //3,Privat,20040317T000000,20040318T000000,20040319T000000,0,5,Call bbb,"notes123 bbb gggg ""bb "" " //2,"Familie,Freunde,Holiday",20040318T000000,20040324T000000,20040317T000000,1,2,tod2,notes todo->setID( "Sharp_DTM", attList[0]); todo->setCsum( "Sharp_DTM", QString::number( cSum )); todo->setTempSyncStat( SYNC_TEMPSTATE_NEW_EXTERNAL ); todo->setSummary( attList[7] ); todo->setDescription( attList[8]); |