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();
|
defaultDir = QFileInfo( fileNames.last() ).absolutePath();
|
||||||
app->setLastUsedDialogDirectory( "INPUT_FILES", defaultDir );
|
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 )
|
void RicConvertAllFractureTemplatesToFieldFeature::onActionTriggered( bool isChecked )
|
||||||
{
|
{
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||||
if ( !pdmUiItem ) return;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
|
||||||
if ( !objHandle ) return;
|
if ( !objHandle ) return;
|
||||||
|
|
||||||
RimFractureTemplateCollection* fracTempColl = nullptr;
|
RimFractureTemplateCollection* fracTempColl = nullptr;
|
||||||
|
@ -49,14 +49,12 @@ CAF_CMD_SOURCE_INIT( RicConvertAllFractureTemplatesToMetricFeature, "RicConvertA
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicConvertAllFractureTemplatesToMetricFeature::onActionTriggered( bool isChecked )
|
void RicConvertAllFractureTemplatesToMetricFeature::onActionTriggered( bool isChecked )
|
||||||
{
|
{
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||||
if ( !pdmUiItem ) return;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
|
||||||
if ( !objHandle ) return;
|
if ( !objHandle ) return;
|
||||||
|
|
||||||
RimFractureTemplateCollection* fracTempColl = nullptr;
|
RimFractureTemplateCollection* fracTempColl = nullptr;
|
||||||
objHandle->firstAncestorOrThisOfType( fracTempColl );
|
objHandle->firstAncestorOrThisOfType( fracTempColl );
|
||||||
|
if ( !fracTempColl ) return;
|
||||||
|
|
||||||
std::vector<RimEllipseFractureTemplate*> ellipseFracTemplates;
|
std::vector<RimEllipseFractureTemplate*> ellipseFracTemplates;
|
||||||
fracTempColl->descendantsIncludingThisOfType( ellipseFracTemplates );
|
fracTempColl->descendantsIncludingThisOfType( ellipseFracTemplates );
|
||||||
|
@ -51,15 +51,11 @@ CAF_CMD_SOURCE_INIT( RicCreateDuplicateTemplateInOtherUnitSystemFeature, "RicCon
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool isChecked )
|
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool isChecked )
|
||||||
{
|
{
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||||
if ( !pdmUiItem ) return;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
|
||||||
if ( !objHandle ) return;
|
if ( !objHandle ) return;
|
||||||
|
|
||||||
RimFractureTemplate* fractureTemplate = nullptr;
|
RimFractureTemplate* fractureTemplate = nullptr;
|
||||||
objHandle->firstAncestorOrThisOfType( fractureTemplate );
|
objHandle->firstAncestorOrThisOfType( fractureTemplate );
|
||||||
|
|
||||||
if ( !fractureTemplate ) return;
|
if ( !fractureTemplate ) return;
|
||||||
|
|
||||||
RimFractureTemplateCollection* fractureTemplateCollection = nullptr;
|
RimFractureTemplateCollection* fractureTemplateCollection = nullptr;
|
||||||
@ -95,10 +91,7 @@ void RicCreateDuplicateTemplateInOtherUnitSystemFeature::onActionTriggered( bool
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::setupActionLook( QAction* actionToSetup )
|
void RicCreateDuplicateTemplateInOtherUnitSystemFeature::setupActionLook( QAction* actionToSetup )
|
||||||
{
|
{
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||||
if ( !pdmUiItem ) return;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
|
||||||
if ( !objHandle ) return;
|
if ( !objHandle ) return;
|
||||||
|
|
||||||
RimFractureTemplate* fractureTemplate = nullptr;
|
RimFractureTemplate* fractureTemplate = nullptr;
|
||||||
|
@ -139,10 +139,7 @@ bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
|
|||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
if ( proj->allFractureTemplates().empty() ) return false;
|
if ( proj->allFractureTemplates().empty() ) return false;
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||||
if ( !pdmUiItem ) return false;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
|
||||||
if ( !objHandle ) return false;
|
if ( !objHandle ) return false;
|
||||||
|
|
||||||
RimSimWellInView* eclipseWell = nullptr;
|
RimSimWellInView* eclipseWell = nullptr;
|
||||||
|
@ -54,10 +54,7 @@ void RicNewSimWellFractureFeature::onActionTriggered( bool isChecked )
|
|||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
if ( proj->allFractureTemplates().empty() ) return;
|
if ( proj->allFractureTemplates().empty() ) return;
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||||
if ( !pdmUiItem ) return;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
|
||||||
if ( !objHandle ) return;
|
if ( !objHandle ) return;
|
||||||
|
|
||||||
RimSimWellInView* eclipseWell = nullptr;
|
RimSimWellInView* eclipseWell = nullptr;
|
||||||
@ -126,10 +123,7 @@ bool RicNewSimWellFractureFeature::isCommandEnabled()
|
|||||||
RimProject* proj = RiaApplication::instance()->project();
|
RimProject* proj = RiaApplication::instance()->project();
|
||||||
if ( proj->allFractureTemplates().empty() ) return false;
|
if ( proj->allFractureTemplates().empty() ) return false;
|
||||||
|
|
||||||
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
|
auto objHandle = caf::SelectionManager::instance()->selectedItemOfType<caf::PdmObjectHandle>();
|
||||||
if ( !pdmUiItem ) return false;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
|
|
||||||
if ( !objHandle ) return false;
|
if ( !objHandle ) return false;
|
||||||
|
|
||||||
RimSimWellInView* simWell = nullptr;
|
RimSimWellInView* simWell = nullptr;
|
||||||
|
@ -483,7 +483,6 @@ bool RifCsvUserDataParser::parseColumnBasedData( const AsciiDataParseOptions& pa
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifCsvUserDataParser::parseLineBasedData()
|
bool RifCsvUserDataParser::parseLineBasedData()
|
||||||
{
|
{
|
||||||
bool errors = false;
|
|
||||||
QTextStream* dataStream = openDataStream();
|
QTextStream* dataStream = openDataStream();
|
||||||
std::map<RifEclipseSummaryAddress, std::vector<std::pair<time_t, double>>> addressesAndData;
|
std::map<RifEclipseSummaryAddress, std::vector<std::pair<time_t, double>>> addressesAndData;
|
||||||
std::vector<int> colIndexes;
|
std::vector<int> colIndexes;
|
||||||
@ -493,7 +492,7 @@ bool RifCsvUserDataParser::parseLineBasedData()
|
|||||||
bool headerFound = false;
|
bool headerFound = false;
|
||||||
bool expectErrorValue = false;
|
bool expectErrorValue = false;
|
||||||
|
|
||||||
while ( !dataStream->atEnd() && !errors )
|
while ( !dataStream->atEnd() )
|
||||||
{
|
{
|
||||||
lineCount++;
|
lineCount++;
|
||||||
|
|
||||||
@ -597,7 +596,6 @@ bool RifCsvUserDataParser::parseLineBasedData()
|
|||||||
}
|
}
|
||||||
closeDataStream();
|
closeDataStream();
|
||||||
|
|
||||||
if ( !errors )
|
|
||||||
{
|
{
|
||||||
std::vector<Column> columnInfoList;
|
std::vector<Column> columnInfoList;
|
||||||
for ( const auto& item : addressesAndData )
|
for ( const auto& item : addressesAndData )
|
||||||
@ -624,7 +622,8 @@ bool RifCsvUserDataParser::parseLineBasedData()
|
|||||||
TableData td( "", "", columnInfoList );
|
TableData td( "", "", columnInfoList );
|
||||||
m_tableData = td;
|
m_tableData = td;
|
||||||
}
|
}
|
||||||
return !errors;
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -85,11 +85,12 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
|
|||||||
{
|
{
|
||||||
QString line = stream.readLine();
|
QString line = stream.readLine();
|
||||||
QStringList commentLineSegs = line.split( "#", QString::KeepEmptyParts );
|
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 );
|
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 ( lineSegs.size() != 3 )
|
||||||
{
|
{
|
||||||
if ( errorMessage )
|
if ( errorMessage )
|
||||||
@ -97,7 +98,6 @@ void RimPolylinesFromFileAnnotation::readPolyLinesFile( QString* errorMessage )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( lineSegs.size() == 3 ) // Normal case
|
|
||||||
{
|
{
|
||||||
bool isNumberParsingOk = true;
|
bool isNumberParsingOk = true;
|
||||||
bool isOk = true;
|
bool isOk = true;
|
||||||
|
@ -926,8 +926,6 @@ QList<caf::PdmOptionItemInfo> RimWellLogTrack::calculateValueOptions( const caf:
|
|||||||
{
|
{
|
||||||
QList<caf::PdmOptionItemInfo> options;
|
QList<caf::PdmOptionItemInfo> options;
|
||||||
|
|
||||||
if ( options.size() > 0 ) return options;
|
|
||||||
|
|
||||||
if ( fieldNeedingOptions == &m_regionAnnotationType )
|
if ( fieldNeedingOptions == &m_regionAnnotationType )
|
||||||
{
|
{
|
||||||
options.push_back(
|
options.push_back(
|
||||||
|
Loading…
Reference in New Issue
Block a user