(#791) Update well path filename if project file is relocated

This commit is contained in:
Magne Sjaastad
2016-06-29 16:09:27 +02:00
parent 124585b96a
commit e730e5bf9f
5 changed files with 17 additions and 10 deletions

View File

@@ -365,13 +365,20 @@ bool RimWellPath::isStoredInCache()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath::updateFilePathsFromProjectPath()
void RimWellPath::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
{
QString newCacheFileName = getCacheFileName();
if (QFile::exists(newCacheFileName))
if (isStoredInCache())
{
filepath = newCacheFileName;
QString newCacheFileName = getCacheFileName();
if (QFile::exists(newCacheFileName))
{
filepath = newCacheFileName;
}
}
else
{
filepath = RimTools::relocateFile(filepath(), newProjectPath, oldProjectPath, NULL, NULL);
}
}