#1476 Include isFile() when checking if a file exists

This commit is contained in:
Magne Sjaastad
2017-05-11 09:23:13 +02:00
parent e1e75a4fad
commit 84b922ba82
12 changed files with 45 additions and 31 deletions

View File

@@ -32,6 +32,7 @@
#include "cafPdmUiPropertyView.h"
#include "cafPdmUiTreeView.h"
#include "cafPdmUiTreeViewEditor.h"
#include "cafUtils.h"
#include <QObject>
#include <QtGui>
@@ -99,7 +100,7 @@ QString RiuWellImportWizard::jsonWellsFilePath()
void RiuWellImportWizard::downloadFields()
{
QString wellFileName = jsonWellsFilePath();
if (QFile::exists(wellFileName))
if (caf::Utils::fileExists(wellFileName))
{
QFile::remove(wellFileName);
}
@@ -355,7 +356,7 @@ void RiuWellImportWizard::updateFieldsModel()
{
QString fileName = jsonFieldsFilePath();
if (QFile::exists(fileName))
if (caf::Utils::fileExists(fileName))
{
ResInsightInternalJson::JsonReader jsonReader;
QMap<QString, QVariant> jsonMap = jsonReader.decodeFile(fileName);
@@ -540,7 +541,7 @@ QStringList RiuWellImportWizard::absoluteFilePathsToWellPaths() const
for (size_t i = 0; i < downloadEntities.size(); i++)
{
if (QFile::exists(downloadEntities[i].responseFilename))
if (caf::Utils::fileExists(downloadEntities[i].responseFilename))
{
filePaths.push_back(downloadEntities[i].responseFilename);
}
@@ -582,7 +583,7 @@ void RiuWellImportWizard::parseWellsResponse(RimOilFieldEntry* oilFieldEntry)
QStringList surveyNames;
QStringList planNames;
if (QFile::exists(oilFieldEntry->wellsFilePath))
if (caf::Utils::fileExists(oilFieldEntry->wellsFilePath))
{
ResInsightInternalJson::JsonReader jsonReader;
QMap<QString, QVariant> jsonMap = jsonReader.decodeFile(oilFieldEntry->wellsFilePath);
@@ -1056,7 +1057,7 @@ void WellSummaryPage::updateSummaryPage()
for (size_t i = 0; i < downloadEntities.size(); i++)
{
if (QFile::exists(downloadEntities[i].responseFilename))
if (caf::Utils::fileExists(downloadEntities[i].responseFilename))
{
wellPathCount++;
}