diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-06-21 12:15:55 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-06-21 12:05:11 +0000 |
commit | 7c572287a719c96bbcbd8728fbcc0f26d9e00f35 (patch) | |
tree | 4d45ac1a2836313a2db5440bd99a15b640505467 /src/plugins/coreplugin/editormanager | |
parent | 8ae890c0675e66c3d606b9c38f4b7c5c12c656fa (diff) | |
download | qt-creator-7c572287a719c96bbcbd8728fbcc0f26d9e00f35.tar.gz |
ProjectExplorer: Respect pinned documents
... in "Close All Projects and Editors".
Amends fe21a7a77e.
Change-Id: I162753e08f97cf4538bf58e5f48fd222cdb9ee2b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/editormanager')
-rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.cpp | 8 | ||||
-rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 813d12739d..f1073e6bb2 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2429,12 +2429,12 @@ void EditorManager::closeOtherDocuments(IDocument *document) closeDocuments(documentsToClose, true); } -void EditorManager::closeAllDocuments() +bool EditorManager::closeAllDocuments() { // Only close the files that aren't pinned. const QList<DocumentModel::Entry *> entriesToClose = Utils::filtered(DocumentModel::entries(), Utils::equal(&DocumentModel::Entry::pinned, false)); - EditorManager::closeDocuments(entriesToClose); + return EditorManager::closeDocuments(entriesToClose); } // SLOT connected to action @@ -2631,7 +2631,7 @@ void EditorManager::closeDocument(DocumentModel::Entry *entry) closeDocuments({entry->document}); } -void EditorManager::closeDocuments(const QList<DocumentModel::Entry *> &entries) +bool EditorManager::closeDocuments(const QList<DocumentModel::Entry *> &entries) { QList<IDocument *> documentsToClose; for (DocumentModel::Entry *entry : entries) { @@ -2642,7 +2642,7 @@ void EditorManager::closeDocuments(const QList<DocumentModel::Entry *> &entries) else documentsToClose << entry->document; } - closeDocuments(documentsToClose); + return closeDocuments(documentsToClose); } bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool askAboutModifiedEditors) diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 41429aedb1..5be379ceb2 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -128,9 +128,9 @@ public: static bool closeDocument(IDocument *document, bool askAboutModifiedEditors = true); static bool closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors = true); static void closeDocument(DocumentModel::Entry *entry); - static void closeDocuments(const QList<DocumentModel::Entry *> &entries); + static bool closeDocuments(const QList<DocumentModel::Entry *> &entries); static void closeOtherDocuments(IDocument *document); - static void closeAllDocuments(); + static bool closeAllDocuments(); static void addCurrentPositionToNavigationHistory(const QByteArray &saveState = QByteArray()); static void cutForwardNavigationHistory(); |