author | harlekin <harlekin> | 2002-11-05 00:43:46 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-05 00:43:46 (UTC) |
commit | 4efdcbfa9ae55ba42b10b5003c9e524b2e1f0eef (patch) (unidiff) | |
tree | 2c56641bfc494138d3358fb52b22261c5be37e25 | |
parent | da417964fde0079e97aa9dfd4ecdde77522d4ad9 (diff) | |
download | opie-4efdcbfa9ae55ba42b10b5003c9e524b2e1f0eef.zip opie-4efdcbfa9ae55ba42b10b5003c9e524b2e1f0eef.tar.gz opie-4efdcbfa9ae55ba42b10b5003c9e524b2e1f0eef.tar.bz2 |
transition to new opie pim api, no finished yet, but should allready close bug #1 cvs upcvs up
-rw-r--r-- | core/pim/today/plugins/todolist/todolist.pro | 3 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todoplugin.cpp | 2 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.cpp | 46 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.h | 8 |
4 files changed, 29 insertions, 30 deletions
diff --git a/core/pim/today/plugins/todolist/todolist.pro b/core/pim/today/plugins/todolist/todolist.pro index 1f9c61c..38db406 100644 --- a/core/pim/today/plugins/todolist/todolist.pro +++ b/core/pim/today/plugins/todolist/todolist.pro | |||
@@ -1,5 +1,4 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | #TEMPLATE = app | ||
3 | CONFIG -= moc | 2 | CONFIG -= moc |
4 | CONFIG += qt debug | 3 | CONFIG += qt release |
5 | 4 | ||
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp index e10b414..b5abbd3 100644 --- a/core/pim/today/plugins/todolist/todoplugin.cpp +++ b/core/pim/today/plugins/todolist/todoplugin.cpp | |||
@@ -34,3 +34,3 @@ QString TodolistPlugin::pluginName() const { | |||
34 | double TodolistPlugin::versionNumber() const { | 34 | double TodolistPlugin::versionNumber() const { |
35 | return 0.7; | 35 | return 0.8; |
36 | } | 36 | } |
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp index 320969e..773e5cf 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.cpp +++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp | |||
@@ -38,3 +38,5 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name ) | |||
38 | } | 38 | } |
39 | todo = new ToDoDB(); | 39 | |
40 | todo = new OTodoAccess(); | ||
41 | todo->load(); | ||
40 | 42 | ||
@@ -69,3 +71,2 @@ void TodolistPluginWidget::getTodo() { | |||
69 | todoLabel = new OClickableLabel( this ); | 71 | todoLabel = new OClickableLabel( this ); |
70 | todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); | ||
71 | connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); | 72 | connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); |
@@ -78,10 +79,9 @@ void TodolistPluginWidget::getTodo() { | |||
78 | // get overdue todos first | 79 | // get overdue todos first |
79 | QValueList<ToDoEvent> overDueList = todo->overDue(); | 80 | m_list = todo->overDue(); |
80 | qBubbleSort( overDueList ); | 81 | |
81 | for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin(); | 82 | for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { |
82 | it != overDueList.end(); ++it ) { | 83 | if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) { |
83 | if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) { | 84 | QString desc = (*m_it).summary(); |
84 | QString desc = (*it).summary(); | ||
85 | if( desc.isEmpty() ) { | 85 | if( desc.isEmpty() ) { |
86 | desc = (*it).description(); | 86 | desc = (*m_it).description(); |
87 | } | 87 | } |
@@ -93,18 +93,15 @@ void TodolistPluginWidget::getTodo() { | |||
93 | // get total number of still open todos | 93 | // get total number of still open todos |
94 | QValueList<ToDoEvent> openTodo = todo->rawToDos(); | 94 | m_list = todo->sorted( true, 1, 4, 1); |
95 | qBubbleSort( openTodo ); | 95 | |
96 | for ( QValueList<ToDoEvent>::Iterator it = openTodo.begin(); | 96 | for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { |
97 | it != openTodo.end(); ++it ) { | 97 | count +=1; |
98 | if ( !(*it).isCompleted() ){ | 98 | // not the overdues, we allready got them, and not if we are |
99 | count +=1; | 99 | // over the maxlines |
100 | // not the overdues, we allready got them, and not if we are | 100 | if ( !(*m_it).isOverdue() && ( ammount < m_maxLinesTask ) ) { |
101 | // over the maxlines | 101 | QString desc = (*m_it).summary(); |
102 | if ( !(*it).isOverdue() && ( ammount < m_maxLinesTask ) ) { | 102 | if( desc.isEmpty() ) { |
103 | QString desc = (*it).summary(); | 103 | desc = (*m_it).description(); |
104 | if( desc.isEmpty() ) { | ||
105 | desc = (*it).description(); | ||
106 | } | ||
107 | tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; | ||
108 | ammount++; | ||
109 | } | 104 | } |
105 | tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; | ||
106 | ammount++; | ||
110 | } | 107 | } |
@@ -112,3 +109,2 @@ void TodolistPluginWidget::getTodo() { | |||
112 | 109 | ||
113 | |||
114 | if ( count > 0 ) { | 110 | if ( count > 0 ) { |
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.h b/core/pim/today/plugins/todolist/todopluginwidget.h index 970f430..37b0ee1 100644 --- a/core/pim/today/plugins/todolist/todopluginwidget.h +++ b/core/pim/today/plugins/todolist/todopluginwidget.h | |||
@@ -22,3 +22,4 @@ | |||
22 | 22 | ||
23 | #include <opie/tododb.h> | 23 | #include <opie/otodo.h> |
24 | #include <opie/otodoaccess.h> | ||
24 | #include <opie/oclickablelabel.h> | 25 | #include <opie/oclickablelabel.h> |
@@ -39,3 +40,6 @@ private: | |||
39 | OClickableLabel *todoLabel; | 40 | OClickableLabel *todoLabel; |
40 | ToDoDB *todo; | 41 | |
42 | OTodoAccess *todo; | ||
43 | OTodoAccess::List m_list; | ||
44 | OTodoAccess::List::Iterator m_it; | ||
41 | 45 | ||