MCPcopy Create free account
hub / github.com/KDE/kdevelop / clearArea

Method clearArea

kdevplatform/sublime/mainwindow_p.cpp:380–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380void MainWindowPrivate::clearArea()
381{
382 qCDebug(SUBLIME) << "clearing area" << area;
383
384 //reparent tool view widgets to nullptr to prevent their deletion together with dockwidgets
385 for (View* view : std::as_const(area->toolViews())) {
386 // FIXME should we really delete here??
387 bool nonDestructive = true;
388 idealController->removeView(view, nonDestructive);
389 }
390
391 docks.clear();
392
393 //reparent all view widgets to 0 to prevent their deletion together with central
394 //widget. this reparenting is necessary when switching areas inside the same mainwindow
395 const auto views = area->views();
396 for (const auto* const view : views) {
397 if (auto* const widget = view->widget()) {
398 widget->setParent(nullptr);
399 }
400 }
401 cleanCentralWidget();
402 m_mainWindow->setActiveView(nullptr);
403 m_indexSplitters.clear();
404 area = nullptr;
405 viewContainers.clear();
406}
407
408void MainWindowPrivate::cleanCentralWidget()
409{

Callers

nothing calls this directly

Calls 6

removeViewMethod · 0.45
clearMethod · 0.45
viewsMethod · 0.45
widgetMethod · 0.45
setParentMethod · 0.45
setActiveViewMethod · 0.45

Tested by

no test coverage detected