diff options
author | hjk <hjk121@nokiamail.com> | 2014-05-07 16:25:04 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-05-13 11:48:30 +0200 |
commit | 6e584b5b4953b996ef07c4625adf178c59de24f7 (patch) | |
tree | 2af702c76bf5323c331154b553aacbe5523592f5 /src/plugins/coreplugin/editormanager/openeditorsview.cpp | |
parent | 226c1abc89888fa2f272d92c466725fd6dad65db (diff) | |
download | qt-creator-6e584b5b4953b996ef07c4625adf178c59de24f7.tar.gz |
DocumentModel: Make interface static
Move item model implementation to private, adjust user code.
Change-Id: Ifbe94e7c7b9b1e8be1b4c531958dbd7a9413af13
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/coreplugin/editormanager/openeditorsview.cpp')
-rw-r--r-- | src/plugins/coreplugin/editormanager/openeditorsview.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp index a57f5cef7a..23c7459022 100644 --- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp @@ -97,7 +97,7 @@ OpenEditorsWidget::OpenEditorsWidget() setFrameStyle(QFrame::NoFrame); setAttribute(Qt::WA_MacShowFocusRect, false); m_model = new ProxyModel(this); - m_model->setSourceModel(EditorManager::documentModel()); + m_model->setSourceModel(DocumentModel::model()); setModel(m_model); setSelectionMode(QAbstractItemView::SingleSelection); setSelectionBehavior(QAbstractItemView::SelectRows); @@ -128,7 +128,7 @@ OpenEditorsWidget::~OpenEditorsWidget() void OpenEditorsWidget::updateCurrentItem(Core::IEditor *editor) { IDocument *document = editor ? editor->document() : 0; - QModelIndex index = m_model->index(EditorManager::documentModel()->indexOfDocument(document), 0); + QModelIndex index = m_model->index(DocumentModel::indexOfDocument(document), 0); if (!index.isValid()) { clearSelection(); return; @@ -189,13 +189,13 @@ void OpenEditorsWidget::activateEditor(const QModelIndex &index) { selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); EditorManager::activateEditorForEntry( - EditorManager::documentModel()->documentAtRow(m_model->mapToSource(index).row())); + DocumentModel::documentAtRow(m_model->mapToSource(index).row())); } void OpenEditorsWidget::closeEditor(const QModelIndex &index) { EditorManager::closeEditor( - EditorManager::documentModel()->documentAtRow(m_model->mapToSource(index).row())); + DocumentModel::documentAtRow(m_model->mapToSource(index).row())); // work around selection changes updateCurrentItem(EditorManager::currentEditor()); } @@ -204,7 +204,7 @@ void OpenEditorsWidget::contextMenuRequested(QPoint pos) { QMenu contextMenu; QModelIndex editorIndex = indexAt(pos); - DocumentModel::Entry *entry = EditorManager::documentModel()->documentAtRow( + DocumentModel::Entry *entry = DocumentModel::documentAtRow( m_model->mapToSource(editorIndex).row()); EditorManager::addSaveAndCloseEditorActions(&contextMenu, entry); contextMenu.addSeparator(); |