summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-24 11:11:39 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-06 09:35:19 -0800
commitea9303ff3cff8ea7c353b8a0c53e13e82f897360 (patch)
treed6203808c2bbc4e97c35f9fe20622b164eb1f684
parent0a65fe500b35b5a2e53bc5a3b173cb9493986f8f (diff)
downloadsubsurface-ea9303ff3cff8ea7c353b8a0c53e13e82f897360.tar.gz
Location completion matches on whole name
When typing in a partial location name, the match now considers the whole text, not just the start of the text. So typing in "Yell" will match both "Yellow House" and "Mellow Yellow". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/locationinformation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index aee0b7328..8e40e1b53 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -290,7 +290,7 @@ bool DiveLocationFilterProxyModel::filterAcceptsRow(int source_row, const QModel
return true;
QString sourceString = sourceModel()->index(source_row, DiveLocationModel::NAME).data(Qt::DisplayRole).toString();
- return sourceString.toLower().startsWith(location_line_edit->text().toLower());
+ return sourceString.toLower().contains(location_line_edit->text().toLower());
}
bool DiveLocationFilterProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const