author | tille <tille> | 2003-05-15 13:55:07 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-15 13:55:07 (UTC) |
commit | 80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6 (patch) (unidiff) | |
tree | 4245ef4caf67784b452b908a9528ae03f988bf4c /core/pim/osearch/todosearch.cpp | |
parent | ded2a7a5715af1d1f6aab0b79ba90d8a815a9adc (diff) | |
download | opie-80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6.zip opie-80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6.tar.gz opie-80e9fd1b08a3a7173ecf443b2830df4ca6e83ce6.tar.bz2 |
owait and settings for search group:
- hide completed todos
- show only later events
- do not display hits in datebook dated
Diffstat (limited to 'core/pim/osearch/todosearch.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/todosearch.cpp | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/core/pim/osearch/todosearch.cpp b/core/pim/osearch/todosearch.cpp index c9fa61a..08bbe93 100644 --- a/core/pim/osearch/todosearch.cpp +++ b/core/pim/osearch/todosearch.cpp | |||
@@ -16,4 +16,7 @@ | |||
16 | #include <opie/otodo.h> | 16 | #include <opie/otodo.h> |
17 | #include <qiconset.h> | ||
18 | #include <qpe/resource.h> | 17 | #include <qpe/resource.h> |
18 | #include <qpe/config.h> | ||
19 | #include <qiconset.h> | ||
20 | #include <qaction.h> | ||
21 | #include <qpopupmenu.h> | ||
19 | #include "todoitem.h" | 22 | #include "todoitem.h" |
@@ -21,5 +24,4 @@ | |||
21 | TodoSearch::TodoSearch(QListView* parent, QString name) | 24 | TodoSearch::TodoSearch(QListView* parent, QString name) |
22 | : SearchGroup(parent, name) | 25 | : SearchGroup(parent, name), _todos(0), _popupMenu(0) |
23 | { | 26 | { |
24 | _todos = 0; | ||
25 | //AppLnkSet als(QPEApplication::qpeDir()); | 27 | //AppLnkSet als(QPEApplication::qpeDir()); |
@@ -28,2 +30,7 @@ TodoSearch::TodoSearch(QListView* parent, QString name) | |||
28 | setPixmap( 0, is.pixmap( QIconSet::Small, true ) ); | 30 | setPixmap( 0, is.pixmap( QIconSet::Small, true ) ); |
31 | actionShowCompleted = new QAction( QObject::tr("show completed tasks"),QString::null, 0, 0, 0, true ); | ||
32 | Config cfg( "osearch", Config::User ); | ||
33 | cfg.setGroup( "todo_settings" ); | ||
34 | actionShowCompleted->setOn( cfg.readBoolEntry( "show_completed_tasks", false ) ); | ||
35 | |||
29 | } | 36 | } |
@@ -33,2 +40,7 @@ TodoSearch::~TodoSearch() | |||
33 | { | 40 | { |
41 | Config cfg( "osearch", Config::User ); | ||
42 | cfg.setGroup( "todo_settings" ); | ||
43 | cfg.writeEntry( "show_completed_tasks", actionShowCompleted->isOn() ); | ||
44 | delete _popupMenu; | ||
45 | delete actionShowCompleted; | ||
34 | delete _todos; | 46 | delete _todos; |
@@ -47,9 +59,22 @@ int TodoSearch::search() | |||
47 | for (uint i = 0; i < results.count(); i++) | 59 | for (uint i = 0; i < results.count(); i++) |
48 | new TodoItem( this, new OTodo( results[i] )); | 60 | insertItem( new OTodo( results[i] )); |
49 | return results.count(); | 61 | return _resultCount; |
50 | } | 62 | } |
51 | 63 | ||
52 | void TodoSearch::insertItem( void* ) | 64 | void TodoSearch::insertItem( void *rec ) |
53 | { | 65 | { |
66 | OTodo *todo = (OTodo*)rec; | ||
67 | if (!actionShowCompleted->isOn() && | ||
68 | todo->isCompleted() ) return; | ||
69 | new TodoItem( this, todo ); | ||
70 | _resultCount++; | ||
71 | } | ||
54 | 72 | ||
73 | QPopupMenu* TodoSearch::popupMenu() | ||
74 | { | ||
75 | if (!_popupMenu){ | ||
76 | _popupMenu = new QPopupMenu( 0 ); | ||
77 | actionShowCompleted->addTo( _popupMenu ); | ||
78 | } | ||
79 | return _popupMenu; | ||
55 | } | 80 | } |