forked from qt-creator/qt-creator
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 <christian.kandeler@qt.io>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user