Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 749fa3b2 authored by Alex Neundorf's avatar Alex Neundorf

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.

parent 66dc30c3
......@@ -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;
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