From dab23164dff097fcafaf44c3a781af85e86f0730 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 26 Oct 2017 08:07:53 +0200 Subject: [PATCH] Summary Plot : Do not create object editor in command feature constructor --- .../RicEditSummaryPlotFeature.cpp | 9 ++++----- .../SummaryPlotCommands/RicEditSummaryPlotFeature.h | 9 --------- .../SummaryPlotCommands/RicNewSummaryPlotFeature.cpp | 12 ++---------- .../SummaryPlotCommands/RicNewSummaryPlotFeature.h | 5 ----- 4 files changed, 6 insertions(+), 29 deletions(-) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.cpp index ae107614f3..9619a74585 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.cpp @@ -41,7 +41,6 @@ CAF_CMD_SOURCE_INIT(RicEditSummaryPlotFeature, "RicEditSummaryPlotFeature"); //-------------------------------------------------------------------------------------------------- RicEditSummaryPlotFeature::RicEditSummaryPlotFeature() { - m_curveCreatorFactory = RicSummaryCurveCreatorFactoryImpl::instance(); } //-------------------------------------------------------------------------------------------------- @@ -49,8 +48,8 @@ RicEditSummaryPlotFeature::RicEditSummaryPlotFeature() //-------------------------------------------------------------------------------------------------- void RicEditSummaryPlotFeature::closeDialogAndResetTargetPlot() { - auto dialog = m_curveCreatorFactory->dialog(); - auto curveCreator = m_curveCreatorFactory->curveCreator(); + auto dialog = RicSummaryCurveCreatorFactoryImpl::instance()->dialog(); + auto curveCreator = RicSummaryCurveCreatorFactoryImpl::instance()->curveCreator(); if (dialog && dialog->isVisible()) { @@ -81,8 +80,8 @@ void RicEditSummaryPlotFeature::onActionTriggered(bool isChecked) RimProject* project = RiaApplication::instance()->project(); CVF_ASSERT(project); - auto dialog = m_curveCreatorFactory->dialog(); - auto curveCreator = m_curveCreatorFactory->curveCreator(); + auto dialog = RicSummaryCurveCreatorFactoryImpl::instance()->dialog(); + auto curveCreator = RicSummaryCurveCreatorFactoryImpl::instance()->curveCreator(); if (!dialog->isVisible()) { diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.h b/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.h index 9f6259bf7b..038df721bf 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.h +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicEditSummaryPlotFeature.h @@ -19,15 +19,9 @@ #pragma once #include "cafCmdFeature.h" -#include -class RicSummaryCurveCreatorFactoryImpl; class RimSummaryPlot; -namespace caf { - class PdmUiPropertyViewDialog; -} - //================================================================================================== /// //================================================================================================== @@ -47,7 +41,4 @@ protected: private: RimSummaryPlot* selectedSummaryPlot() const; - -private: - RicSummaryCurveCreatorFactoryImpl* m_curveCreatorFactory; }; diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.cpp index 3c49c7c9e9..3b4f87279c 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.cpp @@ -38,14 +38,6 @@ CAF_CMD_SOURCE_INIT(RicNewSummaryPlotFeature, "RicNewSummaryPlotFeature"); -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RicNewSummaryPlotFeature::RicNewSummaryPlotFeature() -{ - m_curveCreatorFactory = RicSummaryCurveCreatorFactoryImpl::instance(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -62,8 +54,8 @@ void RicNewSummaryPlotFeature::onActionTriggered(bool isChecked) RimProject* project = RiaApplication::instance()->project(); CVF_ASSERT(project); - auto dialog = m_curveCreatorFactory->dialog(); - auto curveCreator = m_curveCreatorFactory->curveCreator(); + auto dialog = RicSummaryCurveCreatorFactoryImpl::instance()->dialog(); + auto curveCreator = RicSummaryCurveCreatorFactoryImpl::instance()->curveCreator(); if (!dialog->isVisible()) { diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.h b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.h index 9f4267685e..7022798088 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.h +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicNewSummaryPlotFeature.h @@ -20,7 +20,6 @@ #include "cafCmdFeature.h" -class RicSummaryCurveCreatorFactoryImpl; class RimSummaryPlotCollection; class RimSummaryCase; class RimSummaryPlot; @@ -33,7 +32,6 @@ class RicNewSummaryPlotFeature : public caf::CmdFeature CAF_CMD_HEADER_INIT; public: - RicNewSummaryPlotFeature(); static RimSummaryPlot* createNewSummaryPlot(RimSummaryPlotCollection* summaryPlotColl, RimSummaryCase* summaryCase); protected: @@ -41,7 +39,4 @@ protected: virtual bool isCommandEnabled(); virtual void onActionTriggered( bool isChecked ); virtual void setupActionLook(QAction* actionToSetup); - -private: - RicSummaryCurveCreatorFactoryImpl* m_curveCreatorFactory; };