mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1476 Include isFile() when checking if a file exists
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "cafPdmUiItem.h"
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
@@ -81,7 +82,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew
|
||||
bool isWindowsPath = false;
|
||||
if (orgFileName.count("/")) isWindowsPath = false; // "/" are not allowed in a windows path
|
||||
else if (orgFileName.count("\\")
|
||||
&& !QFile::exists(orgFileName)) // To make sure we do not convert single linux files containing "\"
|
||||
&& !caf::Utils::fileExists(orgFileName)) // To make sure we do not convert single linux files containing "\"
|
||||
{
|
||||
isWindowsPath = true;
|
||||
}
|
||||
@@ -93,7 +94,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew
|
||||
}
|
||||
|
||||
if (searchedPaths) searchedPaths->push_back(fileName);
|
||||
if (QFile::exists(fileName))
|
||||
if (caf::Utils::fileExists(fileName))
|
||||
{
|
||||
return fileName;
|
||||
}
|
||||
@@ -104,7 +105,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew
|
||||
QString candidate = QDir::fromNativeSeparators(newProjectPath + QDir::separator() + fileNameWithoutPath);
|
||||
if (searchedPaths) searchedPaths->push_back(candidate);
|
||||
|
||||
if (QFile::exists(candidate))
|
||||
if (caf::Utils::fileExists(candidate))
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
@@ -199,7 +200,7 @@ QString RimTools::relocateFile(const QString& orgFileName, const QString& orgNew
|
||||
|
||||
if (searchedPaths) searchedPaths->push_back(relocatedFileName);
|
||||
|
||||
if (QFile::exists(relocatedFileName))
|
||||
if (caf::Utils::fileExists(relocatedFileName))
|
||||
{
|
||||
return relocatedFileName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user