diff options
| author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-10 12:01:59 +0300 |
|---|---|---|
| committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-10-10 12:01:59 +0300 |
| commit | cf5106463bd3aeb78a6a51839673b0e4f008fd82 (patch) | |
| tree | b675d72375ae88453e1118c4e7be627f94fccd7c /src/linguist/lupdate/main.cpp | |
| parent | 786bdcbf8cdc7ba3d4e5a8c15e1ead03c5926967 (diff) | |
| parent | 6444be988641a3a96a49fb39f28af2c532397e65 (diff) | |
Merge tag 'v6.5.7-lts' into tqtc/lts-6.5-opensourcev6.5.7-lts-lgpl6.5
Qt 6.5.7-lts release
Conflicts solved:
dependencies.yaml
Change-Id: I17f2889bbcdd447aacb628177f1df4cad4b2cd16
Diffstat (limited to 'src/linguist/lupdate/main.cpp')
| -rw-r--r-- | src/linguist/lupdate/main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index 0ebe43214..d83ed880a 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -18,6 +18,7 @@ #include <QtCore/QFile> #include <QtCore/QFileInfo> #include <QtCore/QLibraryInfo> +#include <QtCore/QRegularExpression> #include <QtCore/QString> #include <QtCore/QStringList> #include <QtCore/QTranslator> @@ -463,6 +464,21 @@ static bool readFileContent(const QString &filePath, QString *content, QString * return true; } +static void removeExcludedSources(Projects &projects) +{ + for (Project &project : projects) { + for (const QRegularExpression &rx : project.excluded) { + for (auto it = project.sources.begin(); it != project.sources.end(); ) { + if (rx.match(*it).hasMatch()) + it = project.sources.erase(it); + else + ++it; + } + } + removeExcludedSources(project.subProjects); + } +} + static QStringList getResources(const QString &resourceFile) { if (!QFile::exists(resourceFile)) @@ -1070,6 +1086,7 @@ int main(int argc, char **argv) .arg(projectDescriptionFile)); return 1; } + removeExcludedSources(projectDescription); for (Project &project : projectDescription) expandQrcFiles(project); } |
