forked from qt-creator/qt-creator
qmake: introduce reload_properties() function
Task-number: QTCREATORBUG-18220 Change-Id: I4526ef64b3c89d9851e10f83965fe479ed7f39f6 (cherry picked from qtbase/169a40d511165f6c3c9a71cd5c079786c22d2aca) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -98,7 +98,7 @@ enum TestFunc {
|
|||||||
T_EXISTS, T_EXPORT, T_CLEAR, T_UNSET, T_EVAL, T_CONFIG, T_SYSTEM,
|
T_EXISTS, T_EXPORT, T_CLEAR, T_UNSET, T_EVAL, T_CONFIG, T_SYSTEM,
|
||||||
T_DEFINED, T_DISCARD_FROM, T_CONTAINS, T_INFILE,
|
T_DEFINED, T_DISCARD_FROM, T_CONTAINS, T_INFILE,
|
||||||
T_COUNT, T_ISEMPTY, T_PARSE_JSON, T_INCLUDE, T_LOAD, T_DEBUG, T_LOG, T_MESSAGE, T_WARNING, T_ERROR, T_IF,
|
T_COUNT, T_ISEMPTY, T_PARSE_JSON, T_INCLUDE, T_LOAD, T_DEBUG, T_LOG, T_MESSAGE, T_WARNING, T_ERROR, T_IF,
|
||||||
T_MKPATH, T_WRITE_FILE, T_TOUCH, T_CACHE
|
T_MKPATH, T_WRITE_FILE, T_TOUCH, T_CACHE, T_RELOAD_PROPERTIES
|
||||||
};
|
};
|
||||||
|
|
||||||
void QMakeEvaluator::initFunctionStatics()
|
void QMakeEvaluator::initFunctionStatics()
|
||||||
@@ -197,6 +197,7 @@ void QMakeEvaluator::initFunctionStatics()
|
|||||||
{ "write_file", T_WRITE_FILE },
|
{ "write_file", T_WRITE_FILE },
|
||||||
{ "touch", T_TOUCH },
|
{ "touch", T_TOUCH },
|
||||||
{ "cache", T_CACHE },
|
{ "cache", T_CACHE },
|
||||||
|
{ "reload_properties", T_RELOAD_PROPERTIES },
|
||||||
};
|
};
|
||||||
statics.functions.reserve((int)(sizeof(testInits)/sizeof(testInits[0])));
|
statics.functions.reserve((int)(sizeof(testInits)/sizeof(testInits[0])));
|
||||||
for (unsigned i = 0; i < sizeof(testInits)/sizeof(testInits[0]); ++i)
|
for (unsigned i = 0; i < sizeof(testInits)/sizeof(testInits[0]); ++i)
|
||||||
@@ -2026,6 +2027,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
}
|
}
|
||||||
return writeFile(fL1S("cache "), fn, QIODevice::Append, flags, varstr);
|
return writeFile(fL1S("cache "), fn, QIODevice::Append, flags, varstr);
|
||||||
}
|
}
|
||||||
|
case T_RELOAD_PROPERTIES:
|
||||||
|
#ifdef QT_BUILD_QMAKE
|
||||||
|
m_option->reloadProperties();
|
||||||
|
#endif
|
||||||
|
return ReturnTrue;
|
||||||
default:
|
default:
|
||||||
evalError(fL1S("Function '%1' is not implemented.").arg(function.toQString(m_tmp1)));
|
evalError(fL1S("Function '%1' is not implemented.").arg(function.toQString(m_tmp1)));
|
||||||
return ReturnFalse;
|
return ReturnFalse;
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ public:
|
|||||||
void setDirectories(const QString &input_dir, const QString &output_dir);
|
void setDirectories(const QString &input_dir, const QString &output_dir);
|
||||||
#ifdef QT_BUILD_QMAKE
|
#ifdef QT_BUILD_QMAKE
|
||||||
void setQMakeProperty(QMakeProperty *prop) { property = prop; }
|
void setQMakeProperty(QMakeProperty *prop) { property = prop; }
|
||||||
|
void reloadProperties() { property->reload(); }
|
||||||
ProString propertyValue(const ProKey &name) const { return property->value(name); }
|
ProString propertyValue(const ProKey &name) const { return property->value(name); }
|
||||||
#else
|
#else
|
||||||
static void parseProperties(const QByteArray &data, QHash<ProKey, ProString> &props);
|
static void parseProperties(const QByteArray &data, QHash<ProKey, ProString> &props);
|
||||||
|
|||||||
Reference in New Issue
Block a user