aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2023-08-11 14:41:14 +0200
committerDavid Schulz <david.schulz@qt.io>2023-08-11 14:08:04 +0000
commit7bb49b58df0431e8c4a65319a58e713c58957647 (patch)
tree774cfa27f63d3a5bcd464177ff83debde3906855
parent28754ba08a63eca4b836c7b11892444aeeff5c88 (diff)
Core: fix IDocuments aboutToSave and saved filePathv11.0.2
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 <christian.kandeler@qt.io>
-rw-r--r--src/plugins/coreplugin/idocument.cpp4
1 files 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;
}