author | eilers <eilers> | 2005-01-16 19:54:28 (UTC) |
---|---|---|
committer | eilers <eilers> | 2005-01-16 19:54:28 (UTC) |
commit | 37f290f048eeade1036cd1dc2239d2a98412c54b (patch) (side-by-side diff) | |
tree | 04dea39ccf2725f4992d5b8bdbf12807e9a67ae2 /libopie2/opiepim/private/opimtodosortvector.cpp | |
parent | 07a4cf7e277aee7097c4da286a2559b717054362 (diff) | |
download | opie-37f290f048eeade1036cd1dc2239d2a98412c54b.zip opie-37f290f048eeade1036cd1dc2239d2a98412c54b.tar.gz opie-37f290f048eeade1036cd1dc2239d2a98412c54b.tar.bz2 |
Added new generic sorted for the databook backends. Needed an sortedvector
to do this job, which is now added to private classes..
Diffstat (limited to 'libopie2/opiepim/private/opimtodosortvector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/private/opimtodosortvector.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiepim/private/opimtodosortvector.cpp b/libopie2/opiepim/private/opimtodosortvector.cpp index 8d15710..1db20df 100644 --- a/libopie2/opiepim/private/opimtodosortvector.cpp +++ b/libopie2/opiepim/private/opimtodosortvector.cpp @@ -24,24 +24,25 @@ -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "opimtodosortvector.h" #include <opie2/otodoaccess.h> namespace Opie { namespace Internal { +namespace{ inline QString string( const OPimTodo& todo) { return todo.summary().isEmpty() ? todo.description().left(20 ) : todo.summary(); } inline int completed( const OPimTodo& todo1, const OPimTodo& todo2) { int ret = 0; if ( todo1.isCompleted() ) ret++; if ( todo2.isCompleted() ) ret--; return ret; } @@ -60,24 +61,25 @@ inline int deadline( const OPimTodo& t1, const OPimTodo& t2) { t2.hasDueDate() ) ret = t2.dueDate().daysTo( t1.dueDate() ); else if ( t1.hasDueDate() ) ret = -1; else if ( t2.hasDueDate() ) ret = 1; else ret = 0; return ret; } +} OPimTodoSortVector::OPimTodoSortVector( uint size, bool asc, int sort ) : OPimSortVector<OPimTodo>( size, asc, sort ) {} int OPimTodoSortVector::compareItems( const OPimTodo& con1, const OPimTodo& con2 ) { bool seComp, sePrio, seSum, seDeadline; seComp = sePrio = seDeadline = seSum = false; int ret =0; bool asc = sortAscending(); /* same item */ |