From 7bb49b58df0431e8c4a65319a58e713c58957647 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 11 Aug 2023 14:41:14 +0200 Subject: Core: fix IDocuments aboutToSave and saved filePath The function emiting those signals can be called with an empty file path. Use the document file path in this case like in TextDocument::saveImpl. Change-Id: I9e3381999a25c49df1d5db060ef5467b12220ad4 Reviewed-by: Christian Kandeler --- src/plugins/coreplugin/idocument.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/idocument.cpp b/src/plugins/coreplugin/idocument.cpp index 5dcff9d3fc..7be7e41011 100644 --- a/src/plugins/coreplugin/idocument.cpp +++ b/src/plugins/coreplugin/idocument.cpp @@ -343,10 +343,10 @@ IDocument::OpenResult IDocument::open(QString *errorString, const Utils::FilePat */ bool IDocument::save(QString *errorString, const Utils::FilePath &filePath, bool autoSave) { - emit aboutToSave(filePath, autoSave); + emit aboutToSave(filePath.isEmpty() ? this->filePath() : filePath, autoSave); const bool success = saveImpl(errorString, filePath, autoSave); if (success) - emit saved(filePath, autoSave); + emit saved(filePath.isEmpty() ? this->filePath() : filePath, autoSave); return success; } -- cgit v1.2.3