32bool FileSignificanceCheck::isFileSignificant(
const std::string &filePath)
const
36 QReadLocker locker(&m_cacheLock);
37 auto it = m_cache.find(filePath);
38 if (it != m_cache.end())
43 QWriteLocker locker(&m_cacheLock);
44 QString file = QString::fromUtf8(filePath);
45 QString cleanFile = QDir::cleanPath(file);
46 for (
const QRegularExpression &rx : m_exclusionRegExes) {
47 if (rx.match(cleanFile).hasMatch()) {
48 m_cache.insert({filePath,
false});
53 for (
const QDir &rootDir : m_rootDirs) {
54 QString relativeFilePath = rootDir.relativeFilePath(file);
55 if (!relativeFilePath.startsWith(QLatin1String(
"../"))
56 && QFileInfo(relativeFilePath).isRelative()) {
57 m_cache.insert({filePath,
true});
62 m_cache.insert({filePath,
false});