void OpenEditorsModel::removeEditor(IEditor *editor)
{
d->m_duplicateEditors.removeAll(editor);
- int idx = findEditor(editor);
- if (idx < 0)
- return;
- beginRemoveRows(QModelIndex(), idx, idx);
- d->m_editors.removeAt(idx);
- endRemoveRows();
- disconnect(editor, SIGNAL(changed()), this, SLOT(itemChanged()));
+ removeEditor(findEditor(editor));
}
void OpenEditorsModel::removeEditor(const QModelIndex &index)
{
- int idx = index.row();
+ removeEditor(index.row());
+}
+
+void OpenEditorsModel::removeEditor(int idx)
+{
if (idx < 0)
return;
IEditor *editor= d->m_editors.at(idx).editor;
void addEntry(const Entry &entry);
int findEditor(IEditor *editor) const;
int findFileName(const QString &filename) const;
+ void removeEditor(int idx);
QScopedPointer<OpenEditorsModelPrivate> d;
};