TaskHub: Move code to be more conform with other singletons

Make methods static and add a instance() method for Signals/Slots.

Remove ProjectExplorerPlugin::taskHub() method and use the new
ones instead.

Change-Id: Ifae24ff19579fc524cbd61bddc826095c443adfa
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Tobias Hunger
2013-08-15 12:14:46 +02:00
parent 53a49e3a64
commit 85b2017a69
21 changed files with 117 additions and 151 deletions

View File

@@ -60,7 +60,6 @@
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/taskhub.h>
#include <projectexplorer/projectexplorer.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/textfilewizard.h>
@@ -248,9 +247,8 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
void QmlJSEditorPlugin::extensionsInitialized()
{
TaskHub *taskHub = ProjectExplorerPlugin::taskHub();
taskHub->addCategory(Constants::TASK_CATEGORY_QML, tr("QML"));
taskHub->addCategory(Constants::TASK_CATEGORY_QML_ANALYSIS, tr("QML Analysis"), false);
TaskHub::addCategory(Constants::TASK_CATEGORY_QML, tr("QML"));
TaskHub::addCategory(Constants::TASK_CATEGORY_QML_ANALYSIS, tr("QML Analysis"), false);
}
ExtensionSystem::IPlugin::ShutdownFlag QmlJSEditorPlugin::aboutToShutdown()
@@ -348,9 +346,8 @@ void QmlJSEditorPlugin::currentEditorChanged(Core::IEditor *editor)
void QmlJSEditorPlugin::runSemanticScan()
{
m_qmlTaskManager->updateSemanticMessagesNow();
TaskHub *hub = ProjectExplorerPlugin::taskHub();
hub->setCategoryVisibility(Constants::TASK_CATEGORY_QML_ANALYSIS, true);
hub->requestPopup();
TaskHub::setCategoryVisibility(Constants::TASK_CATEGORY_QML_ANALYSIS, true);
TaskHub::requestPopup();
}
void QmlJSEditorPlugin::checkCurrentEditorSemanticInfoUpToDate()