-rw-r--r-- | libopie/pim/otodoaccess.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/pim/otodoaccess.cpp b/libopie/pim/otodoaccess.cpp index 80424d9..c258de6 100644 --- a/libopie/pim/otodoaccess.cpp +++ b/libopie/pim/otodoaccess.cpp | |||
@@ -1,81 +1,81 @@ | |||
1 | #include <qdatetime.h> | 1 | #include <qdatetime.h> |
2 | 2 | ||
3 | #include <qpe/alarmserver.h> | 3 | #include <qpe/alarmserver.h> |
4 | 4 | ||
5 | #include "otodoaccesssql.h" | 5 | // #include "otodoaccesssql.h" |
6 | #include "otodoaccess.h" | 6 | #include "otodoaccess.h" |
7 | #include "obackendfactory.h" | 7 | #include "obackendfactory.h" |
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 OTodoAccessBackendSQL( QString::null); | 13 | // m_todoBackEnd = new OTodoAccessBackendSQL( QString::null); |
14 | 14 | ||
15 | // Zecke: Du musst hier noch für das XML-Backend einen Appnamen übergeben ! | 15 | // Zecke: Du musst hier noch für das XML-Backend einen Appnamen übergeben ! |
16 | if (end == 0l ) | 16 | if (end == 0l ) |
17 | m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null); | 17 | m_todoBackEnd = OBackendFactory<OTodoAccessBackend>::Default ("todo", QString::null); |
18 | 18 | ||
19 | setBackEnd( m_todoBackEnd ); | 19 | setBackEnd( m_todoBackEnd ); |
20 | } | 20 | } |
21 | OTodoAccess::~OTodoAccess() { | 21 | OTodoAccess::~OTodoAccess() { |
22 | // qWarning("~OTodoAccess"); | 22 | // qWarning("~OTodoAccess"); |
23 | } | 23 | } |
24 | void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) { | 24 | void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) { |
25 | QValueList<OTodo>::ConstIterator it; | 25 | QValueList<OTodo>::ConstIterator it; |
26 | for ( it = list.begin(); it != list.end(); ++it ) { | 26 | for ( it = list.begin(); it != list.end(); ++it ) { |
27 | replace( (*it) ); | 27 | replace( (*it) ); |
28 | } | 28 | } |
29 | } | 29 | } |
30 | OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, | 30 | OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, |
31 | const QDate& end, | 31 | const QDate& end, |
32 | bool includeNoDates ) { | 32 | bool includeNoDates ) { |
33 | QArray<int> ints = m_todoBackEnd->effectiveToDos( start, end, includeNoDates ); | 33 | QArray<int> ints = m_todoBackEnd->effectiveToDos( start, end, includeNoDates ); |
34 | 34 | ||
35 | List lis( ints, this ); | 35 | List lis( ints, this ); |
36 | return lis; | 36 | return lis; |
37 | } | 37 | } |
38 | OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, | 38 | OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, |
39 | bool includeNoDates ) { | 39 | bool includeNoDates ) { |
40 | return effectiveToDos( start, QDate::currentDate(), | 40 | return effectiveToDos( start, QDate::currentDate(), |
41 | includeNoDates ); | 41 | includeNoDates ); |
42 | } | 42 | } |
43 | OTodoAccess::List OTodoAccess::overDue() { | 43 | OTodoAccess::List OTodoAccess::overDue() { |
44 | List lis( m_todoBackEnd->overDue(), this ); | 44 | List lis( m_todoBackEnd->overDue(), this ); |
45 | return lis; | 45 | return lis; |
46 | } | 46 | } |
47 | void OTodoAccess::addAlarm( const OTodo& event) { | 47 | void OTodoAccess::addAlarm( const OTodo& event) { |
48 | if (!event.hasAlarmDateTime() ) | 48 | if (!event.hasAlarmDateTime() ) |
49 | return; | 49 | return; |
50 | 50 | ||
51 | QDateTime now = QDateTime::currentDateTime(); | 51 | QDateTime now = QDateTime::currentDateTime(); |
52 | QDateTime schedule = event.alarmDateTime(); | 52 | QDateTime schedule = event.alarmDateTime(); |
53 | 53 | ||
54 | if ( schedule > now ){ | 54 | if ( schedule > now ){ |
55 | AlarmServer::addAlarm( schedule, | 55 | AlarmServer::addAlarm( schedule, |
56 | "QPE/Application/todolist", | 56 | "QPE/Application/todolist", |
57 | "alarm(QDateTime,int)", event.uid() ); | 57 | "alarm(QDateTime,int)", event.uid() ); |
58 | 58 | ||
59 | } | 59 | } |
60 | } | 60 | } |
61 | void OTodoAccess::delAlarm( int uid) { | 61 | void OTodoAccess::delAlarm( int uid) { |
62 | 62 | ||
63 | QDateTime schedule; // Create null DateTime | 63 | QDateTime schedule; // Create null DateTime |
64 | 64 | ||
65 | // I hope this will remove all scheduled alarms | 65 | // I hope this will remove all scheduled alarms |
66 | // with the given uid !? | 66 | // with the given uid !? |
67 | // If not: I have to rethink how to remove already | 67 | // If not: I have to rethink how to remove already |
68 | // scheduled events... (se) | 68 | // scheduled events... (se) |
69 | // it should be fine -zecke | 69 | // it should be fine -zecke |
70 | // qWarning("Removing alarm for event with uid %d", uid ); | 70 | // qWarning("Removing alarm for event with uid %d", uid ); |
71 | AlarmServer::deleteAlarm( schedule , | 71 | AlarmServer::deleteAlarm( schedule , |
72 | "QPE/Application/todolist", | 72 | "QPE/Application/todolist", |
73 | "alarm(QDateTime,int)", uid ); | 73 | "alarm(QDateTime,int)", uid ); |
74 | } | 74 | } |
75 | /* sort order */ | 75 | /* sort order */ |
76 | OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) { | 76 | OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) { |
77 | QArray<int> ints = m_todoBackEnd->sorted( ascending, sort, | 77 | QArray<int> ints = m_todoBackEnd->sorted( ascending, sort, |
78 | filter, cat ); | 78 | filter, cat ); |
79 | OTodoAccess::List list( ints, this ); | 79 | OTodoAccess::List list( ints, this ); |
80 | return list; | 80 | return list; |
81 | } | 81 | } |