summaryrefslogtreecommitdiffstats
path: root/src/linguist/lupdate/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/linguist/lupdate/main.cpp')
-rw-r--r--src/linguist/lupdate/main.cpp17
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);
}