| 614 | } |
| 615 | |
| 616 | bool MainWindow::viewsInSameSplitView(KTextEditor::View *kteView1, KTextEditor::View *kteView2) const |
| 617 | { |
| 618 | if (!kteView1 || !kteView2) { |
| 619 | return false; |
| 620 | } |
| 621 | if (kteView1 == kteView2) { |
| 622 | return true; |
| 623 | } |
| 624 | |
| 625 | bool view1Found = false; |
| 626 | bool view2Found = false; |
| 627 | const auto containers = m_mainWindow->containers(); |
| 628 | for (const auto* container : containers) { |
| 629 | const auto views = container->views(); |
| 630 | for (auto* view : views) { |
| 631 | const KTextEditor::View *kteView = toKteView(view); |
| 632 | if (kteView == kteView1) { |
| 633 | view1Found = true; |
| 634 | } else if (kteView == kteView2) { |
| 635 | view2Found = true; |
| 636 | } |
| 637 | |
| 638 | if (view1Found && view2Found) { |
| 639 | // both views found in the same container |
| 640 | return true; |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | if (view1Found != view2Found) { |
| 645 | // only one view being found implies that the other is in a different container |
| 646 | return false; |
| 647 | } |
| 648 | } |
| 649 | |
| 650 | return false; |
| 651 | } |
| 652 | |
| 653 | QObject *MainWindow::pluginView(const QString &id) const |
| 654 | { |
nothing calls this directly
no test coverage detected