author | harlekin <harlekin> | 2002-11-05 00:43:46 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-05 00:43:46 (UTC) |
commit | 4efdcbfa9ae55ba42b10b5003c9e524b2e1f0eef (patch) (side-by-side diff) | |
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 | 34 | ||||
-rw-r--r-- | core/pim/today/plugins/todolist/todopluginwidget.h | 8 |
4 files changed, 23 insertions, 24 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 @@ TEMPLATE = lib -#TEMPLATE = app CONFIG -= moc -CONFIG += qt debug +CONFIG += qt release 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 { double TodolistPlugin::versionNumber() const { - return 0.7; + return 0.8; } 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 ) } - todo = new ToDoDB(); + + todo = new OTodoAccess(); + todo->load(); @@ -69,3 +71,2 @@ void TodolistPluginWidget::getTodo() { todoLabel = new OClickableLabel( this ); - todoLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) ); @@ -78,10 +79,9 @@ void TodolistPluginWidget::getTodo() { // get overdue todos first - QValueList<ToDoEvent> overDueList = todo->overDue(); - qBubbleSort( overDueList ); - for ( QValueList<ToDoEvent>::Iterator it = overDueList.begin(); - it != overDueList.end(); ++it ) { - if (!(*it).isCompleted() && ( ammount < m_maxLinesTask ) ) { - QString desc = (*it).summary(); + m_list = todo->overDue(); + + for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { + if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) { + QString desc = (*m_it).summary(); if( desc.isEmpty() ) { - desc = (*it).description(); + desc = (*m_it).description(); } @@ -93,7 +93,5 @@ void TodolistPluginWidget::getTodo() { // get total number of still open todos - QValueList<ToDoEvent> openTodo = todo->rawToDos(); - qBubbleSort( openTodo ); - for ( QValueList<ToDoEvent>::Iterator it = openTodo.begin(); - it != openTodo.end(); ++it ) { - if ( !(*it).isCompleted() ){ + m_list = todo->sorted( true, 1, 4, 1); + + for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { count +=1; @@ -101,6 +99,6 @@ void TodolistPluginWidget::getTodo() { // over the maxlines - if ( !(*it).isOverdue() && ( ammount < m_maxLinesTask ) ) { - QString desc = (*it).summary(); + if ( !(*m_it).isOverdue() && ( ammount < m_maxLinesTask ) ) { + QString desc = (*m_it).summary(); if( desc.isEmpty() ) { - desc = (*it).description(); + desc = (*m_it).description(); } @@ -110,4 +108,2 @@ void TodolistPluginWidget::getTodo() { } - } - 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 @@ -#include <opie/tododb.h> +#include <opie/otodo.h> +#include <opie/otodoaccess.h> #include <opie/oclickablelabel.h> @@ -39,3 +40,6 @@ private: OClickableLabel *todoLabel; - ToDoDB *todo; + + OTodoAccess *todo; + OTodoAccess::List m_list; + OTodoAccess::List::Iterator m_it; |