-rw-r--r-- | libopie/pim/otodoaccesssql.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libopie/pim/otodoaccesssql.cpp b/libopie/pim/otodoaccesssql.cpp index 25536e0..8add9f7 100644 --- a/libopie/pim/otodoaccesssql.cpp +++ b/libopie/pim/otodoaccesssql.cpp @@ -325,3 +325,5 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, if ( sortFilter & 1 ) { - query += " categories like '%" +QString::number(cat)+"%' AND"; + QString str; + if (cat != 0 ) str = QString::number( cat ); + query += " categories like '%" +str+"%' AND"; } @@ -332,3 +334,3 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, QString base; - base = QString("DueDate <= '%1-%2-%3' AND WHERE completed = 0").arg( date.year() ).arg( date.month() ).arg( date.day() ); + base = QString("DueDate <= '%1-%2-%3' AND completed = 0").arg( date.year() ).arg( date.month() ).arg( date.day() ); query += " " + base + " AND"; @@ -445,2 +447,3 @@ QArray<int> OTodoAccessBackendSQL::uids( const OSQLResult& res) const{ QArray<int> ints(list.count() ); + qWarning(" count = %d", list.count() ); |