Fix usage of EditorManager::editorsForFileName

And move to using the corresponding method in document model.

Change-Id: I80b12ceab8a91c5393b9c0422d660a8896ae09d8
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Eike Ziller
2013-07-18 12:26:23 +02:00
parent bc88c0b89e
commit 8c2e3fd2cb
11 changed files with 47 additions and 85 deletions

View File

@@ -219,9 +219,9 @@ StateListener::StateListener(QObject *parent) :
static inline QString displayNameOfEditor(const QString &fileName)
{
const QList<Core::IEditor*> editors = Core::EditorManager::instance()->editorsForFileName(fileName);
if (!editors.isEmpty())
return editors.front()->document()->displayName();
Core::IDocument *document = Core::EditorManager::documentModel()->documentForFilePath(fileName);
if (document)
return document->displayName();
return QString();
}