#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

@@ -29,6 +29,8 @@
#include "RiuMainWindow.h"
#include "cafUtils.h"
#include <QAction>
#include <QFileInfo>
#include <QInputDialog>
@@ -76,7 +78,7 @@ void RicNewScriptFeature::onActionTriggered(bool isChecked)
fullPathFilenameNewScript = fullPathNewScript + "/untitled.m";
int num= 1;
while (QFileInfo(fullPathFilenameNewScript).exists())
while (caf::Utils::fileExists(fullPathFilenameNewScript))
{
fullPathFilenameNewScript = fullPathNewScript + "/untitled" + QString::number(num) + ".m";
num++;

View File

@@ -27,6 +27,8 @@
#include "RiuMainWindow.h"
#include "RiuWellImportWizard.h"
#include "cafUtils.h"
#include <QAction>
#include <QDir>
#include <QFile>
@@ -47,7 +49,7 @@ bool RicWellPathsImportSsihubFeature::isCommandEnabled()
return false;
}
if (!QFile::exists(app->project()->fileName()))
if (!caf::Utils::fileExists(app->project()->fileName()))
{
return false;
}
@@ -66,7 +68,7 @@ void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
return;
}
if (!QFile::exists(app->project()->fileName()))
if (!caf::Utils::fileExists(app->project()->fileName()))
{
return;
}