Commit 49e255c4 authored by Tobias Hunger's avatar Tobias Hunger

CMake: Check result of file open

Change-Id: Ia4a11359f7cb08ee3fa55c77dc54d42890f37845
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 2d8d90bc
......@@ -602,7 +602,8 @@ bool TeaLeafReader::extractFlagsFromMake(const CMakeBuildTarget &buildTarget,
makefile = makefile.remove("\\");
QFile file(makefile);
if (file.exists()) {
file.open(QIODevice::ReadOnly | QIODevice::Text);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return false;
QTextStream stream(&file);
while (!stream.atEnd()) {
QString line = stream.readLine().trimmed();
......@@ -659,7 +660,8 @@ bool TeaLeafReader::extractFlagsFromNinja(const CMakeBuildTarget &buildTarget,
buildNinjaFile += "/build.ninja";
QFile buildNinja(buildNinjaFile);
if (buildNinja.exists()) {
buildNinja.open(QIODevice::ReadOnly | QIODevice::Text);
if (!buildNinja.open(QIODevice::ReadOnly | QIODevice::Text))
return false;
ninjaFile = buildNinja.readAll();
buildNinja.close();
}
......
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