summaryrefslogtreecommitdiffstats
path: root/qmake/library/qmakeparser.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-23 14:05:54 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-25 11:56:07 +0000
commit12bb328bb0be8efe54aae750c21938aab4d17539 (patch)
treee41933a511e6edeaccf3840d8897345971a3fdaf /qmake/library/qmakeparser.cpp
parent6a9f38a11d56bb3ba6ec59955f3220627c0d30b6 (diff)
add discard_from() function
this function discards all values that come from a specific file. it will be needed for configure bootstrapping, but is too obscure to document it for general use. Change-Id: I62c18aeb1847712e33d0599dbb0b90ffa1722438 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'qmake/library/qmakeparser.cpp')
-rw-r--r--qmake/library/qmakeparser.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 7d645625a1..56b217dfbb 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -165,7 +165,7 @@ QMakeParser::QMakeParser(ProFileCache *cache, QMakeVfs *vfs, QMakeParserHandler
ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
{
ProFile *pro;
- if ((flags & ParseUseCache) && m_cache) {
+ if ((flags & (ParseUseCache|ParseOnlyCached)) && m_cache) {
ProFileCache::Entry *ent;
#ifdef PROPARSER_THREAD_SAFE
QMutexLocker locker(&m_cache->mutex);
@@ -187,7 +187,7 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
#endif
if ((pro = ent->pro))
pro->ref();
- } else {
+ } else if (!(flags & ParseOnlyCached)) {
ent = &m_cache->parsed_files[fileName];
#ifdef PROPARSER_THREAD_SAFE
ent->locker = new ProFileCache::Entry::Locker;
@@ -212,13 +212,17 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
ent->locker = 0;
}
#endif
+ } else {
+ pro = 0;
}
- } else {
+ } else if (!(flags & ParseOnlyCached)) {
pro = new ProFile(fileName);
if (!read(pro, flags)) {
delete pro;
pro = 0;
}
+ } else {
+ pro = 0;
}
return pro;
}