on xenial help sign in
remove commented out code, fix setting filter
commitdefdbbda54bf4799e1116b918c8c726f1cc7e20e authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 9 Dec 2015, 21:34 (11 years ago) parent953309d
1 file changed+7−6
plugins/Wizard/timezonemodel.cpp+7−6
plugins/Wizard/timezonemodel.cpp+7−6
@@ -170,9 +170,8 @@ bool TimeZoneFilterModel::filterAcceptsRow(int row, const QModelIndex &parentInd
170170
171171 if (!m_filter.isEmpty()) { // filtering by freeform text input, cf setFilter(QString)
172172 const QString city = sourceModel()->index(row, 0, parentIndex).data(TimeZoneLocationModel::CityRole).toString();
173− //const QString country = sourceModel()->index(row, 0, parentIndex).data(TimeZoneLocationModel::CountryRole).toString();
174173
175− if (m_stringMatcher.indexIn(city) == 0 /*|| m_stringMatcher.indexIn(country) == 0*/) { // match at the beginning of the city name
174+ if (m_stringMatcher.indexIn(city) == 0) { // match at the beginning of the city name
176175 return true;
177176 }
178177 } else if (!m_country.isEmpty()) { // filter by country code
@@ -190,10 +189,12 @@ QString TimeZoneFilterModel::filter() const
190189
191190void TimeZoneFilterModel::setFilter(const QString &filter)
192191{
193− m_filter = filter;
194− m_stringMatcher.setPattern(m_filter);
195− Q_EMIT filterChanged();
196− invalidate();
192+ if (filter != m_filter) {
193+ m_filter = filter;
194+ m_stringMatcher.setPattern(m_filter);
195+ Q_EMIT filterChanged();
196+ invalidate();
197+ }
197198}
198199
199200QString TimeZoneFilterModel::country() const