Diffstat (limited to 'libopie/pim/test/oevent_test.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/pim/test/oevent_test.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/libopie/pim/test/oevent_test.cpp b/libopie/pim/test/oevent_test.cpp index 247b83b..d83ee0b 100644 --- a/libopie/pim/test/oevent_test.cpp +++ b/libopie/pim/test/oevent_test.cpp | |||
@@ -1,54 +1,33 @@ | |||
1 | #include <qdatetime.h> | 1 | #include <qdatetime.h> |
2 | 2 | ||
3 | #include "../oevent.h" | 3 | #include "../oevent.h" |
4 | #include "../odatebookaccess.h" | 4 | #include "../odatebookaccess.h" |
5 | 5 | ||
6 | int main(int argc, char* argv ) { | 6 | int main(int argc, char* argv ) { |
7 | OEvent ev; | ||
8 | // ev.setUid( 20 ); | ||
9 | |||
10 | ev.setDescription( "Foo Descsfewrf" ); | ||
11 | |||
12 | OEvent ev2 = ev; | ||
13 | ev2.setDescription("Foo3"); | ||
14 | qWarning("%s", ev2.description().latin1() ); | ||
15 | qWarning("%s", ev.description().latin1() ); | ||
16 | |||
17 | QDateTime time = QDateTime::currentDateTime(); | ||
18 | ev2.setStartDateTime( time ); | ||
19 | ev2.setTimeZone( "Europe/London" ); | ||
20 | |||
21 | qWarning("%s", ev2.startDateTime().toString().latin1() ); | ||
22 | qWarning("%s", ev2.startDateTimeInZone().toString().latin1() ); | ||
23 | qWarning("%d %d", ev.isAllDay(), ev2.isAllDay() ); | ||
24 | |||
25 | ODateBookAccess acc; | 7 | ODateBookAccess acc; |
26 | if(!acc.load() ) qWarning("could not load"); | 8 | if(!acc.load() ) qWarning("could not load"); |
27 | 9 | ||
28 | ODateBookAccess::List::Iterator it; | 10 | ODateBookAccess::List::Iterator it; |
29 | ODateBookAccess::List list = acc.allRecords(); | 11 | ODateBookAccess::List list = acc.allRecords(); |
30 | 12 | ||
31 | for( it = list.begin(); it != list.end(); ++it ){ | 13 | for( it = list.begin(); it != list.end(); ++it ){ |
32 | OEvent ev = (*it); | 14 | OEvent ev = (*it); |
33 | qWarning("Summary: %s",ev.description().latin1() ); | 15 | qWarning("Summary: %s",ev.description().latin1() ); |
34 | qWarning("Start: %s End: %s",ev.startDateTime().toString().latin1(), ev.endDateTime().toString().latin1() ); | 16 | qWarning("Start: %s End: %s",ev.startDateTime().toString().latin1(), ev.endDateTime().toString().latin1() ); |
35 | qWarning("All Day: %d",ev.isAllDay() ); | 17 | qWarning("All Day: %d",ev.isAllDay() ); |
36 | 18 | ||
37 | } | 19 | } |
38 | QDate date1(2003,02,01 ); | 20 | QDate date1(2003,02,01 ); |
39 | QDate date2(2003,03,01 ); | 21 | QDate date2(2003,03,01 ); |
40 | 22 | ||
41 | OEffectiveEvent::ValueList effList = acc.effectiveEvents( date1,date2 ); | 23 | OEffectiveEvent::ValueList effList = acc.effectiveEvents( date1,date2 ); |
42 | OEffectiveEvent::ValueList::Iterator effIt; | 24 | OEffectiveEvent::ValueList::Iterator effIt; |
43 | 25 | ||
44 | for( effIt = effList.begin(); effIt != effList.end(); ++effIt ){ | 26 | for( effIt = effList.begin(); effIt != effList.end(); ++effIt ){ |
45 | OEffectiveEvent ef = (*effIt); | 27 | OEffectiveEvent ef = (*effIt); |
46 | qWarning("Summary: %s", ef.description().latin1() ); | 28 | qWarning("Summary: %s", ef.description().latin1() ); |
47 | qWarning("Date: %s", ef.date().toString().latin1() ); | 29 | qWarning("Date: %s", ef.date().toString().latin1() ); |
48 | } | 30 | } |
49 | ev.setUid( 1 ); | ||
50 | acc.add( ev ); | ||
51 | acc.save(); | ||
52 | 31 | ||
53 | return 0; | 32 | return 0; |
54 | } | 33 | } |