| 520 | } |
| 521 | |
| 522 | void 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 | |
| 554 | void WorkingSet::setPersistent(bool persistent) { |
| 555 | KConfigGroup setConfig(Core::self()->activeSession()->config(), QStringLiteral("Working File Sets")); |
nothing calls this directly
no test coverage detected