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

@@ -723,18 +723,17 @@ void DebuggerPlugin::activatePreviousMode()
void DebuggerPlugin::activateDebugMode()
{
ICore *core = ICore::instance();
Core::ModeManager *modeManager = core->modeManager();
ModeManager *modeManager = ModeManager::instance();
m_previousMode = QLatin1String(modeManager->currentMode()->uniqueModeName());
modeManager->activateMode(QLatin1String(MODE_DEBUG));
}
void DebuggerPlugin::queryCurrentTextEditor(QString *fileName, int *lineNumber, QObject **object)
{
ICore *core = ICore::instance();
if (!core || !core->editorManager())
EditorManager *editorManager = EditorManager::instance();
if (!editorManager)
return;
Core::IEditor *editor = core->editorManager()->currentEditor();
Core::IEditor *editor = editorManager->currentEditor();
ITextEditor *textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
return;