author | zecke <zecke> | 2005-06-27 18:08:35 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-06-27 18:08:35 (UTC) |
commit | cecffa1dc3a7bd1526be00e7bc4a4a151e6f2c9c (patch) (side-by-side diff) | |
tree | f1507ae7e0ba8d3c41e0381b84827c97823edeca /libopie2/opiepim | |
parent | 058e3b6b0bc8f29314ee794bf7e993ebf3bfe072 (diff) | |
download | opie-cecffa1dc3a7bd1526be00e7bc4a4a151e6f2c9c.zip opie-cecffa1dc3a7bd1526be00e7bc4a4a151e6f2c9c.tar.gz opie-cecffa1dc3a7bd1526be00e7bc4a4a151e6f2c9c.tar.bz2 |
-Fix compile warning (signed vs unsigned)
-Somehow the split up patches missed the query string... (I knew I would mess up)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 8 |
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 @@ -639,25 +639,25 @@ UIDArray OPimContactAccessBackend_SQL::queryByExample ( const UIDArray& uidlist, + queryStr.replace(QRegExp("\\*"),"%") + "'" + ")"; else searchQuery += " (\"" + *it + "\"" + " GLOB " + "'" + queryStr + "'" + ")"; } } 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.. } } // Now compose the complete query QString qu = "SELECT uid FROM addressbook WHERE " + uid_query; if ( !datediff_query.isEmpty() && !searchQuery.isEmpty() ){ // If we use DateDiff, we have to intersect two queries. qu = datediff_query + QString( " INTERSECT " ) + qu + searchQuery; @@ -864,24 +864,30 @@ UIDArray OPimContactAccessBackend_SQL::sorted( const UIDArray& ar, bool asc, int case OPimContactAccess::SortNickname: query += " \"Nickname\""; break; case OPimContactAccess::SortAnniversary: query += " \"Anniversary\""; break; case OPimContactAccess::SortBirthday: query += " \"Birthday\""; 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\""; } if ( !asc ) query += " DESC"; odebug << "sorted query is: " << query << "" << oendl; OSQLRawQuery raw( query ); OSQLResult res = m_driver->query( &raw ); |