1
0
Fork 0
Fix GPS search functionality, I mixed up the SQlite wild-card operator.
This commit is contained in:
James Turner 2012-11-08 18:31:16 +00:00
parent afcdbd3158
commit 18e3fc0c82
2 changed files with 3 additions and 3 deletions

View file

@ -1435,7 +1435,7 @@ FGPositioned::Type GPS::SearchFilter::minType() const
FGPositioned::Type GPS::SearchFilter::maxType() const FGPositioned::Type GPS::SearchFilter::maxType() const
{ {
return FGPositioned::WAYPOINT; return FGPositioned::VOR;
} }
FGPositioned::Filter* GPS::createFilter(FGPositioned::Type aTy) FGPositioned::Filter* GPS::createFilter(FGPositioned::Type aTy)

View file

@ -809,13 +809,13 @@ public:
FGPositioned::Filter* filter, bool exact) FGPositioned::Filter* filter, bool exact)
{ {
string query = s; string query = s;
if (!exact) query += "*"; if (!exact) query += "%";
// build up SQL query text // build up SQL query text
string matchTerm = exact ? "=?1" : " LIKE ?1"; string matchTerm = exact ? "=?1" : " LIKE ?1";
string sql = "SELECT rowid FROM positioned WHERE " + column + matchTerm; string sql = "SELECT rowid FROM positioned WHERE " + column + matchTerm;
if (filter) { if (filter) {
sql += AND_TYPED; sql += " " AND_TYPED;
} }
// find or prepare a suitable statement frrm the SQL // find or prepare a suitable statement frrm the SQL