Skip to content
Snippets Groups Projects
Commit 749fa3b2 authored by Alexander Neundorf's avatar Alexander Neundorf
Browse files

search plugin: make the "Exclude"-filter work properly

With this patch, it is actually possible to use the exclude-filter
in "in Folder" mode to exclude subdirs, e.g. build-subdirs.
Before it ws matching only the filename, now it matches the
full path relative to the search start directory.

Alex
parent 66dc30c3
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,9 @@ void FolderFilesList::generateList(const QString &folder,
{
m_cancelSearch = false;
m_folder = folder;
if (!m_folder.endsWith(QLatin1Char('/'))) {
m_folder += QLatin1Char('/');
}
m_recursive = recursive;
m_hidden = hidden;
m_symlinks = symlinks;
......@@ -125,7 +128,12 @@ void FolderFilesList::checkNextItem(const QFileInfo &item)
for (int i = 0; i<currentItems.size(); ++i) {
skip = false;
for (int j=0; j<m_excludeList.size(); j++) {
if (m_excludeList[j].exactMatch(currentItems[i].fileName())) {
QString matchString = currentItems[i].filePath();
if (currentItems[i].filePath().startsWith(m_folder)) {
matchString = currentItems[i].filePath().mid(m_folder.size());
}
if (m_excludeList[j].exactMatch(matchString)) {
skip = true;
break;
}
......
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