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:
@@ -420,21 +420,18 @@ QString RimInputCase::locationOnDisc() const
|
||||
return fi.absolutePath();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimInputCase::initAfterRead()
|
||||
void RimInputCase::updateFilePathsFromProjectPath(const QString& projectPath)
|
||||
{
|
||||
RimCase::initAfterRead();
|
||||
|
||||
QString projPath = RiaApplication::instance()->project()->projectPath();
|
||||
|
||||
QString candidate;
|
||||
|
||||
if (!QFile::exists(m_gridFileName))
|
||||
{
|
||||
QString fileNameWithoutPath = QFileInfo(m_gridFileName).fileName();
|
||||
candidate = QDir::fromNativeSeparators(projPath + QDir::separator() + fileNameWithoutPath);
|
||||
candidate = QDir::fromNativeSeparators(projectPath + QDir::separator() + fileNameWithoutPath);
|
||||
if (QFile::exists(candidate))
|
||||
{
|
||||
m_gridFileName = candidate;
|
||||
@@ -448,11 +445,12 @@ void RimInputCase::initAfterRead()
|
||||
if (!QFile::exists(additionalFileName))
|
||||
{
|
||||
QString fileNameWithoutPath = QFileInfo(additionalFileName).fileName();
|
||||
candidate = QDir::fromNativeSeparators(projPath + QDir::separator() + fileNameWithoutPath);
|
||||
candidate = QDir::fromNativeSeparators(projectPath + QDir::separator() + fileNameWithoutPath);
|
||||
if (QFile::exists(candidate))
|
||||
{
|
||||
m_additionalFileNames.v()[i] = candidate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user