From 46f47c0a1e542a8b4222f3ced8f3304534c7509d Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 21 Feb 2003 23:31:52 +0000 Subject: Add XML datebookresource -clean up todoaccessxml header -implement some more stuff in the oeven tester -extend DefaultFactory to not crash and to use datebook -reading of OEvents is working nicely.. saving will be added tomorrow -fix spelling in ODateBookAcces --- (limited to 'libopie/pim/test/oevent_test.cpp') diff --git a/libopie/pim/test/oevent_test.cpp b/libopie/pim/test/oevent_test.cpp index 50cc032..6f04995 100644 --- a/libopie/pim/test/oevent_test.cpp +++ b/libopie/pim/test/oevent_test.cpp @@ -1,6 +1,7 @@ #include #include "../oevent.h" +#include "../odatebookaccess.h" int main(int argc, char* argv ) { OEvent ev; @@ -19,5 +20,31 @@ int main(int argc, char* argv ) { qWarning("%s", ev2.startDateTime().toString().latin1() ); qWarning("%s", ev2.startDateTimeInZone().toString().latin1() ); + + 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() ); + } + return 0; } -- cgit v0.9.0.2