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

Method documentsExclusivelyInWindow

kdevplatform/shell/documentcontroller.cpp:877–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

875}
876
877QList< IDocument * > KDevelop::DocumentController::documentsExclusivelyInWindow(MainWindow * mw, bool currentAreaOnly) const
878{
879 // Gather a list of all documents which have views only in the given main window
880 QList<IDocument*> checkSave;
881
882 const auto documents = openDocuments();
883 for (IDocument* doc : documents) {
884 if (auto* sdoc = dynamic_cast<Sublime::Document*>(doc)) {
885 bool inOtherWindow = false;
886
887 const auto views = sdoc->views();
888 for (Sublime::View* view : views) {
889 const auto windows = Core::self()->uiControllerInternal()->mainWindows();
890 for (Sublime::MainWindow* window : windows) {
891 if(window->containsView(view) && (window != mw || (currentAreaOnly && window == mw && !mw->area()->views().contains(view)))) {
892 inOtherWindow = true;
893 break;
894 }
895 }
896 if (inOtherWindow) {
897 break;
898 }
899 }
900
901 if (!inOtherWindow)
902 checkSave.append(doc);
903 }
904 }
905 return checkSave;
906}
907
908QList< IDocument * > KDevelop::DocumentController::modifiedDocuments(const QList< IDocument * > & list) const
909{

Callers

nothing calls this directly

Calls 7

mainWindowsMethod · 0.80
uiControllerInternalMethod · 0.80
containsViewMethod · 0.80
viewsMethod · 0.45
containsMethod · 0.45
areaMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected