From f658b5161f39ad654c87529d00fc2ad2bd9e61c7 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Thu, 19 Jan 2023 12:40:50 +0300 Subject: [PATCH] UI: Options: Fix window's position/size saving --- src/ui/form/opt/optionswindow.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ui/form/opt/optionswindow.cpp b/src/ui/form/opt/optionswindow.cpp index 3d09b955..73310e08 100644 --- a/src/ui/form/opt/optionswindow.cpp +++ b/src/ui/form/opt/optionswindow.cpp @@ -52,20 +52,24 @@ void OptionsWindow::cancelChanges() void OptionsWindow::saveWindowState() { - iniUser()->setOptWindowGeometry(m_stateWatcher->geometry()); - iniUser()->setOptWindowMaximized(m_stateWatcher->maximized()); + IniUser *iniUser = confManager()->iniUser(); - emit ctrl()->afterSaveWindowState(iniUser()); + iniUser->setOptWindowGeometry(m_stateWatcher->geometry()); + iniUser->setOptWindowMaximized(m_stateWatcher->maximized()); + + emit ctrl()->afterSaveWindowState(iniUser); confManager()->saveIniUser(); } void OptionsWindow::restoreWindowState() { - m_stateWatcher->restore(this, QSize(1024, 768), iniUser()->optWindowGeometry(), - iniUser()->optWindowMaximized()); + IniUser *iniUser = confManager()->iniUser(); - emit ctrl()->afterRestoreWindowState(iniUser()); + m_stateWatcher->restore( + this, QSize(1024, 768), iniUser->optWindowGeometry(), iniUser->optWindowMaximized()); + + emit ctrl()->afterRestoreWindowState(iniUser); } void OptionsWindow::setupController()