#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

@@ -3,17 +3,17 @@
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
//
// 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -44,51 +44,52 @@
#include <QTcpSocket>
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimEclipseCase* RiaSocketTools::findCaseFromArgs(RiaSocketServer* server, const QList<QByteArray>& args)
RimEclipseCase* RiaSocketTools::findCaseFromArgs( RiaSocketServer* server, const QList<QByteArray>& args )
{
RimEclipseCase* rimCase = nullptr;
int caseId = -1;
int caseId = -1;
if (args.size() > 1)
if ( args.size() > 1 )
{
caseId = args[1].toInt();
}
rimCase = server->findReservoir(caseId);
rimCase = server->findReservoir( caseId );
if (rimCase == nullptr)
if ( rimCase == nullptr )
{
// TODO: Display error message a different place to avoid socket comm to be halted.
//server->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find the Case with CaseId : \"%1\"").arg(caseId));
// server->showMessage(RiaSocketServer::tr("ResInsight SocketServer: \n") + RiaSocketServer::tr("Could not find
// the Case with CaseId : \"%1\"").arg(caseId));
}
return rimCase;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaSocketTools::getCaseInfoFromCase(RimCase* rimCase, qint64& caseId, QString& caseName, QString& caseType, qint64& caseGroupId)
void RiaSocketTools::getCaseInfoFromCase(
RimCase* rimCase, qint64& caseId, QString& caseName, QString& caseType, qint64& caseGroupId )
{
CVF_ASSERT(rimCase);
CVF_ASSERT( rimCase );
caseId = rimCase->caseId;
caseId = rimCase->caseId;
caseName = rimCase->caseUserDescription;
RimEclipseCase* eclCase = dynamic_cast<RimEclipseCase*> (rimCase);
RimEclipseCase* eclCase = dynamic_cast<RimEclipseCase*>( rimCase );
RimCaseCollection* caseCollection = nullptr;
if (eclCase)
if ( eclCase )
{
caseCollection = eclCase->parentCaseCollection();
}
if (caseCollection)
if ( caseCollection )
{
caseGroupId = caseCollection->parentCaseGroup()->groupId;
if (RimIdenticalGridCaseGroup::isStatisticsCaseCollection(caseCollection))
if ( RimIdenticalGridCaseGroup::isStatisticsCaseCollection( caseCollection ) )
{
caseType = "StatisticsCase";
}
@@ -101,11 +102,11 @@ void RiaSocketTools::getCaseInfoFromCase(RimCase* rimCase, qint64& caseId, QStri
{
caseGroupId = -1;
if (dynamic_cast<RimEclipseInputCase*>(rimCase))
if ( dynamic_cast<RimEclipseInputCase*>( rimCase ) )
{
caseType = "InputCase";
}
else if (eclCase)
else if ( eclCase )
{
caseType = "ResultCase";
}
@@ -117,20 +118,20 @@ void RiaSocketTools::getCaseInfoFromCase(RimCase* rimCase, qint64& caseId, QStri
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RiaSocketTools::writeBlockData(RiaSocketServer* server, QTcpSocket* socket, const char* data, quint64 bytesToWrite)
bool RiaSocketTools::writeBlockData( RiaSocketServer* server, QTcpSocket* socket, const char* data, quint64 bytesToWrite )
{
cvf::Timer timer;
QStringList errorMessages;
bool writeSucceded = RiaSocketDataTransfer::writeBlockDataToSocket(socket, data, bytesToWrite, errorMessages);
bool writeSucceded = RiaSocketDataTransfer::writeBlockDataToSocket( socket, data, bytesToWrite, errorMessages );
if (server)
if ( server )
{
for (int i = 0; i < errorMessages.size(); i++)
for ( int i = 0; i < errorMessages.size(); i++ )
{
server->showErrorMessage(errorMessages[i]);
server->showErrorMessage( errorMessages[i] );
}
}