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;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_BUILD_QMAKE
|
||||||
#ifdef PROEVALUATOR_INIT_PROPS
|
#ifdef PROEVALUATOR_INIT_PROPS
|
||||||
bool QMakeGlobals::initProperties()
|
bool QMakeGlobals::initProperties()
|
||||||
{
|
{
|
||||||
@@ -339,5 +340,6 @@ void QMakeGlobals::setProperties(const QHash<QString, QString> &props)
|
|||||||
properties.insert(ProKey(it.key()), ProString(it.value()));
|
properties.insert(ProKey(it.key()), ProString(it.value()));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif // QT_BUILD_QMAKE
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@@ -34,6 +34,10 @@
|
|||||||
#include "qmake_global.h"
|
#include "qmake_global.h"
|
||||||
#include "proitems.h"
|
#include "proitems.h"
|
||||||
|
|
||||||
|
#ifdef QT_BUILD_QMAKE
|
||||||
|
# include <property.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#ifndef QT_BOOTSTRAPPED
|
||||||
@@ -117,12 +121,17 @@ public:
|
|||||||
void setCommandLineArguments(const QString &pwd, const QStringList &args);
|
void setCommandLineArguments(const QString &pwd, const QStringList &args);
|
||||||
void useEnvironment();
|
void useEnvironment();
|
||||||
void setDirectories(const QString &input_dir, const QString &output_dir);
|
void setDirectories(const QString &input_dir, const QString &output_dir);
|
||||||
#ifdef PROEVALUATOR_INIT_PROPS
|
#ifdef QT_BUILD_QMAKE
|
||||||
bool initProperties();
|
void setQMakeProperty(QMakeProperty *prop) { property = prop; }
|
||||||
|
ProString propertyValue(const ProKey &name) const { return property->value(name); }
|
||||||
#else
|
#else
|
||||||
|
# ifdef PROEVALUATOR_INIT_PROPS
|
||||||
|
bool initProperties();
|
||||||
|
# else
|
||||||
void setProperties(const QHash<QString, QString> &props);
|
void setProperties(const QHash<QString, QString> &props);
|
||||||
#endif
|
# endif
|
||||||
ProString propertyValue(const ProKey &name) const { return properties.value(name); }
|
ProString propertyValue(const ProKey &name) const { return properties.value(name); }
|
||||||
|
#endif
|
||||||
|
|
||||||
QString expandEnvVars(const QString &str) const;
|
QString expandEnvVars(const QString &str) const;
|
||||||
|
|
||||||
@@ -134,7 +143,11 @@ private:
|
|||||||
|
|
||||||
QString source_root, build_root;
|
QString source_root, build_root;
|
||||||
|
|
||||||
|
#ifdef QT_BUILD_QMAKE
|
||||||
|
QMakeProperty *property;
|
||||||
|
#else
|
||||||
QHash<ProKey, ProString> properties;
|
QHash<ProKey, ProString> properties;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PROEVALUATOR_THREAD_SAFE
|
#ifdef PROEVALUATOR_THREAD_SAFE
|
||||||
QMutex mutex;
|
QMutex mutex;
|
||||||
|
Reference in New Issue
Block a user