summaryrefslogtreecommitdiff
path: root/examples/simple-pim/simple.cpp
Side-by-side diff
Diffstat (limited to 'examples/simple-pim/simple.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/simple-pim/simple.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/examples/simple-pim/simple.cpp b/examples/simple-pim/simple.cpp
index efd5070..d3ce2cc 100644
--- a/examples/simple-pim/simple.cpp
+++ b/examples/simple-pim/simple.cpp
@@ -274,5 +274,5 @@ void MainWindow::slotLoadForDay(const QDate& date) {
/* all todos for today including the ones without dueDate */
m_todoView->set( m_tb.effectiveToDos(date, date ) );
- m_dateView->set( m_db.effectiveEvents( date, date ) );
+ m_dateView->set( m_db.occurrences( date, date ) );
}
@@ -409,11 +409,11 @@ void PIMListView::set( Opie::OPimTodoAccess::List list ) {
}
-void PIMListView::set( const Opie::OEffectiveEvent::ValueList& lst ) {
+void PIMListView::set( const Opie::OPimOccurrence::List& lst ) {
/* clear first and then add items */
clear();
- Opie::OEffectiveEvent::ValueList::ConstIterator it;
+ Opie::OPimOccurrence::List::ConstIterator it;
for ( it = lst.begin(); it != lst.end(); ++it ) {
- PIMListViewItem *i = new PIMListViewItem(this, new Opie::OPimEvent( (*it).event() ) );
+ PIMListViewItem *i = new PIMListViewItem(this, new Opie::OPimEvent( (*it).toEvent() ) );
i->setText( 0, PIMListView::makeString( (*it) ) );
}
@@ -437,16 +437,21 @@ void PIMListView::showCurrentRecord() {
}
-QString PIMListView::makeString( const Opie::OEffectiveEvent& ev ) {
+QString PIMListView::makeString( const Opie::OPimOccurrence& _ev ) {
QString str;
- str += ev.description();
- if ( !ev.event().isAllDay() ) {
+ str += _ev.summary();
+
+ Opie::OPimEvent ev = _ev.toEvent();
+ if ( !ev.isAllDay() ) {
+#if 0
if ( ev.startDate() != ev.endDate() ) {
- str += tr("Start ") + TimeString::timeString( ev.event().startDateTime().time() );
- str += " - " + TimeString::longDateString( ev.startDate() );
- str += tr("End ") + TimeString::timeString( ev.event().endDateTime().time() );
- str += " - " + TimeString::longDateString( ev.endDate() );
- }else{
- str += tr("Time ") + TimeString::timeString( ev.startTime() );
- str += " - " + TimeString::timeString( ev.endTime() );
+ str += tr("Start ") + TimeString::timeString( ev.startDateTime().time() );
+ str += " - " + TimeString::longDateString( ev.startDateTime().date() );
+ str += tr("End ") + TimeString::timeString( ev.endDateTime().time() );
+ str += " - " + TimeString::longDateString( ev.endDateTime().date() );
+ }else
+#endif
+ {
+ str += tr("Time ") + TimeString::timeString( _ev.startTime() );
+ str += " - " + TimeString::timeString( _ev.endTime() );
}
}else