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

Method viewAdded

kdevplatform/sublime/mainwindow_p.cpp:423–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423void MainWindowPrivate::viewAdded(Sublime::AreaIndex *index, Sublime::View *view)
424{
425 // Remove container objects in the hierarchy from the parents,
426 // because they are not needed anymore, and might lead to broken splitter hierarchy and crashes.
427 for(Sublime::AreaIndex* current = index; current; current = current->parent())
428 {
429 QSplitter *splitter = m_indexSplitters[current];
430 if (current->isSplit() && splitter)
431 {
432 // Also update the orientation
433 splitter->setOrientation(current->orientation());
434
435 for(int w = 0; w < splitter->count(); ++w)
436 {
437 auto *container = qobject_cast<Sublime::Container*>(splitter->widget(w));
438 //we need to remove extra container before reconstruction
439 //first reparent widgets in container so that they are not deleted
440 if(container)
441 {
442 while (container->count())
443 {
444 container->widget(0)->setParent(nullptr);
445 }
446 //and then delete the container
447 delete container;
448 }
449 }
450 }
451 }
452
453 ViewCreator viewCreator(this);
454 area->walkViews(viewCreator, index);
455 emit m_mainWindow->viewAdded( view );
456
457 setBackgroundVisible(false);
458}
459
460void Sublime::MainWindowPrivate::raiseToolView(Sublime::View * view)
461{

Callers

nothing calls this directly

Calls 8

setOrientationMethod · 0.80
walkViewsMethod · 0.80
parentMethod · 0.45
isSplitMethod · 0.45
orientationMethod · 0.45
countMethod · 0.45
widgetMethod · 0.45
setParentMethod · 0.45

Tested by

no test coverage detected