Designer: Fix a crash when open() fails.

editorsClosed() is not emitted when open fails and thus
the file was not removed from FormEditorStack.
Add a connection from destroy to ensure the editor is removed.

Happens when loading a session whose files no longer exists.

Task-number: QTCREATORBUG-4266
Reviewed-by: dt
This commit is contained in:
Friedemann Kleint
2011-03-30 11:52:15 +02:00
parent b38a256ed6
commit 776c599384
4 changed files with 28 additions and 19 deletions

View File

@@ -35,6 +35,8 @@
#include "formeditorw.h"
#include "formeditorstack.h"
#include <coreplugin/editormanager/ieditor.h>
#include <utils/qtcassert.h>
#include <QtGui/QVBoxLayout>
@@ -109,9 +111,9 @@ void EditorWidget::add(const EditorData &d)
m_stack->add(d);
}
bool EditorWidget::removeFormWindowEditor(Core::IEditor *xmlEditor)
void EditorWidget::removeFormWindowEditor(Core::IEditor *xmlEditor)
{
return m_stack->removeFormWindowEditor(xmlEditor);
m_stack->removeFormWindowEditor(xmlEditor);
}
bool EditorWidget::setVisibleEditor(Core::IEditor *xmlEditor)