#4683 clang-format on all files in ApplicationCode

This commit is contained in:
Magne Sjaastad
2019-09-06 10:40:57 +02:00
parent 3a317504bb
commit fe9e567825
2092 changed files with 117952 additions and 111846 deletions

View File

@@ -23,54 +23,54 @@
#include "RiaImportEclipseCaseTools.h"
#include "RiaLogging.h"
#include <QFileInfo>
#include <QDir>
#include <QFileInfo>
#include <QStringList>
CAF_PDM_SOURCE_INIT(RicfLoadCaseResult, "loadCaseResult");
CAF_PDM_SOURCE_INIT( RicfLoadCaseResult, "loadCaseResult" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicfLoadCaseResult::RicfLoadCaseResult(int caseId)
RicfLoadCaseResult::RicfLoadCaseResult( int caseId )
{
CAF_PDM_InitObject("case_result", "", "", "");
CAF_PDM_InitField(&this->caseId, "id", caseId, "", "", "", "");
CAF_PDM_InitObject( "case_result", "", "", "" );
CAF_PDM_InitField( &this->caseId, "id", caseId, "", "", "", "" );
}
CAF_PDM_SOURCE_INIT(RicfLoadCase, "loadCase");
CAF_PDM_SOURCE_INIT( RicfLoadCase, "loadCase" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RicfLoadCase::RicfLoadCase()
{
RICF_InitField(&m_path, "path", QString(), "Path to Case File", "", "", "");
RICF_InitField( &m_path, "path", QString(), "Path to Case File", "", "", "" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RicfCommandResponse RicfLoadCase::execute()
{
QString absolutePath = m_path;
QFileInfo projectPathInfo(absolutePath);
if (!projectPathInfo.exists())
QFileInfo projectPathInfo( absolutePath );
if ( !projectPathInfo.exists() )
{
QDir startDir(RiaApplication::instance()->startDir());
absolutePath = startDir.absoluteFilePath(m_path);
QDir startDir( RiaApplication::instance()->startDir() );
absolutePath = startDir.absoluteFilePath( m_path );
}
RiaImportEclipseCaseTools::FileCaseIdMap fileCaseIdMap;
bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile(QStringList({absolutePath}), &fileCaseIdMap, true);
if (!ok)
bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile( QStringList( {absolutePath} ), &fileCaseIdMap, true );
if ( !ok )
{
QString error = QString("loadCase: Unable to load case from %1").arg(absolutePath);
RiaLogging::error(error);
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
QString error = QString( "loadCase: Unable to load case from %1" ).arg( absolutePath );
RiaLogging::error( error );
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
}
CAF_ASSERT(fileCaseIdMap.size() == 1u);
CAF_ASSERT( fileCaseIdMap.size() == 1u );
RicfCommandResponse response;
response.setResult(new RicfLoadCaseResult(fileCaseIdMap.begin()->second));
response.setResult( new RicfLoadCaseResult( fileCaseIdMap.begin()->second ) );
return response;
}