forked from qt-creator/qt-creator
Core: add aboutToSave and saved signal to IDocument
We need reliable signals that gets emitted when documents are saved to inform the language server about the document state change. Change-Id: I0a1e8a5317ae6984ff17d878952c74f69765e3f9 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -213,17 +213,6 @@ public:
|
||||
return type == TypeRemoved ? BehaviorSilent : IDocument::reloadBehavior(state, type);
|
||||
}
|
||||
|
||||
bool save(QString *errorString, const Utils::FilePath &filePath, bool autoSave) override
|
||||
{
|
||||
QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive
|
||||
const FilePath &fileNameToUse = filePath.isEmpty() ? this->filePath() : filePath;
|
||||
if (m_widget->save(errorString, this->filePath(), fileNameToUse)) {
|
||||
setFilePath(fileNameToUse);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
OpenResult open(QString *errorString, const FilePath &filePath,
|
||||
const FilePath &realFilePath) override
|
||||
{
|
||||
@@ -316,6 +305,18 @@ public:
|
||||
return success;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool saveImpl(QString *errorString, const Utils::FilePath &filePath, bool autoSave) override
|
||||
{
|
||||
QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive
|
||||
const FilePath &fileNameToUse = filePath.isEmpty() ? this->filePath() : filePath;
|
||||
if (m_widget->save(errorString, this->filePath(), fileNameToUse)) {
|
||||
setFilePath(fileNameToUse);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
BinEditorWidget *m_widget;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user