forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user