forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
@@ -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 PROEVALUATOR_INIT_PROPS
|
||||
bool initProperties();
|
||||
#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
|
||||
# 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;
|
||||
|
Reference in New Issue
Block a user