From 4a1a2fe2bed5352eb0769aa87b8d74a810d379ad Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 20 May 2022 15:07:48 +0200 Subject: [PATCH] #8634 Improve performance when deleting multiple wells Disable general framework delete function, and use special well path delete function --- .../WellPathCommands/RicDeleteWellPathFeature.cpp | 1 + .../ProjectDataModel/WellPath/RimWellPath.cpp | 9 +++++++++ .../ProjectDataModel/WellPath/RimWellPath.h | 1 + 3 files changed, 11 insertions(+) diff --git a/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp b/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp index 8adc133bd0..dce970d968 100644 --- a/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp +++ b/ApplicationLibCode/Commands/WellPathCommands/RicDeleteWellPathFeature.cpp @@ -72,4 +72,5 @@ void RicDeleteWellPathFeature::setupActionLook( QAction* actionToSetup ) { actionToSetup->setText( "Delete Well Path" ); actionToSetup->setIcon( QIcon( ":/Erase.svg" ) ); + actionToSetup->setShortcut( Qt::Key_Delete ); } diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp index b6844825ca..5bf5f44f50 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp @@ -76,6 +76,15 @@ CAF_PDM_SOURCE_INIT( RimWellPath, "WellPathBase" ); //-------------------------------------------------------------------------------------------------- const char RimWellPath::SIM_WELL_NONE_UI_TEXT[] = "None"; +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimWellPath::isDeletable() const +{ + // Avoid framework functions, as delete is implemented in RicDeleteWellPathFeature + return false; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h index 0cd051badd..07e7ee2c45 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.h @@ -175,6 +175,7 @@ protected: caf::PdmFieldHandle* userDescriptionField() override; caf::PdmFieldHandle* objectToggleField() override; + bool isDeletable() const override; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,