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

Method visibleDocumentsInWindow

kdevplatform/shell/documentcontroller.cpp:856–875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856QList< IDocument * > KDevelop::DocumentController::visibleDocumentsInWindow(MainWindow * mw) const
857{
858 // Gather a list of all documents which do have a view in the given main window
859 // Does not find documents which are open in inactive areas
860 QList<IDocument*> list;
861 const auto documents = openDocuments();
862 for (IDocument* doc : documents) {
863 if (auto* sdoc = dynamic_cast<Sublime::Document*>(doc)) {
864 const auto views = sdoc->views();
865 const auto hasViewInWindow = std::any_of(views.cbegin(), views.cend(), [mw](const Sublime::View* view) {
866 const auto* const widget = view->widget();
867 return widget && widget->window() == mw;
868 });
869 if (hasViewInWindow) {
870 list.append(doc);
871 }
872 }
873 }
874 return list;
875}
876
877QList< IDocument * > KDevelop::DocumentController::documentsExclusivelyInWindow(MainWindow * mw, bool currentAreaOnly) const
878{

Callers

nothing calls this directly

Calls 4

windowMethod · 0.80
viewsMethod · 0.45
widgetMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected