forked from qt-creator/qt-creator
Designer: Fix displaying of 'modified' state after saving.
Emit an IEditor::changed() after saving to force an update of the OpenEditorsModel.
This commit is contained in:
@@ -81,6 +81,8 @@ FormWindowEditor::FormWindowEditor(Internal::DesignerXmlEditor *editor,
|
||||
connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
// Revert to saved/load externally modified files
|
||||
connect(&(d->m_file), SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
|
||||
// Force update of open editors model.
|
||||
connect(&(d->m_file), SIGNAL(saved()), this, SIGNAL(changed()));
|
||||
}
|
||||
|
||||
FormWindowEditor::~FormWindowEditor()
|
||||
|
||||
@@ -83,6 +83,7 @@ bool FormWindowFile::save(const QString &name /*= QString()*/)
|
||||
emit setDisplayName(fi.fileName());
|
||||
m_formWindow->setDirty(false);
|
||||
emit changed();
|
||||
emit saved();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,14 +50,14 @@ public:
|
||||
explicit FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent = 0);
|
||||
|
||||
// IFile
|
||||
bool save(const QString &fileName = QString());
|
||||
QString fileName() const;
|
||||
bool isModified() const;
|
||||
bool isReadOnly() const;
|
||||
bool isSaveAsAllowed() const;
|
||||
void modified(Core::IFile::ReloadBehavior *behavior);
|
||||
QString defaultPath() const;
|
||||
QString suggestedFileName() const;
|
||||
virtual bool save(const QString &fileName = QString());
|
||||
virtual QString fileName() const;
|
||||
virtual bool isModified() const;
|
||||
virtual bool isReadOnly() const;
|
||||
virtual bool isSaveAsAllowed() const;
|
||||
virtual void modified(Core::IFile::ReloadBehavior *behavior);
|
||||
virtual QString defaultPath() const;
|
||||
virtual QString suggestedFileName() const;
|
||||
virtual QString mimeType() const;
|
||||
|
||||
// Internal
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
|
||||
signals:
|
||||
// Internal
|
||||
void saved();
|
||||
void reload(const QString &);
|
||||
void setDisplayName(const QString &);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user