author | zecke <zecke> | 2002-09-25 11:59:24 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-25 11:59:24 (UTC) |
commit | 38240090027bd68d8dd15d7d46ecf17792edb732 (patch) (side-by-side diff) | |
tree | 589ef486d7169c57592ed8667f6c84d43f882d48 /libopie2/opiepim/core | |
parent | 5f2dd0a2340914b4983ebce3813187034e2cb9dc (diff) | |
download | opie-38240090027bd68d8dd15d7d46ecf17792edb732.zip opie-38240090027bd68d8dd15d7d46ecf17792edb732.tar.gz opie-38240090027bd68d8dd15d7d46ecf17792edb732.tar.bz2 |
Add a sort function and filter function to TodoAccess
This would allow us todo a paint hack in QTable
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiepim/core/otodoaccess.h | 16 |
2 files changed, 22 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/otodoaccess.cpp b/libopie2/opiepim/core/otodoaccess.cpp index 8ec09bc..f51da29 100644 --- a/libopie2/opiepim/core/otodoaccess.cpp +++ b/libopie2/opiepim/core/otodoaccess.cpp @@ -68,4 +68,10 @@ void OTodoAccess::delAlarm( int uid) { "QPE/Application/todolist", "alarm(QDateTime,int)", uid ); } - +/* sort order */ +OTodoAccess::List OTodoAccess::sorted( bool ascending, int sort,int filter, int cat ) { + QArray<int> ints = m_todoBackEnd->sorted( ascending, sort, + filter, cat ); + OTodoAccess::List list( ints, this ); + return list; +} diff --git a/libopie2/opiepim/core/otodoaccess.h b/libopie2/opiepim/core/otodoaccess.h index c43efe9..12997aa 100644 --- a/libopie2/opiepim/core/otodoaccess.h +++ b/libopie2/opiepim/core/otodoaccess.h @@ -17,10 +17,17 @@ class OTodoAccess : public QObject, public OPimAccessTemplate<OTodo> { Q_OBJECT public: + enum SortOrder { Completed = 0, + Priority, + Description, + Deadline }; + enum SortFilter{ ShowOverdue = 0, + Category =1, + OnlyOverDue= 2 }; /** * if you use 0l * the default resource will be - * icked up + * picked up */ OTodoAccess( OTodoAccessBackend* = 0l); ~OTodoAccess(); @@ -48,6 +55,12 @@ public: * return overdue OTodos */ List overDue(); + + /** + * + */ + List sorted( bool ascending, int sortOrder, int sortFilter, int cat ); + /** * merge a list of OTodos into * the resource @@ -71,6 +84,7 @@ signals: */ void signalChanged( const OTodoAccess* ); private: + int m_cat; OTodoAccessBackend* m_todoBackEnd; class OTodoAccessPrivate; OTodoAccessPrivate* d; |