mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor : Remove invalid conditionals
This commit is contained in:
parent
4ff56c7751
commit
93f6bc8c72
@ -72,10 +72,7 @@ void RicAddEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
|
||||
defaultDir = QFileInfo( fileNames.last() ).absolutePath();
|
||||
app->setLastUsedDialogDirectory( "INPUT_FILES", defaultDir );
|
||||
|
||||
if ( inputPropertyCollection )
|
||||
{
|
||||
addEclipseInputProperty( fileNames, inputPropertyCollection );
|
||||
}
|
||||
addEclipseInputProperty( fileNames, inputPropertyCollection );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,10 +49,7 @@ CAF_CMD_SOURCE_INIT( RicConvertAllFractureTemplatesToFieldFeature, "RicConvertAl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicConvertAllFractureTemplatesToFieldFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if ( !pdmUiItem ) return;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
||||
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||
if ( !objHandle ) return;
|
||||
|
||||
RimFractureTemplateCollection* fracTempColl = nullptr;
|
||||
|
@ -49,14 +49,12 @@ CAF_CMD_SOURCE_INIT( RicConvertAllFractureTemplatesToMetricFeature, "RicConvertA
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicConvertAllFractureTemplatesToMetricFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if ( !pdmUiItem ) return;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
||||
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||
if ( !objHandle ) return;
|
||||
|
||||
RimFractureTemplateCollection* fracTempColl = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType( fracTempColl );
|
||||
if ( !fracTempColl ) return;
|
||||
|
||||
std::vector<RimEllipseFractureTemplate*> ellipseFracTemplates;
|
||||
fracTempColl->descendantsIncludingThisOfType( ellipseFracTemplates );
|
||||
|
@ -51,15 +51,11 @@ CAF_CMD_SOURCE_INIT( RicCreateDuplicateTemplateInOtherUnitSystemFeature, "RicCon
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if ( !pdmUiItem ) return;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
||||
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||
if ( !objHandle ) return;
|
||||
|
||||
RimFractureTemplate* fractureTemplate = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType( fractureTemplate );
|
||||
|
||||
if ( !fractureTemplate ) return;
|
||||
|
||||
RimFractureTemplateCollection* fractureTemplateCollection = nullptr;
|
||||
@ -95,10 +91,7 @@ void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if ( !pdmUiItem ) return;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
||||
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||
if ( !objHandle ) return;
|
||||
|
||||
RimFractureTemplate* fractureTemplate = nullptr;
|
||||
|
@ -139,10 +139,7 @@ bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if ( proj->allFractureTemplates().empty() ) return false;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if ( !pdmUiItem ) return false;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
||||
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||
if ( !objHandle ) return false;
|
||||
|
||||
RimSimWellInView* eclipseWell = nullptr;
|
||||
|
@ -54,10 +54,7 @@ void RicNewSimWellFractureFeature::onActionTriggered( bool isChecked )
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if ( proj->allFractureTemplates().empty() ) return;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if ( !pdmUiItem ) return;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
||||
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||
if ( !objHandle ) return;
|
||||
|
||||
RimSimWellInView* eclipseWell = nullptr;
|
||||
@ -126,10 +123,7 @@ bool RicNewSimWellFractureFeature::isCommandEnabled()
|
||||
RimProject* proj = RiaApplication::instance()->project();
|
||||
if ( proj->allFractureTemplates().empty() ) return false;
|
||||
|
||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
||||
if ( !pdmUiItem ) return false;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
||||
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||
if ( !objHandle ) return false;
|
||||
|
||||
RimSimWellInView* simWell = nullptr;
|
||||
|
@ -483,7 +483,6 @@ bool RifCsvUserDataParser::parseColumnBasedData( const AsciiDataParseOptions& pa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifCsvUserDataParser::parseLineBasedData()
|
||||
{
|
||||
bool errors = false;
|
||||
QTextStream* dataStream = openDataStream();
|
||||
std::map<RifEclipseSummaryAddress, std::vector<std::pair<time_t, double>>> addressesAndData;
|
||||
std::vector<int> colIndexes;
|
||||
@ -493,7 +492,7 @@ bool RifCsvUserDataParser::parseLineBasedData()
|
||||
bool headerFound = false;
|
||||
bool expectErrorValue = false;
|
||||
|
||||
while ( !dataStream->atEnd() && !errors )
|
||||
while ( !dataStream->atEnd() )
|
||||
{
|
||||
lineCount++;
|
||||
|
||||
@ -597,7 +596,6 @@ bool RifCsvUserDataParser::parseLineBasedData()
|
||||
}
|
||||
closeDataStream();
|
||||
|
||||
if ( !errors )
|
||||
{
|
||||
std::vector<Column> columnInfoList;
|
||||
for ( const auto& item : addressesAndData )
|
||||
@ -624,7 +622,8 @@ bool RifCsvUserDataParser::parseLineBasedData()
|
||||
TableData td( "", "", columnInfoList );
|
||||
m_tableData = td;
|
||||
}
|
||||
return !errors;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -85,11 +85,12 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
|
||||
{
|
||||
QString line = stream.readLine();
|
||||
QStringList commentLineSegs = line.split( "#", QString::KeepEmptyParts );
|
||||
if ( commentLineSegs.size() == 0 ) continue; // Empty line
|
||||
if ( commentLineSegs.empty() ) continue; // Empty line
|
||||
|
||||
QStringList lineSegs = commentLineSegs[0].split( QRegExp( "\\s+" ), QString::SkipEmptyParts );
|
||||
|
||||
if ( lineSegs.size() == 0 ) continue; // No data
|
||||
if ( lineSegs.empty() ) continue; // No data
|
||||
|
||||
if ( lineSegs.size() != 3 )
|
||||
{
|
||||
if ( errorMessage )
|
||||
@ -97,7 +98,6 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( lineSegs.size() == 3 ) // Normal case
|
||||
{
|
||||
bool isNumberParsingOk = true;
|
||||
bool isOk = true;
|
||||
|
@ -926,8 +926,6 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( options.size() > 0 ) return options;
|
||||
|
||||
if ( fieldNeedingOptions == &m_regionAnnotationType )
|
||||
{
|
||||
options.push_back(
|
||||
|
Loading…
Reference in New Issue
Block a user