on xenial help sign in
match the timezone name at the beginning only
c823f1aLukáš Tinkl
plugins/Wizard/timezonemodel.cpp+1−1
@@ -125,7 +125,7 @@ bool TimeZoneFilterModel::filterAcceptsRow(int row, const QModelIndex &parentInd
125 const QString city = sourceModel()->index(row, 0, parentIndex).data(TimeZoneModel::City).toString();
125 const QString city = sourceModel()->index(row, 0, parentIndex).data(TimeZoneModel::City).toString();
126 const QString country = sourceModel()->index(row, 0, parentIndex).data(TimeZoneModel::Country).toString();
126 const QString country = sourceModel()->index(row, 0, parentIndex).data(TimeZoneModel::Country).toString();
127
127
128− if (m_stringMatcher.indexIn(city) != -1 || m_stringMatcher.indexIn(country) != -1) {
128+ if (m_stringMatcher.indexIn(city) == 0 || m_stringMatcher.indexIn(country) == 0) { // match at the beginning of the city/country name
129 return true;
129 return true;
130 }
130 }
131 } else if (!m_country.isEmpty()) { // filter by country code
131 } else if (!m_country.isEmpty()) { // filter by country code