mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Extract path from document file name in RimProject
p4#: 21160
This commit is contained in:
parent
b9ed45af2c
commit
4ae9182fc6
@ -231,3 +231,12 @@ void RimProject::insertCaseInCaseGroup(RimIdenticalGridCaseGroup* caseGroup, Rim
|
|||||||
caseGroup->addCase(rimReservoir);
|
caseGroup->addCase(rimReservoir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimProject::projectPath() const
|
||||||
|
{
|
||||||
|
QFileInfo fileInfo(fileName());
|
||||||
|
return fileInfo.path();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -34,12 +34,11 @@ class RimProject : public caf::PdmDocument
|
|||||||
CAF_PDM_HEADER_INIT;
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
caf::PdmPointersField<RimCase*> reservoirs;
|
caf::PdmPointersField<RimCase*> reservoirs;
|
||||||
caf::PdmPointersField<RimIdenticalGridCaseGroup*> caseGroups;
|
caf::PdmPointersField<RimIdenticalGridCaseGroup*> caseGroups;
|
||||||
caf::PdmField<RimScriptCollection*> scriptCollection;
|
caf::PdmField<RimScriptCollection*> scriptCollection;
|
||||||
|
|
||||||
void setUserScriptPath(const QString& path);
|
void setUserScriptPath(const QString& path);
|
||||||
//void updateProjectScriptPath();
|
|
||||||
|
|
||||||
QString projectFileVersionString() const;
|
QString projectFileVersionString() const;
|
||||||
|
|
||||||
@ -52,6 +51,8 @@ public:
|
|||||||
|
|
||||||
void moveEclipseCaseIntoCaseGroup(RimCase* rimReservoir);
|
void moveEclipseCaseIntoCaseGroup(RimCase* rimReservoir);
|
||||||
void removeCaseFromAllGroups(RimCase* rimReservoir);
|
void removeCaseFromAllGroups(RimCase* rimReservoir);
|
||||||
|
|
||||||
|
QString projectPath() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RigMainGrid* registerCaseInGridCollection(RigCaseData* rigEclipseCase);
|
RigMainGrid* registerCaseInGridCollection(RigCaseData* rigEclipseCase);
|
||||||
@ -63,6 +64,5 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<QString> m_projectFileVersionString;
|
caf::PdmField<QString> m_projectFileVersionString;
|
||||||
|
cvf::ref<RigGridManager> m_gridCollection;
|
||||||
cvf::ref<RigGridManager> m_gridCollection;
|
|
||||||
};
|
};
|
||||||
|
@ -292,13 +292,13 @@ void RimResultCase::initAfterRead()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString projPath = projectPath();
|
QString projPath = RiaApplication::instance()->project()->projectPath();
|
||||||
|
|
||||||
candidate = QDir::fromNativeSeparators(projPath + QDir::separator() + caseName + ".EGRID");
|
candidate = QDir::fromNativeSeparators(projPath + QDir::separator() + caseName + ".EGRID");
|
||||||
if (QFile::exists(candidate))
|
if (QFile::exists(candidate))
|
||||||
{
|
{
|
||||||
caseFileName = candidate;
|
caseFileName = candidate;
|
||||||
caseDirectory = projectPath;
|
caseDirectory = projPath;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,13 +312,3 @@ void RimResultCase::initAfterRead()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QString RimResultCase::projectPath() const
|
|
||||||
{
|
|
||||||
QString projectFileName = RiaApplication::instance()->project()->fileName();
|
|
||||||
QFileInfo fileInfo(projectFileName);
|
|
||||||
return fileInfo.path();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -55,7 +55,5 @@ protected:
|
|||||||
virtual void initAfterRead();
|
virtual void initAfterRead();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString projectPath() const;
|
|
||||||
|
|
||||||
cvf::ref<RifReaderInterface> createMockModel(QString modelName);
|
cvf::ref<RifReaderInterface> createMockModel(QString modelName);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user