summaryrefslogtreecommitdiff
path: root/libopie/pim/otodoaccess.cpp
Unidiff
Diffstat (limited to 'libopie/pim/otodoaccess.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/otodoaccess.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie/pim/otodoaccess.cpp b/libopie/pim/otodoaccess.cpp
index a65cf5c..8ec09bc 100644
--- a/libopie/pim/otodoaccess.cpp
+++ b/libopie/pim/otodoaccess.cpp
@@ -1,71 +1,71 @@
1#include <qdatetime.h> 1#include <qdatetime.h>
2 2
3#include <qpe/alarmserver.h> 3#include <qpe/alarmserver.h>
4 4
5#include "otodoaccessxml.h" 5#include "otodoaccessxml.h"
6#include "otodoaccess.h" 6#include "otodoaccess.h"
7 7
8 8
9OTodoAccess::OTodoAccess( OTodoAccessBackend* end ) 9OTodoAccess::OTodoAccess( OTodoAccessBackend* end )
10 : QObject(), OPimAccessTemplate<OTodo>( end ), m_todoBackEnd( end ) 10 : QObject(), OPimAccessTemplate<OTodo>( end ), m_todoBackEnd( end )
11{ 11{
12 if (end == 0l ) 12 if (end == 0l )
13 m_todoBackEnd = new OTodoAccessXML( "Todolist" ); 13 m_todoBackEnd = new OTodoAccessXML( "Todolist" );
14 14
15 setBackEnd( m_todoBackEnd ); 15 setBackEnd( m_todoBackEnd );
16} 16}
17OTodoAccess::~OTodoAccess() { 17OTodoAccess::~OTodoAccess() {
18 qWarning("~OTodoAccess"); 18// qWarning("~OTodoAccess");
19} 19}
20void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) { 20void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) {
21 QValueList<OTodo>::ConstIterator it; 21 QValueList<OTodo>::ConstIterator it;
22 for ( it = list.begin(); it != list.end(); ++it ) { 22 for ( it = list.begin(); it != list.end(); ++it ) {
23 replace( (*it) ); 23 replace( (*it) );
24 } 24 }
25} 25}
26OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, 26OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start,
27 const QDate& end, 27 const QDate& end,
28 bool includeNoDates ) { 28 bool includeNoDates ) {
29 QArray<int> ints = m_todoBackEnd->effectiveToDos( start, end, includeNoDates ); 29 QArray<int> ints = m_todoBackEnd->effectiveToDos( start, end, includeNoDates );
30 30
31 List lis( ints, this ); 31 List lis( ints, this );
32 return lis; 32 return lis;
33} 33}
34OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, 34OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start,
35 bool includeNoDates ) { 35 bool includeNoDates ) {
36 return effectiveToDos( start, QDate::currentDate(), 36 return effectiveToDos( start, QDate::currentDate(),
37 includeNoDates ); 37 includeNoDates );
38} 38}
39OTodoAccess::List OTodoAccess::overDue() { 39OTodoAccess::List OTodoAccess::overDue() {
40 List lis( m_todoBackEnd->overDue(), this ); 40 List lis( m_todoBackEnd->overDue(), this );
41 return lis; 41 return lis;
42} 42}
43void OTodoAccess::addAlarm( const OTodo& event) { 43void OTodoAccess::addAlarm( const OTodo& event) {
44 if (!event.hasAlarmDateTime() ) 44 if (!event.hasAlarmDateTime() )
45 return; 45 return;
46 46
47 QDateTime now = QDateTime::currentDateTime(); 47 QDateTime now = QDateTime::currentDateTime();
48 QDateTime schedule = event.alarmDateTime(); 48 QDateTime schedule = event.alarmDateTime();
49 49
50 if ( schedule > now ){ 50 if ( schedule > now ){
51 AlarmServer::addAlarm( schedule, 51 AlarmServer::addAlarm( schedule,
52 "QPE/Application/todolist", 52 "QPE/Application/todolist",
53 "alarm(QDateTime,int)", event.uid() ); 53 "alarm(QDateTime,int)", event.uid() );
54 54
55 } 55 }
56} 56}
57void OTodoAccess::delAlarm( int uid) { 57void OTodoAccess::delAlarm( int uid) {
58 58
59 QDateTime schedule; // Create null DateTime 59 QDateTime schedule; // Create null DateTime
60 60
61 // I hope this will remove all scheduled alarms 61 // I hope this will remove all scheduled alarms
62 // with the given uid !? 62 // with the given uid !?
63 // If not: I have to rethink how to remove already 63 // If not: I have to rethink how to remove already
64 // scheduled events... (se) 64 // scheduled events... (se)
65 // it should be fine -zecke 65 // it should be fine -zecke
66 qWarning("Removing alarm for event with uid %d", uid ); 66// qWarning("Removing alarm for event with uid %d", uid );
67 AlarmServer::deleteAlarm( schedule , 67 AlarmServer::deleteAlarm( schedule ,
68 "QPE/Application/todolist", 68 "QPE/Application/todolist",
69 "alarm(QDateTime,int)", uid ); 69 "alarm(QDateTime,int)", uid );
70} 70}
71 71