| 253 | } |
| 254 | |
| 255 | void MainWindow::loadSettings() |
| 256 | { |
| 257 | Q_D(const MainWindow); |
| 258 | |
| 259 | if (!d->isGuiSetUp()) { |
| 260 | // UiController() invokes this->loadSettings() before UiController::initialize() invokes this->initialize(). |
| 261 | // this->initialize() invokes KXmlGuiWindow::setupGUI(), which resizes the window to its default size. |
| 262 | // Sublime::MainWindow::loadSettings() calls KXmlGuiWindow::applyMainWindowSettings(), which applies the size |
| 263 | // stored in the main window config *once*. If the size stored in config is applied before the default resizing, |
| 264 | // the window always ends up having the default size. Prevent this by returning early if the GUI is not set up |
| 265 | // (not initialized) yet. The settings are still always loaded when UiController::loadAllAreas() is invoked |
| 266 | // after this->initialize(). |
| 267 | return; |
| 268 | } |
| 269 | |
| 270 | qCDebug(SHELL) << "Loading Settings"; |
| 271 | |
| 272 | Sublime::MainWindow::loadSettings(); |
| 273 | // Sublime::MainWindow::loadSettings() invokes QMainWindow::restoreState(), which restores corner |
| 274 | // settings. Override the corner settings to make sure they match KDevelop's custom corner options. |
| 275 | loadCornerSettings(); |
| 276 | } |
| 277 | |
| 278 | void MainWindow::configureShortcuts() |
| 279 | { |