forked from qt-creator/qt-creator
ModelEditor: Support auto save
Change-Id: Ifec4cf592c3fbc8cef6f6df13865a35f3e17f531 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -93,7 +93,9 @@ bool ModelDocument::save(QString *errorString, const QString &name, bool autoSav
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!autoSave) {
|
||||
if (autoSave) {
|
||||
d->documentController->projectController()->setModified();
|
||||
} else {
|
||||
setFilePath(Utils::FileName::fromString(d->documentController->projectController()->project()->fileName()));
|
||||
emit changed();
|
||||
}
|
||||
@@ -101,6 +103,11 @@ bool ModelDocument::save(QString *errorString, const QString &name, bool autoSav
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ModelDocument::shouldAutoSave() const
|
||||
{
|
||||
return isModified();
|
||||
}
|
||||
|
||||
bool ModelDocument::isModified() const
|
||||
{
|
||||
return d->documentController ? d->documentController->projectController()->isModified() : false;
|
||||
|
||||
Reference in New Issue
Block a user