Changeset 47eda2b


Ignore:
Timestamp:
07/08/11 16:52:32 (10 years ago)
Author:
gregor herrmann <gregoa@…>
Branches:
master, qt5
Children:
e388cda
Parents:
66698a6
Message:

Split search keyword string on whitespace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sql/sqlengine.cpp

    r66698a6 r47eda2b  
    314314    sql += QString("WHERE EVENT.xid_conference = %1 AND (").arg( aConferenceId );
    315315
     316    QStringList searchKeywords = aKeyword.split(QRegExp("\\s+"));
    316317    foreach (QString table, aColumns.uniqueKeys()){
    317318        foreach (QString column, aColumns.values(table)){
    318             sql += QString("%1.%2 LIKE '\%' || :%1%2 || '\%' OR ").arg( table, column );
     319            for (int i=0; i < searchKeywords.count(); i++){
     320                 sql += QString("%1.%2 LIKE '\%' || :%1%2 || '\%' OR ").arg( table, column );
     321            }
    319322        }
    320323    }
     
    326329    foreach (QString table, aColumns.uniqueKeys()){
    327330        foreach (QString column, aColumns.values(table)){
    328             query.bindValue(QString(":%1%2").arg(table, column), aKeyword );
     331            foreach (QString keyword, searchKeywords){
     332                query.bindValue(QString(":%1%2").arg(table, column), keyword );
     333            }
    329334        }
    330335    }
Note: See TracChangeset for help on using the changeset viewer.