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

@@ -84,8 +84,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
// Create the globalcontext list to register actions accordingly
QList<int> globalcontext;
globalcontext << ICore::instance()->uniqueIDManager()->
uniqueIdentifier(Core::Constants::C_GLOBAL);
globalcontext << UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL);
// Create the settings Page
m_settingsPage = new SettingsPage();
@@ -129,7 +128,7 @@ void CodepasterPlugin::post()
{
if (m_poster)
delete m_poster;
IEditor* editor = ICore::instance()->editorManager()->currentEditor();
IEditor* editor = EditorManager::instance()->currentEditor();
ITextEditor* textEditor = qobject_cast<ITextEditor*>(editor);
if (!textEditor)
return;
@@ -240,8 +239,7 @@ void CustomFetcher::customRequestFinished(int, bool error)
QByteArray data = body();
if (!m_listWidget) {
QString title = QString::fromLatin1("Code Paster: %1").arg(m_id);
ICore::instance()->editorManager()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR
, &title, data);
EditorManager::instance()->newFile(Core::Constants::K_DEFAULT_TEXT_EDITOR, &title, data);
} else {
m_listWidget->clear();
QStringList lines = QString(data).split(QLatin1Char('\n'));