summaryrefslogtreecommitdiff
path: root/src/plugins/designer/formwindoweditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/designer/formwindoweditor.cpp')
-rw-r--r--src/plugins/designer/formwindoweditor.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp
index 1c865fa4c4..b7de0a3c06 100644
--- a/src/plugins/designer/formwindoweditor.cpp
+++ b/src/plugins/designer/formwindoweditor.cpp
@@ -72,12 +72,8 @@ FormWindowEditor::FormWindowEditor(Internal::DesignerXmlEditor *editor,
Designer::Constants::C_DESIGNER_XML_EDITOR));
setWidget(d->m_textEditor.widget());
- connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
// Revert to saved/load externally modified files.
connect(&d->m_file, SIGNAL(reload(QString*,QString)), this, SLOT(slotOpen(QString*,QString)));
- // Force update of open editors model.
- connect(&d->m_file, SIGNAL(saved()), this, SIGNAL(changed()));
- connect(&d->m_file, SIGNAL(changed()), this, SIGNAL(changed()));
}
FormWindowEditor::~FormWindowEditor()
@@ -139,10 +135,8 @@ bool FormWindowEditor::open(QString *errorString, const QString &fileName, const
QDesignerFormWindowInterface *form = d->m_file.formWindow();
QTC_ASSERT(form, return false);
- if (fileName.isEmpty()) {
- setDisplayName(tr("untitled"));
+ if (fileName.isEmpty())
return true;
- }
const QFileInfo fi(fileName);
const QString absfileName = fi.absoluteFilePath();
@@ -167,15 +161,12 @@ bool FormWindowEditor::open(QString *errorString, const QString &fileName, const
form->setDirty(fileName != realFileName);
syncXmlEditor(contents);
- setDisplayName(fi.fileName());
d->m_file.setFilePath(absfileName);
d->m_file.setShouldAutoSave(false);
if (Internal::ResourceHandler *rh = form->findChild<Designer::Internal::ResourceHandler*>())
rh->updateResources();
- emit changed();
-
return true;
}
@@ -190,6 +181,7 @@ void FormWindowEditor::syncXmlEditor(const QString &contents)
{
d->m_textEditor.editorWidget()->setPlainText(contents);
d->m_textEditor.editorWidget()->setReadOnly(true);
+ d->m_textEditor.document()->setDisplayName(d->m_file.displayName());
static_cast<TextEditor::PlainTextEditorWidget *>
(d->m_textEditor.editorWidget())->configure(document()->mimeType());
}
@@ -204,17 +196,6 @@ Core::Id FormWindowEditor::id() const
return Core::Id(Designer::Constants::K_DESIGNER_XML_EDITOR_ID);
}
-QString FormWindowEditor::displayName() const
-{
- return d->m_textEditor.displayName();
-}
-
-void FormWindowEditor::setDisplayName(const QString &title)
-{
- d->m_textEditor.setDisplayName(title);
- emit changed();
-}
-
QByteArray FormWindowEditor::saveState() const
{
return d->m_textEditor.saveState();