mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fixes detected by cppcheck (#4974)
* Janitor : Remove obsolete pointer to dialog * Janitor : Remove unused functions * Janitor : Remove unused functions * Janitor : Add explicit to constructors * Janitor : Remove unused variables * Janitor : Remove unused functions related to summary plot templates * clang-tidy : Use nullptr instead of 0 * clang-tidy : Fix usage of virtual and override * Upped to version 2019.08.2-dev.05 * Janitor : Remove unused variables * Janitor : Clean up several cppcheck issues * Janitor : Add cppcheck config files * Janitor : Use const when possible
This commit is contained in:
@@ -51,7 +51,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool isValid() const override
|
||||
bool isValid() const override
|
||||
{
|
||||
return m_summaryPlot.notNull();
|
||||
}
|
||||
@@ -132,30 +132,30 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool isValid() const override
|
||||
bool isValid() const override
|
||||
{
|
||||
return m_crossPlot.notNull();
|
||||
}
|
||||
|
||||
virtual QString description() const override
|
||||
QString description() const override
|
||||
{
|
||||
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
|
||||
return m_crossPlot->createAutoName();
|
||||
}
|
||||
|
||||
virtual QString tabTitle( int tabIndex ) const override
|
||||
QString tabTitle( int tabIndex ) const override
|
||||
{
|
||||
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
|
||||
return m_crossPlot->asciiTitleForPlotExport( tabIndex );
|
||||
}
|
||||
|
||||
virtual QString tabText( int tabIndex ) const override
|
||||
QString tabText( int tabIndex ) const override
|
||||
{
|
||||
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
|
||||
return m_crossPlot->asciiDataForGridCrossPlotExport( tabIndex );
|
||||
}
|
||||
|
||||
virtual int tabCount() const override
|
||||
int tabCount() const override
|
||||
{
|
||||
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
|
||||
return (int)m_crossPlot->dataSets().size();
|
||||
|
||||
@@ -53,10 +53,7 @@ void RicExportFishbonesLateralsFeature::onActionTriggered( bool isChecked )
|
||||
fishbonesCollection->firstAncestorOrThisOfType( wellPath );
|
||||
CVF_ASSERT( wellPath );
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
QString defaultDir = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_PATH_EXPORT_DIR" );
|
||||
auto fileName = caf::Utils::makeValidFileBasename( wellPath->name() ) + "_laterals.dev";
|
||||
auto fileName = caf::Utils::makeValidFileBasename( wellPath->name() ) + "_laterals.dev";
|
||||
|
||||
auto dialogData = EXP::openDialog();
|
||||
if ( dialogData )
|
||||
|
||||
@@ -615,7 +615,7 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigCompletionData>
|
||||
RicWellPathExportCompletionDataFeatureImpl::mainGridCompletions( std::vector<RigCompletionData>& allCompletions )
|
||||
RicWellPathExportCompletionDataFeatureImpl::mainGridCompletions( const std::vector<RigCompletionData>& allCompletions )
|
||||
{
|
||||
std::vector<RigCompletionData> completions;
|
||||
|
||||
@@ -634,7 +634,7 @@ std::vector<RigCompletionData>
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<QString, std::vector<RigCompletionData>>
|
||||
RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions( std::vector<RigCompletionData>& allCompletions )
|
||||
RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions( const std::vector<RigCompletionData>& allCompletions )
|
||||
{
|
||||
std::map<QString, std::vector<RigCompletionData>> completions;
|
||||
|
||||
@@ -873,7 +873,7 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
|
||||
RimEclipseCase* eclipseCase,
|
||||
const QString& folderName,
|
||||
const QString& fileName,
|
||||
std::vector<RigCompletionData>& completions,
|
||||
const std::vector<RigCompletionData>& completions,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType )
|
||||
{
|
||||
|
||||
@@ -158,10 +158,10 @@ private:
|
||||
static RigCompletionData combineEclipseCellCompletions( const std::vector<RigCompletionData>& completions,
|
||||
const RicExportCompletionDataSettingsUi& settings );
|
||||
|
||||
static std::vector<RigCompletionData> mainGridCompletions( std::vector<RigCompletionData>& allCompletions );
|
||||
static std::vector<RigCompletionData> mainGridCompletions( const std::vector<RigCompletionData>& allCompletions );
|
||||
|
||||
static std::map<QString, std::vector<RigCompletionData>>
|
||||
subGridsCompletions( std::vector<RigCompletionData>& allCompletions );
|
||||
subGridsCompletions( const std::vector<RigCompletionData>& allCompletions );
|
||||
|
||||
static void
|
||||
exportWellPathFractureReport( RimEclipseCase* sourceCase,
|
||||
@@ -180,7 +180,7 @@ private:
|
||||
sortAndExportCompletionsToFile( RimEclipseCase* eclipseCase,
|
||||
const QString& exportFolder,
|
||||
const QString& fileName,
|
||||
std::vector<RigCompletionData>& completions,
|
||||
const std::vector<RigCompletionData>& completions,
|
||||
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
|
||||
RicExportCompletionDataSettingsUi::CompdatExportType exportType );
|
||||
|
||||
|
||||
@@ -205,9 +205,6 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
|
||||
auto task = progress.task( "Export Faults", faultsProgressPercentage );
|
||||
if ( exportSettings.exportFaults == RicExportEclipseSectorModelUi::EXPORT_TO_SEPARATE_FILE_PER_RESULT )
|
||||
{
|
||||
QFileInfo info( exportSettings.exportGridFilename() );
|
||||
QDir dirPath = info.absoluteDir();
|
||||
|
||||
for ( auto faultInView : view->faultCollection()->faults() )
|
||||
{
|
||||
auto rigFault = faultInView->faultGeometry();
|
||||
|
||||
@@ -162,8 +162,6 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
|
||||
RicExportFeatureImpl::configureForExport( propertyDialog.dialogButtonBox() );
|
||||
propertyDialog.resize( QSize( 400, 330 ) );
|
||||
|
||||
std::vector<QString> writtenFiles;
|
||||
|
||||
if ( propertyDialog.exec() == QDialog::Accepted && !featureUi.exportFolder().isEmpty() )
|
||||
{
|
||||
double resampleInterval = 0.0;
|
||||
|
||||
@@ -152,21 +152,13 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateMultipleFracturesFeature::slotClose()
|
||||
{
|
||||
if ( m_dialog )
|
||||
{
|
||||
m_dialog->close();
|
||||
}
|
||||
}
|
||||
void RicCreateMultipleFracturesFeature::slotClose() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateMultipleFracturesFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
m_dialog = nullptr;
|
||||
|
||||
RiuCreateMultipleFractionsUi* multipleFractionsUi = this->multipleFractionsUi();
|
||||
if ( multipleFractionsUi )
|
||||
{
|
||||
@@ -217,8 +209,7 @@ void RicCreateMultipleFracturesFeature::onActionTriggered( bool isChecked )
|
||||
"Create Multiple Fractures",
|
||||
"" );
|
||||
|
||||
m_dialog = &propertyDialog;
|
||||
multipleFractionsUi->setParentDialog( m_dialog );
|
||||
multipleFractionsUi->setParentDialog( &propertyDialog );
|
||||
|
||||
propertyDialog.resize( QSize( 700, 450 ) );
|
||||
|
||||
@@ -246,7 +237,7 @@ void RicCreateMultipleFracturesFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
{
|
||||
QPushButton* pushButton = dialogButtonBox->addButton( "Close", QDialogButtonBox::ActionRole );
|
||||
connect( pushButton, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
|
||||
connect( pushButton, SIGNAL( clicked() ), &propertyDialog, SLOT( close() ) );
|
||||
pushButton->setDefault( false );
|
||||
pushButton->setAutoDefault( false );
|
||||
}
|
||||
|
||||
@@ -61,6 +61,5 @@ private:
|
||||
RiuCreateMultipleFractionsUi* multipleFractionsUi() const;
|
||||
|
||||
private:
|
||||
QPointer<caf::PdmUiPropertyViewDialog> m_dialog;
|
||||
QString m_copyOfObject;
|
||||
QString m_copyOfObject;
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ class RicGridStatisticsDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RicGridStatisticsDialog( QWidget* parent );
|
||||
explicit RicGridStatisticsDialog( QWidget* parent );
|
||||
~RicGridStatisticsDialog() override;
|
||||
|
||||
void setLabel( const QString& labelText );
|
||||
|
||||
@@ -557,7 +557,6 @@ void RicRecursiveFileSearchDialog::slotFilterChanged( const QString& text )
|
||||
void RicRecursiveFileSearchDialog::slotFileListCustomMenuRequested( const QPoint& point )
|
||||
{
|
||||
QMenu menu;
|
||||
QPoint globalPoint = point;
|
||||
QAction* action;
|
||||
|
||||
action = new QAction( QIcon( ":/Copy.png" ), "&Copy", this );
|
||||
@@ -577,7 +576,7 @@ void RicRecursiveFileSearchDialog::slotFileListCustomMenuRequested( const QPoint
|
||||
connect( action, SIGNAL( triggered() ), SLOT( slotToggleFileListItems() ) );
|
||||
menu.addAction( action );
|
||||
|
||||
globalPoint = m_fileListWidget->mapToGlobal( point );
|
||||
QPoint globalPoint = m_fileListWidget->mapToGlobal( point );
|
||||
menu.exec( globalPoint );
|
||||
}
|
||||
|
||||
|
||||
@@ -611,7 +611,6 @@ void RicSummaryCaseRestartDialog::slotDialogButtonClicked( QAbstractButton* butt
|
||||
void RicSummaryCaseRestartDialog::slotFileNameCopyCustomMenuRequested( const QPoint& point )
|
||||
{
|
||||
QMenu menu;
|
||||
QPoint globalPoint = point;
|
||||
QAction* action;
|
||||
|
||||
QLabel* sourceLabel = dynamic_cast<QLabel*>( sender() );
|
||||
@@ -621,7 +620,7 @@ void RicSummaryCaseRestartDialog::slotFileNameCopyCustomMenuRequested( const QPo
|
||||
connect( action, SIGNAL( triggered() ), SLOT( slotCopyFileNameToClipboard() ) );
|
||||
menu.addAction( action );
|
||||
|
||||
globalPoint = sourceLabel->mapToGlobal( point );
|
||||
QPoint globalPoint = sourceLabel->mapToGlobal( point );
|
||||
menu.exec( globalPoint );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user