Allow for case insensitive matching on the name of packages.

This mimics the behavior of 'pkg search', which performs a case
insensitive search.
This commit is contained in:
Jeff 'Raid' Baitis
2016-09-02 00:00:04 -07:00
parent f5d9caefed
commit a1dfac0392

View File

@@ -231,6 +231,7 @@ while(found.isEmpty() && numtry<2){
q_string = "SELECT origin FROM packages WHERE name = '"+searchterm+"' OR origin LIKE '%/"+searchterm+"'";
if(!category.isEmpty()){ q_string.append(" AND origin LIKE '"+category+"/%'"); }
if(!searchexcludes.isEmpty()){ q_string.append(" AND name NOT LIKE '%"+searchexcludes.join("%' AND name NOT LIKE '%")+"%'"); }
q_string.append(" COLLATE NOCASE"); // Case insensitive
QSqlQuery query(q_string, DB);
while(query.next()){
found << query.value("origin").toString(); //need the origin for later