complain about absent files to -pro argument (in lupdate)

this doesn't actually do anything in qmake.

Change-Id: I908fc3792bdc321370e51be98adf7a9c81e37a85
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
(cherry picked from qttools/e1f3732197ef77a29cb7f3c1ce094b3f31a7b689)
(cherry picked from qttools/226f013441990aa4a58f7c82e284057cff659959)
This commit is contained in:
Oswald Buddenhagen 2013-07-24 19:45:58 +02:00 committed by The Qt Project
parent 0a1faaa9eb
commit 15981b985f
2 changed files with 7 additions and 6 deletions

View File

@ -184,7 +184,7 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
locker.unlock(); locker.unlock();
#endif #endif
pro = new ProFile(fileName); pro = new ProFile(fileName);
if (!read(pro)) { if (!read(pro, flags)) {
delete pro; delete pro;
pro = 0; pro = 0;
} else { } else {
@ -205,7 +205,7 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags)
} }
} else { } else {
pro = new ProFile(fileName); pro = new ProFile(fileName);
if (!read(pro)) { if (!read(pro, flags)) {
delete pro; delete pro;
pro = 0; pro = 0;
} }
@ -230,12 +230,12 @@ void QMakeParser::discardFileFromCache(const QString &fileName)
m_cache->discardFile(fileName); m_cache->discardFile(fileName);
} }
bool QMakeParser::read(ProFile *pro) bool QMakeParser::read(ProFile *pro, ParseFlags flags)
{ {
QString content; QString content;
QString errStr; QString errStr;
if (!m_vfs->readFile(pro->fileName(), &content, &errStr)) { if (!m_vfs->readFile(pro->fileName(), &content, &errStr)) {
if (m_handler && m_vfs->exists(pro->fileName())) if (m_handler && ((flags & ParseReportMissing) || m_vfs->exists(pro->fileName())))
m_handler->message(QMakeParserHandler::ParserIoError, m_handler->message(QMakeParserHandler::ParserIoError,
fL1S("Cannot read %1: %2").arg(pro->fileName(), errStr)); fL1S("Cannot read %1: %2").arg(pro->fileName(), errStr));
return false; return false;

View File

@ -89,7 +89,8 @@ public:
enum ParseFlag { enum ParseFlag {
ParseDefault = 0, ParseDefault = 0,
ParseUseCache = 1 ParseUseCache = 1,
ParseReportMissing = 2
}; };
Q_DECLARE_FLAGS(ParseFlags, ParseFlag) Q_DECLARE_FLAGS(ParseFlags, ParseFlag)
@ -136,7 +137,7 @@ private:
ushort terminator; // '}' if replace function call is braced, ':' if test function ushort terminator; // '}' if replace function call is braced, ':' if test function
}; };
bool read(ProFile *pro); bool read(ProFile *pro, ParseFlags flags);
bool read(ProFile *pro, const QString &content, int line, SubGrammar grammar); bool read(ProFile *pro, const QString &content, int line, SubGrammar grammar);
ALWAYS_INLINE void putTok(ushort *&tokPtr, ushort tok); ALWAYS_INLINE void putTok(ushort *&tokPtr, ushort tok);