summaryrefslogtreecommitdiffstats
path: root/src/linguist/shared/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-10-10 09:57:22 +0000
commit09958bdb72e1ae4627c67485d94ae3b5e794a68c (patch)
tree565cda0980c29709f3effb1a3671dc5e6ec321c3 /src/linguist/shared/qmakeparser.cpp
parent4e2bf4fbe5fb19c74c6e4591434703e45dcf80b3 (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> (cherry picked from qtbase/12bb328bb0be8efe54aae750c21938aab4d17539) Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/linguist/shared/qmakeparser.cpp')
-rw-r--r--src/linguist/shared/qmakeparser.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/linguist/shared/qmakeparser.cpp b/src/linguist/shared/qmakeparser.cpp
index b50f91a7a..6f0047bf5 100644
--- a/src/linguist/shared/qmakeparser.cpp
+++ b/src/linguist/shared/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;
}