Changeset View
Changeset View
Standalone View
Standalone View
addons/search/FolderFilesList.cpp
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 111 | else { | |||
---|---|---|---|---|---|
120 | if (m_hidden) filter |= QDir::Hidden; | 120 | if (m_hidden) filter |= QDir::Hidden; | ||
121 | if (m_recursive) filter |= QDir::AllDirs; | 121 | if (m_recursive) filter |= QDir::AllDirs; | ||
122 | if (!m_symlinks) filter |= QDir::NoSymLinks; | 122 | if (!m_symlinks) filter |= QDir::NoSymLinks; | ||
123 | 123 | | |||
124 | // sort the items to have an deterministic order! | 124 | // sort the items to have an deterministic order! | ||
125 | const QFileInfoList currentItems = currentDir.entryInfoList(m_types, filter, QDir::Name | QDir::LocaleAware); | 125 | const QFileInfoList currentItems = currentDir.entryInfoList(m_types, filter, QDir::Name | QDir::LocaleAware); | ||
126 | 126 | | |||
127 | bool skip; | 127 | bool skip; | ||
128 | for (int i = 0; i<currentItems.size(); ++i) { | 128 | for (const auto& currentItem : currentItems) { | ||
129 | skip = false; | 129 | skip = false; | ||
130 | for (int j=0; j<m_excludeList.size(); j++) { | 130 | for (const auto& regex : qAsConst(m_excludeList)) { | ||
131 | 131 | | |||
132 | QString matchString = currentItems[i].filePath(); | 132 | QString matchString = currentItem.filePath(); | ||
133 | if (currentItems[i].filePath().startsWith(m_folder)) { | 133 | if (currentItem.filePath().startsWith(m_folder)) { | ||
134 | matchString = currentItems[i].filePath().mid(m_folder.size()); | 134 | matchString = currentItem.filePath().mid(m_folder.size()); | ||
135 | } | 135 | } | ||
136 | if (m_excludeList[j].exactMatch(matchString)) { | 136 | if (regex.exactMatch(matchString)) { | ||
137 | skip = true; | 137 | skip = true; | ||
138 | break; | 138 | break; | ||
139 | } | 139 | } | ||
140 | } | 140 | } | ||
141 | if (!skip) { | 141 | if (!skip) { | ||
142 | checkNextItem(currentItems[i]); | 142 | checkNextItem(currentItem); | ||
143 | } | 143 | } | ||
144 | } | 144 | } | ||
145 | } | 145 | } | ||
146 | } | 146 | } | ||
147 | 147 | |