Commit aa2508ba authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

Fix qmake's pro file cache to interact correctly with write_file



When writing a file with write_file() we have to inform the pro file parser
cache to discard the file if it's existent in the cache, to ensure that
calling include() after write_file() always works.

Change-Id: I7d09269a57de55ca30b0e11dd40770de9f919f64
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
(cherry picked from qtbase/f45d6414ad6ef1d75f049a61411cd954bcae29c3)
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent a64eac0a
......@@ -308,6 +308,7 @@ QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::Open
.arg(ctx, QDir::toNativeSeparators(qfi.filePath()), errStr));
return ReturnFalse;
}
m_parser->discardFileFromCache(qfi.filePath());
return ReturnTrue;
}
......
......@@ -210,6 +210,12 @@ ProFile *QMakeParser::parsedProBlock(
return pro;
}
void QMakeParser::discardFileFromCache(const QString &fileName)
{
if (m_cache)
m_cache->discardFile(fileName);
}
bool QMakeParser::read(ProFile *pro)
{
QFile file(pro->fileName());
......
......@@ -82,6 +82,8 @@ public:
ProFile *parsedProBlock(const QString &contents, const QString &name, int line = 0,
SubGrammar grammar = FullGrammar);
void discardFileFromCache(const QString &fileName);
private:
enum ScopeNesting {
NestNone = 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment