From 16454e13ebc788173217eadcd3d04c56319b2766 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 24 Aug 2023 09:59:34 +0200 Subject: [PATCH] Core: Allow saving documents without filename In case a document does not yet have a filename, simply fall back to save as Change-Id: I3cb30ab39e30ecba5c720d4b7d4c955f9dd4609f Reviewed-by: David Schulz --- src/plugins/coreplugin/editormanager/editormanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index c102d75fa43..44e5f18ef35 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1916,7 +1916,7 @@ void EditorManagerPrivate::setupSaveActions(IDocument *document, QAction *saveAc QAction *saveAsAction, QAction *revertToSavedAction) { const bool hasFile = document && !document->filePath().isEmpty(); - saveAction->setEnabled(hasFile && document->isModified()); + saveAction->setEnabled(document && (document->isModified() || !hasFile)); saveAsAction->setEnabled(document && document->isSaveAsAllowed()); revertToSavedAction->setEnabled(hasFile);