author | drw <drw> | 2005-01-30 00:32:33 (UTC) |
---|---|---|
committer | drw <drw> | 2005-01-30 00:32:33 (UTC) |
commit | 114c5c468032a08205b2d8b7da3966bff6d47875 (patch) (unidiff) | |
tree | bbd79021246e747f7292eda140e424cf9d750ac5 /core/pim/todo/todomanager.cpp | |
parent | 43f82d5c68e1d7a5b26f862c26a76253a85e7518 (diff) | |
download | opie-114c5c468032a08205b2d8b7da3966bff6d47875.zip opie-114c5c468032a08205b2d8b7da3966bff6d47875.tar.gz opie-114c5c468032a08205b2d8b7da3966bff6d47875.tar.bz2 |
Convert Todo to use new OPimMainWindow functionality, plus some other code clean-ups
Diffstat (limited to 'core/pim/todo/todomanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/todomanager.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/core/pim/todo/todomanager.cpp b/core/pim/todo/todomanager.cpp index 7136f9a..fcd5f0e 100644 --- a/core/pim/todo/todomanager.cpp +++ b/core/pim/todo/todomanager.cpp | |||
@@ -1,63 +1,64 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 <> | 3 | .=l. Copyright (c) 2002 <> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This program is free software; you can | 5 | _;:, .> :=|. This program is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This program is distributed in the hope that | 12 | .i_,=:_. -<s. This program is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <opie2/odebug.h> | 29 | #include <opie2/odebug.h> |
30 | 30 | ||
31 | #include <qpe/categoryselect.h> | 31 | #include <qpe/categoryselect.h> |
32 | 32 | ||
33 | #include "todomanager.h" | 33 | #include "todomanager.h" |
34 | 34 | ||
35 | using namespace Todo; | 35 | using namespace Todo; |
36 | 36 | ||
37 | TodoManager::TodoManager( QObject *obj ) | 37 | TodoManager::TodoManager( QObject *obj ) |
38 | : QObject( obj ) { | 38 | : QObject( obj ) { |
39 | m_db = 0l; | 39 | m_db = 0l; |
40 | m_cat.load( categoryFileName() ); | ||
40 | } | 41 | } |
41 | TodoManager::~TodoManager() { | 42 | TodoManager::~TodoManager() { |
42 | delete m_db; | 43 | delete m_db; |
43 | } | 44 | } |
44 | OPimTodo TodoManager::event(int uid ) { | 45 | OPimTodo TodoManager::event(int uid ) { |
45 | return m_db->find( uid ); | 46 | return m_db->find( uid ); |
46 | } | 47 | } |
47 | void TodoManager::updateList() { | 48 | void TodoManager::updateList() { |
48 | m_list = m_db->allRecords(); | 49 | m_list = m_db->allRecords(); |
49 | } | 50 | } |
50 | OPimTodoAccess::List TodoManager::list() const{ | 51 | OPimTodoAccess::List TodoManager::list() const{ |
51 | return m_list; | 52 | return m_list; |
52 | } | 53 | } |
53 | OPimTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { | 54 | OPimTodoAccess::List TodoManager::sorted( bool asc, int so, int f, int cat ) { |
54 | return m_db->sorted( asc, so, f, cat ); | 55 | return m_db->sorted( asc, so, f, cat ); |
55 | } | 56 | } |
56 | OPimTodoAccess::List::Iterator TodoManager::overDue() { | 57 | OPimTodoAccess::List::Iterator TodoManager::overDue() { |
57 | int filter = Opie::OPimTodoAccess::FilterCategory | Opie::OPimTodoAccess::OnlyOverDue; | 58 | int filter = Opie::OPimTodoAccess::FilterCategory | Opie::OPimTodoAccess::OnlyOverDue; |
58 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); | 59 | m_list = m_db->sorted(m_asc, m_sortOrder, filter, m_ca ); |
59 | m_it = m_list.begin(); | 60 | m_it = m_list.begin(); |
60 | return m_it; | 61 | return m_it; |
61 | } | 62 | } |
62 | OPimTodoAccess::List::Iterator TodoManager::fromTo( const QDate& start, | 63 | OPimTodoAccess::List::Iterator TodoManager::fromTo( const QDate& start, |
63 | const QDate& end ) { | 64 | const QDate& end ) { |