2016-05-31 06:42:27 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016- Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimFileSummaryCase.h"
|
2017-05-03 05:31:45 -05:00
|
|
|
#include "RimTools.h"
|
|
|
|
|
2016-08-05 04:05:58 -05:00
|
|
|
#include "QFileInfo"
|
2016-05-31 06:42:27 -05:00
|
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
CAF_PDM_SOURCE_INIT(RimFileSummaryCase,"FileSummaryCase");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFileSummaryCase::RimFileSummaryCase()
|
|
|
|
{
|
2017-04-04 05:14:13 -05:00
|
|
|
|
2016-05-31 06:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimFileSummaryCase::~RimFileSummaryCase()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFileSummaryCase::setSummaryHeaderFilename(const QString& fileName)
|
|
|
|
{
|
|
|
|
m_summaryHeaderFilename = fileName;
|
2016-10-06 03:33:57 -05:00
|
|
|
|
|
|
|
this->updateAutoShortName();
|
|
|
|
this->updateTreeItemName();
|
2016-05-31 06:42:27 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimFileSummaryCase::summaryHeaderFilename() const
|
|
|
|
{
|
|
|
|
return m_summaryHeaderFilename();
|
|
|
|
}
|
|
|
|
|
2016-08-05 04:05:58 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-04-04 05:14:13 -05:00
|
|
|
QString RimFileSummaryCase::caseName()
|
2016-08-05 04:05:58 -05:00
|
|
|
{
|
|
|
|
QFileInfo caseFileName(this->summaryHeaderFilename());
|
2016-05-31 06:42:27 -05:00
|
|
|
|
2016-08-05 04:05:58 -05:00
|
|
|
return caseFileName.completeBaseName();
|
|
|
|
}
|
2017-05-03 05:31:45 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimFileSummaryCase::updateFilePathsFromProjectPath(const QString & newProjectPath, const QString & oldProjectPath)
|
|
|
|
{
|
|
|
|
m_summaryHeaderFilename = RimTools::relocateFile(m_summaryHeaderFilename(), newProjectPath, oldProjectPath, nullptr, nullptr);
|
|
|
|
}
|