add dynamic property mode for qmake

in qmake, the property map is not pre-initialized with the values from
QSettings, as dynamic properties are typically unused, and thus
initializing them would be a waste of time.
consequently, make propertyValue() just a delegate to a QMakeProperty.

Change-Id: I11af5124f810f798214c43704fe49ace03a8f5b8
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-08-21 14:42:05 +02:00
parent 2847db0ecb
commit b2017f427d
2 changed files with 18 additions and 3 deletions

View File

@@ -282,6 +282,7 @@ QString QMakeGlobals::expandEnvVars(const QString &str) const
return string;
}
#ifndef QT_BUILD_QMAKE
#ifdef PROEVALUATOR_INIT_PROPS
bool QMakeGlobals::initProperties()
{
@@ -339,5 +340,6 @@ void QMakeGlobals::setProperties(const QHash<QString, QString> &props)
properties.insert(ProKey(it.key()), ProString(it.value()));
}
#endif
#endif // QT_BUILD_QMAKE
QT_END_NAMESPACE

View File

@@ -34,6 +34,10 @@
#include "qmake_global.h"
#include "proitems.h"
#ifdef QT_BUILD_QMAKE
# include <property.h>
#endif
#include <QHash>
#include <QStringList>
#ifndef QT_BOOTSTRAPPED
@@ -117,12 +121,17 @@ public:
void setCommandLineArguments(const QString &pwd, const QStringList &args);
void useEnvironment();
void setDirectories(const QString &input_dir, const QString &output_dir);
#ifdef QT_BUILD_QMAKE
void setQMakeProperty(QMakeProperty *prop) { property = prop; }
ProString propertyValue(const ProKey &name) const { return property->value(name); }
#else
# ifdef PROEVALUATOR_INIT_PROPS
bool initProperties();
# else
void setProperties(const QHash<QString, QString> &props);
# endif
ProString propertyValue(const ProKey &name) const { return properties.value(name); }
#endif
QString expandEnvVars(const QString &str) const;
@@ -134,7 +143,11 @@ private:
QString source_root, build_root;
#ifdef QT_BUILD_QMAKE
QMakeProperty *property;
#else
QHash<ProKey, ProString> properties;
#endif
#ifdef PROEVALUATOR_THREAD_SAFE
QMutex mutex;