| 875 | } |
| 876 | |
| 877 | QList< 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 | |
| 908 | QList< IDocument * > KDevelop::DocumentController::modifiedDocuments(const QList< IDocument * > & list) const |
| 909 | { |
nothing calls this directly
no test coverage detected