summaryrefslogtreecommitdiff
path: root/libopie/tododb.cpp
authorzecke <zecke>2002-03-20 21:45:51 (UTC)
committer zecke <zecke>2002-03-20 21:45:51 (UTC)
commite9189f8d0cc46b0532fdcbcb2377ae3d108666d5 (patch) (unidiff)
tree20af6104c262510595b82e619ee69b0958596ddd /libopie/tododb.cpp
parent0b39bb8d62f67a86128a6bd16afbd2aae004637c (diff)
downloadopie-e9189f8d0cc46b0532fdcbcb2377ae3d108666d5.zip
opie-e9189f8d0cc46b0532fdcbcb2377ae3d108666d5.tar.gz
opie-e9189f8d0cc46b0532fdcbcb2377ae3d108666d5.tar.bz2
vCal Resource for the tododb
Diffstat (limited to 'libopie/tododb.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/tododb.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp
index b1b35d0..f9756c6 100644
--- a/libopie/tododb.cpp
+++ b/libopie/tododb.cpp
@@ -129,24 +129,32 @@ public:
129ToDoDB::ToDoDB(const QString &fileName = QString::null, ToDoResource *res ){ 129ToDoDB::ToDoDB(const QString &fileName = QString::null, ToDoResource *res ){
130 m_fileName = fileName; 130 m_fileName = fileName;
131 if( fileName.isEmpty() && res == 0 ){ 131 if( fileName.isEmpty() && res == 0 ){
132 m_fileName = Global::applicationFileName("todolist","todolist.xml"); 132 m_fileName = Global::applicationFileName("todolist","todolist.xml");
133 res = new FileToDoResource(); 133 res = new FileToDoResource();
134 //qWarning("%s", m_fileName.latin1() ); 134 //qWarning("%s", m_fileName.latin1() );
135 }else if(res == 0 ){ // let's create a ToDoResource for xml 135 }else if(res == 0 ){ // let's create a ToDoResource for xml
136 res = new FileToDoResource(); 136 res = new FileToDoResource();
137 } 137 }
138 m_res = res; 138 m_res = res;
139 load(); 139 load();
140} 140}
141ToDoResource* ToDoDB::resource(){
142 return m_res;
143};
144void ToDoDB::setResource( ToDoResource *res )
145{
146 delete m_res;
147 m_res = res;
148}
141ToDoDB::~ToDoDB() 149ToDoDB::~ToDoDB()
142{ 150{
143 delete m_res; 151 delete m_res;
144} 152}
145QValueList<ToDoEvent> ToDoDB::effectiveToDos(const QDate &from, const QDate &to, 153QValueList<ToDoEvent> ToDoDB::effectiveToDos(const QDate &from, const QDate &to,
146 bool all ) 154 bool all )
147{ 155{
148 QValueList<ToDoEvent> events; 156 QValueList<ToDoEvent> events;
149 for( QValueList<ToDoEvent>::Iterator it = m_todos.begin(); it!= m_todos.end(); ++it ){ 157 for( QValueList<ToDoEvent>::Iterator it = m_todos.begin(); it!= m_todos.end(); ++it ){
150 if( (*it).hasDate() ){ 158 if( (*it).hasDate() ){
151 if( (*it).date() >= from && (*it).date() <= to ) 159 if( (*it).date() >= from && (*it).date() <= to )
152 events.append( (*it) ); 160 events.append( (*it) );