summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-07-20 12:39:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-31 11:13:43 +0200
commita806c6a8b299836e578379c2e297adfb65b3c7fd (patch)
treec773547e3db3e5d0213104692a9f302817b9a518 /src/tools/moc/moc.cpp
parentbe4f8393e44229050cd8198eec6d28b36c56b48e (diff)
Search the include paths for json files containing plugin info
This fixes shadow builds with autogenerated .json files as e.g. used by Qt Creator. Change-Id: Ibb783b05d97d996100da4b0dca859fa3f310dc83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index e76f2c1776..f63404c3c2 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1103,6 +1103,18 @@ void Moc::parsePluginData(ClassDef *def)
next(STRING_LITERAL);
QByteArray metaDataFile = unquotedLexem();
QFileInfo fi(QFileInfo(QString::fromLocal8Bit(currentFilenames.top().constData())).dir(), QString::fromLocal8Bit(metaDataFile.constData()));
+ for (int j = 0; j < includes.size() && !fi.exists(); ++j) {
+ const IncludePath &p = includes.at(j);
+ if (p.isFrameworkPath)
+ continue;
+
+ fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(metaDataFile.constData()));
+ // try again, maybe there's a file later in the include paths with the same name
+ if (fi.isDir()) {
+ fi = QFileInfo();
+ continue;
+ }
+ }
if (!fi.exists()) {
QByteArray msg;
msg += "Plugin Metadata file ";