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:
Thorbjørn Lindeijer
2009-01-21 15:52:34 +01:00
parent f73861d458
commit 6adecf3767
39 changed files with 107 additions and 143 deletions

View File

@@ -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()),