taskhub: use more direct access.

Change-Id: Ibc4f37589f913ff9ea0025156979ddda73929e38
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
hjk
2012-03-07 16:40:03 +01:00
committed by Tobias Hunger
parent 97c8781f40
commit 4516c41ce3
7 changed files with 19 additions and 24 deletions

View File

@@ -43,7 +43,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/editormanager/editormanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/task.h>
#include <projectexplorer/taskhub.h>
@@ -83,10 +83,9 @@ bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorStri
addAutoReleasedObject(new AnalyzerRunControlFactory());
// Task integration.
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
ProjectExplorer::TaskHub *hub = pm->getObject<ProjectExplorer::TaskHub>();
//: Category under which Analyzer tasks are listed in Issues view
hub->addCategory(Core::Id(Constants::ANALYZERTASK_ID), tr("Analyzer"));
ProjectExplorer::ProjectExplorerPlugin::instance()->taskHub()
->addCategory(Core::Id(Constants::ANALYZERTASK_ID), tr("Analyzer"));
return true;
}

View File

@@ -39,8 +39,8 @@
#include "analyzermanager.h"
#include "analyzerstartparameters.h"
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/applicationrunconfiguration.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/task.h>
#include <projectexplorer/taskhub.h>
@@ -115,10 +115,9 @@ void AnalyzerRunControl::start()
AnalyzerManager::handleToolStarted();
// clear about-to-be-outdated tasks
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
TaskHub *hub = pm->getObject<TaskHub>();
hub->clearTasks(Core::Id(Constants::ANALYZERTASK_ID));
// Clear about-to-be-outdated tasks.
ProjectExplorerPlugin::instance()->taskHub()
->clearTasks(Core::Id(Constants::ANALYZERTASK_ID));
if (d->m_engine->start()) {
d->m_isRunning = true;
@@ -177,8 +176,7 @@ void AnalyzerRunControl::receiveOutput(const QString &text, Utils::OutputFormat
void AnalyzerRunControl::addTask(Task::TaskType type, const QString &description,
const QString &file, int line)
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
TaskHub *hub = pm->getObject<TaskHub>();
TaskHub *hub = ProjectExplorerPlugin::instance()->taskHub();
hub->addTask(Task(type, description, Utils::FileName::fromUserInput(file), line,
Core::Id(Constants::ANALYZERTASK_ID)));
hub->popup(false);

View File

@@ -61,8 +61,8 @@
#include <texteditor/itexteditor.h>
#include <texteditor/basetextmark.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/taskhub.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/savedaction.h>
#include <utils/qtcassert.h>
@@ -1953,8 +1953,7 @@ void DebuggerEnginePrivate::reportTestError(const QString &msg, int line)
m_foundError = true;
if (!m_taskHub) {
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
m_taskHub = pm->getObject<TaskHub>();
m_taskHub = ProjectExplorerPlugin::instance()->taskHub();
m_taskHub->addCategory(Core::Id("DebuggerTest"), tr("Debugger Test"));
}

View File

@@ -141,7 +141,7 @@ BuildManager::BuildManager(ProjectExplorerPlugin *parent)
d->m_outputWindow = new Internal::CompileOutputWindow(this);
pm->addObject(d->m_outputWindow);
d->m_taskHub = pm->getObject<TaskHub>();
d->m_taskHub = ProjectExplorerPlugin::instance()->taskHub();
d->m_taskWindow = new Internal::TaskWindow(d->m_taskHub);
pm->addObject(d->m_taskWindow);

View File

@@ -64,7 +64,7 @@
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/taskhub.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/textfilewizard.h>
@@ -84,6 +84,7 @@
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
using namespace QmlJSEditor::Constants;
using namespace ProjectExplorer;
enum {
QUICKFIX_INTERVAL = 20
@@ -266,8 +267,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
void QmlJSEditorPlugin::extensionsInitialized()
{
ProjectExplorer::TaskHub *taskHub =
ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::TaskHub>();
TaskHub *taskHub = ProjectExplorerPlugin::instance()->taskHub();
taskHub->addCategory(Constants::TASK_CATEGORY_QML, tr("QML"));
taskHub->addCategory(Constants::TASK_CATEGORY_QML_ANALYSIS, tr("QML Analysis"), false);
}
@@ -380,7 +380,7 @@ void QmlJSEditorPlugin::currentEditorChanged(Core::IEditor *editor)
void QmlJSEditorPlugin::runSemanticScan()
{
m_qmlTaskManager->updateSemanticMessagesNow();
ProjectExplorer::TaskHub *hub = ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::TaskHub>();
TaskHub *hub = ProjectExplorerPlugin::instance()->taskHub();
hub->setCategoryVisibility(Constants::TASK_CATEGORY_QML_ANALYSIS, true);
hub->popup(false);
}

View File

@@ -34,7 +34,7 @@
#include "qmljseditorconstants.h"
#include <coreplugin/idocument.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/taskhub.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljs/qmljscontext.h>
@@ -57,7 +57,7 @@ QmlTaskManager::QmlTaskManager(QObject *parent) :
m_taskHub(0),
m_updatingSemantic(false)
{
m_taskHub = ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::TaskHub>();
m_taskHub = ProjectExplorer::ProjectExplorerPlugin::instance()->taskHub();
// displaying results incrementally leads to flickering
// connect(&m_messageCollector, SIGNAL(resultsReadyAt(int,int)),

View File

@@ -32,7 +32,7 @@
#include "sbsv2parser.h"
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/taskhub.h>
@@ -55,8 +55,7 @@ SbsV2Parser::SbsV2Parser() :
m_hub(0)
{
setObjectName(QLatin1String("SbsV2Parser"));
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
m_hub = pm->getObject<TaskHub>();
m_hub = ProjectExplorerPlugin::instance()->taskHub();
}
void SbsV2Parser::stdOutput(const QString &line)