forked from qt-creator/qt-creator
Avoid going through ICore when it's not necessary
Many singletons have their own instance() method, in which case there is no need to use ICore::instance() to get access to them.
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
@@ -57,7 +56,7 @@ BaseTextMark::BaseTextMark(const QString &filename, int line)
|
||||
void BaseTextMark::init()
|
||||
{
|
||||
m_init = true;
|
||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
||||
Core::EditorManager *em = Core::EditorManager::instance();
|
||||
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
|
||||
|
||||
foreach (Core::IEditor *editor, em->openedEditors())
|
||||
@@ -117,7 +116,7 @@ void BaseTextMark::updateMarker()
|
||||
|
||||
void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
|
||||
{
|
||||
Core::EditorManager *em = Core::ICore::instance()->editorManager();
|
||||
Core::EditorManager *em = Core::EditorManager::instance();
|
||||
if (!m_init) {
|
||||
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
|
||||
m_init = true;
|
||||
|
||||
Reference in New Issue
Block a user