| 939 | } |
| 940 | |
| 941 | bool DocumentController::closeAllDocuments() |
| 942 | { |
| 943 | if (Sublime::MainWindow* mw = Core::self()->uiControllerInternal()->activeSublimeWindow()) { |
| 944 | const QList<IDocument*> views = visibleDocumentsInWindow(qobject_cast<KDevelop::MainWindow*>(mw)); |
| 945 | |
| 946 | if (!saveSomeDocuments(views, SaveSelectionMode::LetUserSelect)) |
| 947 | // User cancelled or other error |
| 948 | return false; |
| 949 | |
| 950 | for (IDocument* doc : views) { |
| 951 | doc->close(IDocument::Discard); |
| 952 | } |
| 953 | } |
| 954 | return true; |
| 955 | } |
| 956 | |
| 957 | void DocumentController::closeAllOtherDocuments() |
| 958 | { |