| 173 | } |
| 174 | |
| 175 | void FileFinder::findFiles(const QString& dirPath, int depth, QList<QUrl>& results) |
| 176 | { |
| 177 | const QFileInfo info(dirPath); |
| 178 | const auto canonicalFilePath = info.canonicalFilePath(); |
| 179 | if (info.isDir()) { |
| 180 | findFilesCanonical(canonicalFilePath, QStringLiteral("/"), depth, results); |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | // Search in the single file at canonicalFilePath. |
| 185 | // canonicalFilePath is empty if the file does not exist. |
| 186 | if (!canonicalFilePath.isEmpty()) { |
| 187 | // Do not match against filters, because this particular file path is a search location. |
| 188 | results.push_back(QUrl::fromLocalFile(canonicalFilePath)); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | void FileFinder::findFilesCanonical(const QString& canonicalDirPath, const QString& pathRelativeToSearchLocation, |
| 193 | int depth, QList<QUrl>& results) |