Skip to content
Snippets Groups Projects
Commit d87f10a9 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk
Browse files

Locator: Rename variables for consistency


Change-Id: Ifc2228b4b18a8ce6ba19390f796f1f3c05e381d4
Reviewed-by: default avatarAndré Hartmann <aha_1980@gmx.de>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent f1583c98
No related branches found
No related tags found
No related merge requests found
...@@ -47,15 +47,15 @@ BaseFileFilter::BaseFileFilter() ...@@ -47,15 +47,15 @@ BaseFileFilter::BaseFileFilter()
QList<FilterEntry> BaseFileFilter::matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &origEntry) QList<FilterEntry> BaseFileFilter::matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &origEntry)
{ {
updateFiles(); updateFiles();
QList<FilterEntry> matches; QList<FilterEntry> betterEntries;
QList<FilterEntry> badMatches; QList<FilterEntry> goodEntries;
QString needle = trimWildcards(origEntry); QString needle = trimWildcards(origEntry);
const QString lineNoSuffix = EditorManager::splitLineNumber(&needle); const QString lineNoSuffix = EditorManager::splitLineNumber(&needle);
QStringMatcher matcher(needle, Qt::CaseInsensitive); QStringMatcher matcher(needle, Qt::CaseInsensitive);
const QChar asterisk = QLatin1Char('*'); const QChar asterisk = QLatin1Char('*');
QRegExp regexp(asterisk + needle+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard); QRegExp regexp(asterisk + needle+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard);
if (!regexp.isValid()) if (!regexp.isValid())
return matches; return betterEntries;
const bool hasWildcard = needle.contains(asterisk) || needle.contains(QLatin1Char('?')); const bool hasWildcard = needle.contains(asterisk) || needle.contains(QLatin1Char('?'));
QStringList searchListPaths; QStringList searchListPaths;
QStringList searchListNames; QStringList searchListNames;
...@@ -86,16 +86,16 @@ QList<FilterEntry> BaseFileFilter::matchesFor(QFutureInterface<Locator::FilterEn ...@@ -86,16 +86,16 @@ QList<FilterEntry> BaseFileFilter::matchesFor(QFutureInterface<Locator::FilterEn
entry.extraInfo = FileUtils::shortNativePath(FileName(fi)); entry.extraInfo = FileUtils::shortNativePath(FileName(fi));
entry.fileName = path; entry.fileName = path;
if (name.startsWith(needle, caseSensitivityForPrefix)) if (name.startsWith(needle, caseSensitivityForPrefix))
matches.append(entry); betterEntries.append(entry);
else else
badMatches.append(entry); goodEntries.append(entry);
m_previousResultPaths.append(path); m_previousResultPaths.append(path);
m_previousResultNames.append(name); m_previousResultNames.append(name);
} }
} }
matches.append(badMatches); betterEntries.append(goodEntries);
return matches; return betterEntries;
} }
void BaseFileFilter::accept(Locator::FilterEntry selection) const void BaseFileFilter::accept(Locator::FilterEntry selection) const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment