forked from qt-creator/qt-creator
Revert "Replace virtual isModified method with a getter/setter/notifier"
This doesn't fix the issue with cleaning the clear state of undo stack. This introduced the issue when ui file is opened it's marked as modified. It reverts59c90e00c1andd0c537ca75Change-Id: Ifd4ff8483d6c297461632de500a4502b1fd0871f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -59,9 +59,6 @@ FormWindowFile::FormWindowFile(QDesignerFormWindowInterface *form, QObject *pare
|
||||
connect(m_formWindow->commandHistory(), &QUndoStack::indexChanged,
|
||||
this, &FormWindowFile::setShouldAutoSave);
|
||||
connect(m_formWindow.data(), &QDesignerFormWindowInterface::changed, this, &FormWindowFile::updateIsModified);
|
||||
connect(this, &IDocument::modificationChanged, m_formWindow.data(), &QDesignerFormWindowInterface::setDirty);
|
||||
|
||||
setModified(m_formWindow->isDirty());
|
||||
|
||||
m_resourceHandler = new ResourceHandler(form);
|
||||
connect(this, &FormWindowFile::filePathChanged,
|
||||
@@ -189,7 +186,10 @@ void FormWindowFile::updateIsModified()
|
||||
bool value = m_formWindow && m_formWindow->isDirty();
|
||||
if (value)
|
||||
emit contentsChanged();
|
||||
setModified(value);
|
||||
if (value == m_isModified)
|
||||
return;
|
||||
m_isModified = value;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
bool FormWindowFile::shouldAutoSave() const
|
||||
@@ -197,6 +197,11 @@ bool FormWindowFile::shouldAutoSave() const
|
||||
return m_shouldAutoSave;
|
||||
}
|
||||
|
||||
bool FormWindowFile::isModified() const
|
||||
{
|
||||
return m_formWindow && m_formWindow->isDirty();
|
||||
}
|
||||
|
||||
bool FormWindowFile::isSaveAsAllowed() const
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user