summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp
index 6aaa14c..f684f8c 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp
@@ -647,9 +647,9 @@ UIDArray OPimContactAccessBackend_SQL::queryByExample ( const UIDArray& uidlist,
delete endDate;
// The following if line is a replacement for
// if ( searchQuery.endsWith( "AND" ) )
- if ( searchQuery.findRev( "AND" ) == ( searchQuery.length() - 3 ) ){
+ if ( searchQuery.findRev( "AND" ) == static_cast<int>( searchQuery.length() - 3 ) ){
odebug << "remove AND" << oendl;
searchQuery.remove( searchQuery.length()-3, 3 ); // Hmmmm..
}
@@ -872,8 +872,14 @@ UIDArray OPimContactAccessBackend_SQL::sorted( const UIDArray& ar, bool asc, int
break;
case OPimContactAccess::SortGender:
query += " \"Gender\"";
break;
+ case OPimContactAccess::SortBirthdayWithoutYear:
+ query += " substr(\"Birthday\", 6, 10)";
+ break;
+ case OPimContactAccess::SortAnniversaryWithoutYear:
+ query += " substr(\"Anniversary\", 6, 10)";
+ break;
default:
query += " \"Last Name\"";
}