~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/shared/proparser/qmakeparser.cpp

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
    initialize();
141
141
}
142
142
 
143
 
ProFile *QMakeParser::parsedProFile(const QString &fileName, bool cache)
 
143
ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
144
144
{
145
145
    ProFile *pro;
146
 
    if (cache && m_cache) {
 
146
    if ((flags & ParseUseCache) && m_cache) {
147
147
        ProFileCache::Entry *ent;
148
148
#ifdef PROPARSER_THREAD_SAFE
149
149
        QMutexLocker locker(&m_cache->mutex);
172
172
            locker.unlock();
173
173
#endif
174
174
            pro = new ProFile(fileName);
175
 
            if (!read(pro)) {
 
175
            if (!read(pro, flags)) {
176
176
                delete pro;
177
177
                pro = 0;
178
178
            } else {
193
193
        }
194
194
    } else {
195
195
        pro = new ProFile(fileName);
196
 
        if (!read(pro)) {
 
196
        if (!read(pro, flags)) {
197
197
            delete pro;
198
198
            pro = 0;
199
199
        }
218
218
        m_cache->discardFile(fileName);
219
219
}
220
220
 
221
 
bool QMakeParser::read(ProFile *pro)
 
221
bool QMakeParser::read(ProFile *pro, ParseFlags flags)
222
222
{
223
223
    QString content;
224
224
    QString errStr;
225
225
    if (!m_vfs->readFile(pro->fileName(), &content, &errStr)) {
226
 
        if (m_handler && m_vfs->exists(pro->fileName()))
 
226
        if (m_handler && ((flags & ParseReportMissing) || m_vfs->exists(pro->fileName())))
227
227
            m_handler->message(QMakeParserHandler::ParserIoError,
228
228
                               fL1S("Cannot read %1: %2").arg(pro->fileName(), errStr));
229
229
        return false;