summaryrefslogtreecommitdiff
path: root/libopie/pim/test
authorzecke <zecke>2003-02-22 16:11:16 (UTC)
committer zecke <zecke>2003-02-22 16:11:16 (UTC)
commit397a7b1635488deda02b36df70692e27f59bb3e0 (patch) (side-by-side diff)
tree1232b1b7e8ac84c5d48df79b635ba61acbdf0f62 /libopie/pim/test
parente7981098a5c373748d98158e8a6c59750bb0d7dc (diff)
downloadopie-397a7b1635488deda02b36df70692e27f59bb3e0.zip
opie-397a7b1635488deda02b36df70692e27f59bb3e0.tar.gz
opie-397a7b1635488deda02b36df70692e27f59bb3e0.tar.bz2
Implement saving of events
Implement the ExceptionList Add Children and parent to OEvent Make ORecur honor exceptions Extend the test app to add and save
Diffstat (limited to 'libopie/pim/test') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/test/oevent_test.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/libopie/pim/test/oevent_test.cpp b/libopie/pim/test/oevent_test.cpp
index 6f04995..247b83b 100644
--- a/libopie/pim/test/oevent_test.cpp
+++ b/libopie/pim/test/oevent_test.cpp
@@ -1,50 +1,54 @@
#include <qdatetime.h>
#include "../oevent.h"
#include "../odatebookaccess.h"
int main(int argc, char* argv ) {
OEvent ev;
- ev.setUid( 20 );
+// ev.setUid( 20 );
- ev.setDescription( "Foo" );
+ ev.setDescription( "Foo Descsfewrf" );
OEvent ev2 = ev;
- ev2.setDescription("Foo2");
+ ev2.setDescription("Foo3");
qWarning("%s", ev2.description().latin1() );
qWarning("%s", ev.description().latin1() );
QDateTime time = QDateTime::currentDateTime();
ev2.setStartDateTime( time );
ev2.setTimeZone( "Europe/London" );
qWarning("%s", ev2.startDateTime().toString().latin1() );
qWarning("%s", ev2.startDateTimeInZone().toString().latin1() );
+ qWarning("%d %d", ev.isAllDay(), ev2.isAllDay() );
ODateBookAccess acc;
if(!acc.load() ) qWarning("could not load");
ODateBookAccess::List::Iterator it;
ODateBookAccess::List list = acc.allRecords();
for( it = list.begin(); it != list.end(); ++it ){
OEvent ev = (*it);
qWarning("Summary: %s",ev.description().latin1() );
qWarning("Start: %s End: %s",ev.startDateTime().toString().latin1(), ev.endDateTime().toString().latin1() );
qWarning("All Day: %d",ev.isAllDay() );
}
QDate date1(2003,02,01 );
QDate date2(2003,03,01 );
OEffectiveEvent::ValueList effList = acc.effectiveEvents( date1,date2 );
OEffectiveEvent::ValueList::Iterator effIt;
for( effIt = effList.begin(); effIt != effList.end(); ++effIt ){
OEffectiveEvent ef = (*effIt);
qWarning("Summary: %s", ef.description().latin1() );
qWarning("Date: %s", ef.date().toString().latin1() );
}
+ ev.setUid( 1 );
+ acc.add( ev );
+ acc.save();
return 0;
}