Commit 1bcf7561 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

[FileFilter] Create HotSpot's for files in child dirs too

Match files in subdirs of the current dir too, this enables opening
files from the output of e.g. `grep`.

Also use QSet::cbegin/cend to prevent detaching (if the container is not
const, calling begin/end on it will make it detach).

This partially reverts 0b489b0c.
parent 46e17c9c
......@@ -503,7 +503,10 @@ QSharedPointer<Filter::HotSpot> FileFilter::newHotSpot(int startLine, int startC
// Return nullptr if it's not:
// <current dir>/filename
// <current dir>/childDir/filename
if (!_currentDirContents.contains(filename)) {
auto match = std::find_if(_currentDirContents.cbegin(), _currentDirContents.cend(),
[filename](const QString &s) { return filename.startsWith(s); });
if (match == _currentDirContents.cend()) {
return nullptr;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment