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:
@@ -234,12 +234,11 @@ public:
|
||||
BinEditorInterface(BinEditor *parent)
|
||||
: Core::IEditor(parent)
|
||||
{
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||
m_editor = parent;
|
||||
m_file = new BinEditorFile(parent);
|
||||
m_context << core->uniqueIDManager()->
|
||||
uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
|
||||
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
|
||||
|
||||
QHBoxLayout *l = new QHBoxLayout;
|
||||
@@ -320,8 +319,8 @@ QString BinEditorFactory::kind() const
|
||||
|
||||
Core::IFile *BinEditorFactory::open(const QString &fileName)
|
||||
{
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::IEditor *iface = core->editorManager()->openEditor(fileName, kind());
|
||||
Core::EditorManager *em = Core::EditorManager::instance();
|
||||
Core::IEditor *iface = em->openEditor(fileName, kind());
|
||||
return iface ? iface->file() : 0;
|
||||
}
|
||||
|
||||
@@ -384,8 +383,8 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
|
||||
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
|
||||
editor->setEditorInterface(editorInterface);
|
||||
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
m_context << core->uniqueIDManager()->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
||||
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
|
||||
if (!m_undoAction) {
|
||||
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
|
||||
this, SLOT(undoAction()),
|
||||
|
||||
Reference in New Issue
Block a user