equal
deleted
inserted
replaced
160 m_indices.clear(); |
160 m_indices.clear(); |
161 m_activeReaders.clear(); |
161 m_activeReaders.clear(); |
162 QSet<QString> indicesSet; |
162 QSet<QString> indicesSet; |
163 m_mutex.unlock(); |
163 m_mutex.unlock(); |
164 |
164 |
165 foreach (QString dbFileName, m_helpEngine->fileNameReaderMap.keys()) { |
165 foreach (const QString &dbFileName, m_helpEngine->fileNameReaderMap.keys()) { |
166 m_mutex.lock(); |
166 m_mutex.lock(); |
167 if (m_abort) { |
167 if (m_abort) { |
168 m_mutex.unlock(); |
168 m_mutex.unlock(); |
169 return; |
169 return; |
170 } |
170 } |
176 if (!reader.init()) |
176 if (!reader.init()) |
177 continue; |
177 continue; |
178 QStringList lst = reader.indicesForFilter(atts); |
178 QStringList lst = reader.indicesForFilter(atts); |
179 if (!lst.isEmpty()) { |
179 if (!lst.isEmpty()) { |
180 m_mutex.lock(); |
180 m_mutex.lock(); |
181 foreach (QString s, lst) |
181 foreach (const QString &s, lst) |
182 indicesSet.insert(s); |
182 indicesSet.insert(s); |
183 if (m_abort) { |
183 if (m_abort) { |
184 m_mutex.unlock(); |
184 m_mutex.unlock(); |
185 return; |
185 return; |
186 } |
186 } |
315 int perfectMatch = -1; |
315 int perfectMatch = -1; |
316 |
316 |
317 if (!wildcard.isEmpty()) { |
317 if (!wildcard.isEmpty()) { |
318 QRegExp regExp(wildcard, Qt::CaseInsensitive); |
318 QRegExp regExp(wildcard, Qt::CaseInsensitive); |
319 regExp.setPatternSyntax(QRegExp::Wildcard); |
319 regExp.setPatternSyntax(QRegExp::Wildcard); |
320 foreach (QString index, d->indices) { |
320 foreach (const QString &index, d->indices) { |
321 if (index.contains(regExp)) { |
321 if (index.contains(regExp)) { |
322 lst.append(index); |
322 lst.append(index); |
323 if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { |
323 if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { |
324 if (goodMatch == -1) |
324 if (goodMatch == -1) |
325 goodMatch = lst.count()-1; |
325 goodMatch = lst.count()-1; |
330 perfectMatch = lst.count()-1; |
330 perfectMatch = lst.count()-1; |
331 } |
331 } |
332 } |
332 } |
333 } |
333 } |
334 } else { |
334 } else { |
335 foreach (QString index, d->indices) { |
335 foreach (const QString &index, d->indices) { |
336 if (index.contains(filter, Qt::CaseInsensitive)) { |
336 if (index.contains(filter, Qt::CaseInsensitive)) { |
337 lst.append(index); |
337 lst.append(index); |
338 if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { |
338 if (perfectMatch == -1 && index.startsWith(filter, Qt::CaseInsensitive)) { |
339 if (goodMatch == -1) |
339 if (goodMatch == -1) |
340 goodMatch = lst.count()-1; |
340 goodMatch = lst.count()-1; |