aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/proparser
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-01-24 13:47:02 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-01-24 14:05:05 +0000
commit61419e7bf0f3bff6dcf63876b05b72c56e60c2a8 (patch)
tree85fee0364daf015397385f8d2c49b1262f3818bd /src/shared/proparser
parent03e699ce2985eedcd33d247aa47d04b14bc4bc04 (diff)
fix fallbacks in external property parsing
the fallback chain is "Put" => Raw => Get => Src. formerly, everything fell back on "Put", which is plain wrong. Change-Id: I13967120e381ddbb03ed6a877c2960f8e5bc4f7d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/shared/proparser')
-rw-r--r--src/shared/proparser/qmakeglobals.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/shared/proparser/qmakeglobals.cpp b/src/shared/proparser/qmakeglobals.cpp
index 9fd6040ad7..ec029b8db0 100644
--- a/src/shared/proparser/qmakeglobals.cpp
+++ b/src/shared/proparser/qmakeglobals.cpp
@@ -345,14 +345,20 @@ void QMakeGlobals::parseProperties(const QByteArray &data, QHash<ProKey, ProStri
value = ProString(""); // Make sure it is not null, to discern from missing keys
properties.insert(ProKey(name), value);
if (name.startsWith(QLatin1String("QT_"))) {
- bool plain = !name.contains(QLatin1Char('/'));
- if (!plain) {
- if (!name.endsWith(QLatin1String("/get")))
+ enum { PropPut, PropRaw, PropGet } variant;
+ if (name.contains(QLatin1Char('/'))) {
+ if (name.endsWith(QLatin1String("/raw")))
+ variant = PropRaw;
+ else if (name.endsWith(QLatin1String("/get")))
+ variant = PropGet;
+ else // Nothing falls back on /src.
continue;
name.chop(4);
+ } else {
+ variant = PropPut;
}
if (name.startsWith(QLatin1String("QT_INSTALL_"))) {
- if (plain) {
+ if (variant < PropRaw) {
if (name == QLatin1String("QT_INSTALL_PREFIX")
|| name == QLatin1String("QT_INSTALL_DATA")
|| name == QLatin1String("QT_INSTALL_LIBS")
@@ -365,11 +371,12 @@ void QMakeGlobals::parseProperties(const QByteArray &data, QHash<ProKey, ProStri
properties.insert(ProKey(hname + QLatin1String("/src")), value);
}
properties.insert(ProKey(name + QLatin1String("/raw")), value);
- properties.insert(ProKey(name + QLatin1String("/get")), value);
}
+ if (variant < PropGet)
+ properties.insert(ProKey(name + QLatin1String("/get")), value);
properties.insert(ProKey(name + QLatin1String("/src")), value);
} else if (name.startsWith(QLatin1String("QT_HOST_"))) {
- if (plain)
+ if (variant < PropGet)
properties.insert(ProKey(name + QLatin1String("/get")), value);
properties.insert(ProKey(name + QLatin1String("/src")), value);
}