| 329 | } |
| 330 | |
| 331 | void MainWindow::loadSettings() |
| 332 | { |
| 333 | Q_D(MainWindow); |
| 334 | |
| 335 | qCDebug(SUBLIME) << "loading settings for" << (area() ? area()->objectName() : QString()); |
| 336 | |
| 337 | const auto groupName = configGroupName(d->area); |
| 338 | setStateConfigGroup(groupName); |
| 339 | const KConfigGroup cg(KSharedConfig::openConfig(), groupName); |
| 340 | |
| 341 | applyMainWindowSettings(cg); |
| 342 | |
| 343 | //debugToolBar visibility is stored separately to allow a area dependent default value |
| 344 | const auto toolBars = this->toolBars(); |
| 345 | for (KToolBar* toolbar : toolBars) { |
| 346 | if (toolbar->objectName() == QLatin1String("debugToolBar")) { |
| 347 | bool visibility = cg.readEntry("debugToolBarVisibility", area()->objectName() == QLatin1String("debug")); |
| 348 | toolbar->setVisible(visibility); |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | d->idealController->loadButtonOrderSettings(cg); |
| 353 | |
| 354 | // applyMainWindowSettings() restores the main window state, including the visibility of ideal toolbars, |
| 355 | // from config. So the visibility of ideal toolbars may no longer match their emptiness. This can happen if |
| 356 | // the main window state is out of sync with Sublime::Area's "desired views" config or if some plugin with a |
| 357 | // tool view is loaded now but was not loaded during the previous KDevelop run (or vice versa) for some reason. |
| 358 | // Update ideal toolbar visibility to avoid showing an empty toolbar or not showing a nonempty one. |
| 359 | d->idealController->updateToolBarVisibility(); |
| 360 | |
| 361 | if (isVisible()) { |
| 362 | d->adaptToDockWidgetVisibilities(); |
| 363 | } else { |
| 364 | d->waitingToAdaptToDockWidgetVisibilities = true; |
| 365 | } |
| 366 | |
| 367 | d->disableConcentrationMode(); |
| 368 | } |
| 369 | |
| 370 | void MainWindow::showEvent(QShowEvent* event) |
| 371 | { |
nothing calls this directly
no test coverage detected