mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Detect when project path has changed, and do a explicit update of file path for RimCases.
Do not use initAfterRead p4#: 21165
This commit is contained in:
@@ -269,10 +269,8 @@ void RimResultCase::readGridDimensions(std::vector< std::vector<int> >& gridDime
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimResultCase::initAfterRead()
|
||||
void RimResultCase::updateFilePathsFromProjectPath(const QString& projectPath)
|
||||
{
|
||||
RimCase::initAfterRead();
|
||||
|
||||
// Update filename and folder paths when opening project from a different file location
|
||||
if (!QFile::exists(caseFileName))
|
||||
{
|
||||
@@ -292,21 +290,19 @@ void RimResultCase::initAfterRead()
|
||||
return;
|
||||
}
|
||||
|
||||
QString projPath = RiaApplication::instance()->project()->projectPath();
|
||||
|
||||
candidate = QDir::fromNativeSeparators(projPath + QDir::separator() + caseName + ".EGRID");
|
||||
candidate = QDir::fromNativeSeparators(projectPath + QDir::separator() + caseName + ".EGRID");
|
||||
if (QFile::exists(candidate))
|
||||
{
|
||||
caseFileName = candidate;
|
||||
caseDirectory = projPath;
|
||||
caseDirectory = projectPath;
|
||||
return;
|
||||
}
|
||||
|
||||
candidate = QDir::fromNativeSeparators(projPath + QDir::separator() + caseName + ".GRID");
|
||||
candidate = QDir::fromNativeSeparators(projectPath + QDir::separator() + caseName + ".GRID");
|
||||
if (QFile::exists(candidate))
|
||||
{
|
||||
caseFileName = candidate;
|
||||
caseDirectory = projPath;
|
||||
caseDirectory = projectPath;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user