forked from qt-creator/qt-creator
CMake: Use FilePath::ensureExistingFile in file API
Change-Id: I38c2e97711bbc1c72c51eeb59429572ea7931e4d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -839,14 +839,8 @@ bool FileApiParser::setupCMakeFileApi(const FilePath &buildDirectory, Utils::Fil
|
||||
|
||||
bool failedBefore = false;
|
||||
for (const FilePath &filePath : cmakeQueryFilePaths(buildDirectory)) {
|
||||
QTC_CHECK(!filePath.needsDevice());
|
||||
QFile f(filePath.path());
|
||||
if (!f.exists()) {
|
||||
f.open(QFile::WriteOnly);
|
||||
f.close();
|
||||
}
|
||||
|
||||
if (!f.exists() && !failedBefore) {
|
||||
const bool success = filePath.ensureExistingFile();
|
||||
if (!success && !failedBefore) {
|
||||
failedBefore = true;
|
||||
reportFileApiSetupFailure();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user