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

Method areaViewRemoved

kdevplatform/shell/workingsets/workingset.cpp:522–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522void WorkingSet::areaViewRemoved(Sublime::AreaIndex*, Sublime::View* view) {
523 auto* area = qobject_cast<Sublime::Area*>(sender());
524 Q_ASSERT(area);
525 Q_ASSERT(area->workingSet() == m_id);
526
527 qCDebug(WORKINGSET) << "removed view in" << area << ", id" << m_id;
528 if (m_loading) {
529 qCDebug(WORKINGSET) << "doing nothing because loading";
530 return;
531 }
532
533 const auto areasBefore = m_areas; // TODO: check if areas could be changed, otherwise use m_areas directly
534 for (Sublime::Area* otherArea : areasBefore) {
535 if(otherArea == area)
536 continue;
537 const auto otherAreaViews = otherArea->views();
538 bool hadDocument = std::any_of(otherAreaViews.begin(), otherAreaViews.end(), [&](Sublime::View* otherView) {
539 return (view->document() == otherView->document());
540 });
541
542 if(!hadDocument)
543 {
544 // We do this to prevent UI flicker. The view has already been removed from
545 // one of the connected areas, so the working-set has already recorded the change.
546 return;
547 }
548
549 }
550
551 changed(area);
552}
553
554void WorkingSet::setPersistent(bool persistent) {
555 KConfigGroup setConfig(Core::self()->activeSession()->config(), QStringLiteral("Working File Sets"));

Callers

nothing calls this directly

Calls 5

workingSetMethod · 0.45
viewsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
documentMethod · 0.45

Tested by

no test coverage detected