| 85 | } |
| 86 | |
| 87 | bool IgnoreManager::isPathExcluded(const QString &path, const QStringList &patterns) const |
| 88 | { |
| 89 | bool excluded = false; |
| 90 | |
| 91 | for (const QString &pattern : patterns) { |
| 92 | if (pattern.isEmpty() || pattern.startsWith('#')) |
| 93 | continue; |
| 94 | |
| 95 | bool isNegative = pattern.startsWith('!'); |
| 96 | QString actualPattern = isNegative ? pattern.mid(1) : pattern; |
| 97 | |
| 98 | bool matches = matchPathWithPattern(path, actualPattern); |
| 99 | |
| 100 | if (matches) { |
| 101 | excluded = !isNegative; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | return excluded; |
| 106 | } |
| 107 | |
| 108 | bool IgnoreManager::matchPathWithPattern(const QString &path, const QString &pattern) const |
| 109 | { |