-rw-r--r-- | libopie/tododb.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp index 91331d0..e440dfc 100644 --- a/libopie/tododb.cpp +++ b/libopie/tododb.cpp | |||
@@ -129,25 +129,25 @@ ToDoDB::ToDoDB(const QString &fileName = QString::null, ToDoResource *res ){ | |||
129 | m_fileName = fileName; | 129 | m_fileName = fileName; |
130 | if( fileName.isEmpty() && res == 0 ){ | 130 | if( fileName.isEmpty() && res == 0 ){ |
131 | m_fileName = Global::applicationFileName("todolist","todolist.xml");; | 131 | m_fileName = Global::applicationFileName("todolist","todolist.xml");; |
132 | //qWarning("%s", m_fileName.latin1() ); | 132 | //qWarning("%s", m_fileName.latin1() ); |
133 | }else if(res == 0 ){ // let's create a ToDoResource for xml | 133 | }else if(res == 0 ){ // let's create a ToDoResource for xml |
134 | res = new FileToDoResource(); | 134 | res = new FileToDoResource(); |
135 | } | 135 | } |
136 | m_res = res; | 136 | m_res = res; |
137 | load(); | 137 | load(); |
138 | } | 138 | } |
139 | ToDoDB::~ToDoDB() | 139 | ToDoDB::~ToDoDB() |
140 | { | 140 | { |
141 | 141 | delete m_res; | |
142 | } | 142 | } |
143 | QValueList<ToDoEvent> ToDoDB::effectiveToDos(const QDate &from, const QDate &to, | 143 | QValueList<ToDoEvent> ToDoDB::effectiveToDos(const QDate &from, const QDate &to, |
144 | bool all ) | 144 | bool all ) |
145 | { | 145 | { |
146 | QValueList<ToDoEvent> events; | 146 | QValueList<ToDoEvent> events; |
147 | for( QValueList<ToDoEvent>::Iterator it = m_todos.begin(); it!= m_todos.end(); ++it ){ | 147 | for( QValueList<ToDoEvent>::Iterator it = m_todos.begin(); it!= m_todos.end(); ++it ){ |
148 | if( (*it).hasDate() ){ | 148 | if( (*it).hasDate() ){ |
149 | if( (*it).date() >= from && (*it).date() <= to ) | 149 | if( (*it).date() >= from && (*it).date() <= to ) |
150 | events.append( (*it) ); | 150 | events.append( (*it) ); |
151 | }else if( all ){ | 151 | }else if( all ){ |
152 | events.append( (*it) ); | 152 | events.append( (*it) ); |
153 | } | 153 | } |
@@ -190,25 +190,25 @@ void ToDoDB::reload() | |||
190 | load(); | 190 | load(); |
191 | } | 191 | } |
192 | void ToDoDB::setFileName(const QString &file ) | 192 | void ToDoDB::setFileName(const QString &file ) |
193 | { | 193 | { |
194 | m_fileName =file; | 194 | m_fileName =file; |
195 | } | 195 | } |
196 | QString ToDoDB::fileName()const | 196 | QString ToDoDB::fileName()const |
197 | { | 197 | { |
198 | return m_fileName; | 198 | return m_fileName; |
199 | } | 199 | } |
200 | void ToDoDB::load() | 200 | void ToDoDB::load() |
201 | { | 201 | { |
202 | 202 | m_todos = m_res->load( m_fileName ); | |
203 | } | 203 | } |
204 | bool ToDoDB::save() | 204 | bool ToDoDB::save() |
205 | { | 205 | { |
206 | return m_res->save( m_fileName, m_todos ); | 206 | return m_res->save( m_fileName, m_todos ); |
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | ||
213 | 213 | ||
214 | 214 | ||