Changeset 53effcb


Ignore:
Timestamp:
07/10/11 21:37:00 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
c8a76f3
Parents:
e388cda
Message:

Fixed bug (related to ticket #12): Only the last search term is used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sql/sqlengine.cpp

    re388cda r53effcb  
    318318        foreach (QString column, aColumns.values(table)){
    319319            for (int i=0; i < searchKeywords.count(); i++){
    320                  sql += QString("%1.%2 LIKE '\%' || :%1%2 || '\%' OR ").arg( table, column );
     320                 sql += QString("%1.%2 LIKE '\%' || :%1%2%3 || '\%' OR ").arg(table).arg(column).arg(i);
    321321            }
    322322        }
     
    329329    foreach (QString table, aColumns.uniqueKeys()){
    330330        foreach (QString column, aColumns.values(table)){
    331             foreach (QString keyword, searchKeywords){
    332                 query.bindValue(QString(":%1%2").arg(table, column), keyword );
     331            for (int i = 0; i != searchKeywords.size(); ++i) {
     332                QString keyword = searchKeywords[i];
     333                query.bindValue(QString(":%1%2%3").arg(table).arg(column).arg(i), keyword );
    333334            }
    334335        }
Note: See TracChangeset for help on using the changeset viewer.