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.
This commit is contained in:
Magne Sjaastad 2023-10-12 15:08:16 +02:00
parent 3b372109ec
commit 55cafc64c3

View File

@ -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<RiuPlotMainWindow>();
m_mainPlotWindow->setWindowTitle( "Plots - ResInsight" );