introduce ProKey class

while this is actually just an alias for ProString (with explicit
zero-cost conversions only), it nicely illustrates the use of particular
variables. it also serves to hide the NoHash hack from public view.

Change-Id: Iaf9283c64f320ad84a77d9573d1fde6d401c49df
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-08-03 15:57:46 +02:00
parent c07695a423
commit bdd8cf300b
9 changed files with 265 additions and 228 deletions

View File

@@ -229,25 +229,25 @@ bool QMakeGlobals::initProperties()
line.chop(1);
QString name = QString::fromLatin1(line.left(off));
ProString value = ProString(QDir::fromNativeSeparators(
QString::fromLocal8Bit(line.mid(off + 1))), ProStringConstants::NoHash);
properties.insert(ProString(name), value);
QString::fromLocal8Bit(line.mid(off + 1))));
properties.insert(ProKey(name), value);
if (name.startsWith(QLatin1String("QT_")) && !name.contains(QLatin1Char('/'))) {
if (name.startsWith(QLatin1String("QT_INSTALL_"))) {
properties.insert(ProString(name + QLatin1String("/raw")), value);
properties.insert(ProString(name + QLatin1String("/get")), value);
properties.insert(ProKey(name + QLatin1String("/raw")), value);
properties.insert(ProKey(name + QLatin1String("/get")), value);
if (name == QLatin1String("QT_INSTALL_PREFIX")
|| name == QLatin1String("QT_INSTALL_DATA")
|| name == QLatin1String("QT_INSTALL_BINS")) {
name.replace(3, 7, QLatin1String("HOST"));
properties.insert(ProString(name), value);
properties.insert(ProString(name + QLatin1String("/get")), value);
properties.insert(ProKey(name), value);
properties.insert(ProKey(name + QLatin1String("/get")), value);
}
} else if (name.startsWith(QLatin1String("QT_HOST_"))) {
properties.insert(ProString(name + QLatin1String("/get")), value);
properties.insert(ProKey(name + QLatin1String("/get")), value);
}
}
}
properties.insert(ProString("QMAKE_VERSION"), ProString("2.01a", ProStringConstants::NoHash));
properties.insert(ProKey("QMAKE_VERSION"), ProString("2.01a"));
return true;
}
#else
@@ -255,7 +255,7 @@ void QMakeGlobals::setProperties(const QHash<QString, QString> &props)
{
QHash<QString, QString>::ConstIterator it = props.constBegin(), eit = props.constEnd();
for (; it != eit; ++it)
properties.insert(ProString(it.key()), ProString(it.value(), ProStringConstants::NoHash));
properties.insert(ProKey(it.key()), ProString(it.value()));
}
#endif