-rw-r--r-- | libopie/pim/otodoaccess.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie/pim/otodoaccess.cpp b/libopie/pim/otodoaccess.cpp index f51da29..5990841 100644 --- a/libopie/pim/otodoaccess.cpp +++ b/libopie/pim/otodoaccess.cpp | |||
@@ -1,61 +1,61 @@ | |||
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 "otodoaccesssql.h" |
6 | #include "otodoaccess.h" | 6 | #include "otodoaccess.h" |
7 | 7 | ||
8 | 8 | ||
9 | OTodoAccess::OTodoAccess( OTodoAccessBackend* end ) | 9 | OTodoAccess::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 OTodoAccessBackendSQL( QString::null); |
14 | 14 | ||
15 | setBackEnd( m_todoBackEnd ); | 15 | setBackEnd( m_todoBackEnd ); |
16 | } | 16 | } |
17 | OTodoAccess::~OTodoAccess() { | 17 | OTodoAccess::~OTodoAccess() { |
18 | // qWarning("~OTodoAccess"); | 18 | // qWarning("~OTodoAccess"); |
19 | } | 19 | } |
20 | void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) { | 20 | void 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 | } |
26 | OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, | 26 | OTodoAccess::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 | } |
34 | OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, | 34 | OTodoAccess::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 | } |
39 | OTodoAccess::List OTodoAccess::overDue() { | 39 | OTodoAccess::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 | } |
43 | void OTodoAccess::addAlarm( const OTodo& event) { | 43 | void 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 | } |
57 | void OTodoAccess::delAlarm( int uid) { | 57 | void 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 |