Commit 73b886fc authored by mae's avatar mae
Browse files

make "close all" work with fake-restored editors

parent 5b683c84
......@@ -628,6 +628,7 @@ QList<IFile *> EditorManager::filesForEditors(QList<IEditor *> editors) const
bool EditorManager::closeAllEditors(bool askAboutModifiedEditors)
{
m_d->m_editorModel->removeAllRestoredEditors();
return closeEditors(openedEditors(), askAboutModifiedEditors);
}
......
......@@ -181,6 +181,17 @@ void EditorModel::removeEditor(IEditor *editor)
disconnect(editor, SIGNAL(changed()), this, SLOT(itemChanged()));
}
void EditorModel::removeAllRestoredEditors()
{
for (int i = m_editors.count()-1; i >= 0; --i) {
if (!m_editors.at(i).editor) {
beginRemoveRows(QModelIndex(), i, i);
m_editors.removeAt(i);
endRemoveRows();
}
}
}
bool EditorModel::isDuplicate(IEditor *editor) const
{
return m_duplicateEditors.contains(editor);
......
......@@ -86,6 +86,7 @@ public:
QList<Entry> entries() const { return m_editors; }
void removeEditor(IEditor *editor);
void removeAllRestoredEditors();
void emitDataChanged(IEditor *editor);
QList<IEditor *> editors() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment