From 55cafc64c33c3bfd9aaa4cb01627060121b0dbc4 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 12 Oct 2023 15:08:16 +0200 Subject: [PATCH] Always enable undo/redo framework to improve performance It is possible to toggle undo/redo in Preferences. Use this setting to control display of undo/redo items in GUI (undo/redo buttons, undo stack, ..) The use of undo/redo framework will speed up several multi-object operations significantly. --- ApplicationLibCode/Application/RiaGuiApplication.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ApplicationLibCode/Application/RiaGuiApplication.cpp b/ApplicationLibCode/Application/RiaGuiApplication.cpp index f90fd2ad99..295420acbf 100644 --- a/ApplicationLibCode/Application/RiaGuiApplication.cpp +++ b/ApplicationLibCode/Application/RiaGuiApplication.cpp @@ -952,10 +952,8 @@ void RiaGuiApplication::createMainWindow() { CVF_ASSERT( m_mainWindow == nullptr ); - if ( RiaPreferences::current()->useUndoRedo() ) - { - caf::CmdExecCommandManager::instance()->enableUndoCommandSystem( true ); - } + // Always enable undo/redo framework, as multi-select operations perform significantly better with it enabled + caf::CmdExecCommandManager::instance()->enableUndoCommandSystem( true ); m_mainWindow = new RiuMainWindow; QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)"; @@ -980,10 +978,8 @@ void RiaGuiApplication::createMainPlotWindow() { CVF_ASSERT( m_mainPlotWindow == nullptr ); - if ( RiaPreferences::current()->useUndoRedo() ) - { - caf::CmdExecCommandManager::instance()->enableUndoCommandSystem( true ); - } + // Always enable undo/redo framework, as multi-select operations perform significantly better with it enabled + caf::CmdExecCommandManager::instance()->enableUndoCommandSystem( true ); m_mainPlotWindow = std::make_unique(); m_mainPlotWindow->setWindowTitle( "Plots - ResInsight" );