OpenEditorsModel API: Use 'document' more where is about documents.

Rename OpenEditorsModel to DocumentModel.
In the DocumentModel also make the distinction between "restored"
document (i.e. just info about file name, display name, id), "opened
document" (i.e. document with IEditor and IDocument), and "document"
(which refers to any).

Change-Id: I01ebe10ec84aab5fe81e54be6bec14f653f28771
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2013-07-05 16:08:38 +02:00
parent 39d9912620
commit 7b1941c792
17 changed files with 144 additions and 145 deletions

View File

@@ -41,7 +41,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/dialogs/ioptionspage.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <coreplugin/editormanager/documentmodel.h>
#include <coreplugin/documentmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/idocument.h>
@@ -1997,7 +1997,7 @@ void FakeVimPluginPrivate::highlightMatches(const QString &needle)
int FakeVimPluginPrivate::currentFile() const
{
OpenEditorsModel *model = EditorManager::instance()->openedEditorsModel();
DocumentModel *model = EditorManager::instance()->documentModel();
IEditor *editor = EditorManager::currentEditor();
if (!editor)
return -1;
@@ -2007,13 +2007,13 @@ int FakeVimPluginPrivate::currentFile() const
void FakeVimPluginPrivate::switchToFile(int n)
{
EditorManager *editorManager = ICore::editorManager();
OpenEditorsModel *model = editorManager->openedEditorsModel();
int size = model->openDocumentCount();
DocumentModel *model = editorManager->documentModel();
int size = model->documentCount();
QTC_ASSERT(size, return);
n = n % size;
if (n < 0)
n += size;
editorManager->activateEditorForEntry(model->entries().at(n));
editorManager->activateEditorForEntry(model->documents().at(n));
}
ExCommandMap &FakeVimExCommandsPage::exCommandMap()