summaryrefslogtreecommitdiff
path: root/libopie
authoreilers <eilers>2002-10-08 13:38:03 (UTC)
committer eilers <eilers>2002-10-08 13:38:03 (UTC)
commit89fa0437f110efc93443dd9ce0b2bbf2a9e5f9b2 (patch) (unidiff)
tree7ff09ac37e83e11d404899a6bc29bb7c21d7fe0f /libopie
parentb8e6fd1fe79d3bad4f9447492987cd759fb249de (diff)
downloadopie-89fa0437f110efc93443dd9ce0b2bbf2a9e5f9b2.zip
opie-89fa0437f110efc93443dd9ce0b2bbf2a9e5f9b2.tar.gz
opie-89fa0437f110efc93443dd9ce0b2bbf2a9e5f9b2.tar.bz2
remove sql refs
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/otodoaccess.cpp2
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
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 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}
21OTodoAccess::~OTodoAccess() { 21OTodoAccess::~OTodoAccess() {
22// qWarning("~OTodoAccess"); 22// qWarning("~OTodoAccess");
23} 23}
24void OTodoAccess::mergeWith( const QValueList<OTodo>& list ) { 24void 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}
30OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, 30OTodoAccess::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}
38OTodoAccess::List OTodoAccess::effectiveToDos( const QDate& start, 38OTodoAccess::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}
43OTodoAccess::List OTodoAccess::overDue() { 43OTodoAccess::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}
47void OTodoAccess::addAlarm( const OTodo& event) { 47void 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}
61void OTodoAccess::delAlarm( int uid) { 61void 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 */
76OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) { 76OTodoAccess::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}