diff options
author | hjk <qtc-committer@nokia.com> | 2011-06-29 16:04:03 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2011-06-29 16:27:39 +0200 |
commit | b6c0f3d8a6f4e395343ae167da63a434581d76bd (patch) | |
tree | 3d4c1057ac3dd753e54fa14018e7f8497ee6e669 /src/plugins/analyzerbase/analyzerplugin.cpp | |
parent | ee595ceb3ef0bb96b8b929c9a21b3c16b84e848c (diff) | |
download | qt-creator-b6c0f3d8a6f4e395343ae167da63a434581d76bd.tar.gz |
analyzer: refactor AnalyzerManager
Change-Id: Id925bb638b2757ef079c21192d4e2a8cc8f08694
Reviewed-on: http://codereview.qt.nokia.com/908
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/analyzerbase/analyzerplugin.cpp')
-rw-r--r-- | src/plugins/analyzerbase/analyzerplugin.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/plugins/analyzerbase/analyzerplugin.cpp b/src/plugins/analyzerbase/analyzerplugin.cpp index fb520ee4d3..b66dd0f7ab 100644 --- a/src/plugins/analyzerbase/analyzerplugin.cpp +++ b/src/plugins/analyzerbase/analyzerplugin.cpp @@ -54,8 +54,6 @@ using namespace Analyzer; using namespace Analyzer::Internal; -static const char lastActiveToolC[] = "Analyzer.Plugin.LastActiveTool"; - AnalyzerPlugin *AnalyzerPlugin::m_instance = 0; @@ -113,34 +111,11 @@ bool AnalyzerPlugin::initialize(const QStringList &arguments, QString *errorStri void AnalyzerPlugin::extensionsInitialized() { - const QList<IAnalyzerTool *> tools = d->m_manager->tools(); - if (tools.isEmpty()) - return; - - const QSettings *settings = Core::ICore::instance()->settings(); - const QString lastActiveToolId = - settings->value(QLatin1String(lastActiveToolC), QString()).toString(); - IAnalyzerTool *lastActiveTool = 0; - - foreach (IAnalyzerTool *tool, tools) { - tool->extensionsInitialized(); - if (tool->id() == lastActiveToolId) - lastActiveTool = tool; - } - - if (!lastActiveTool) - lastActiveTool = tools.back(); - if (lastActiveTool) - d->m_manager->selectTool(lastActiveTool); + d->m_manager->extensionsInitialized(); } ExtensionSystem::IPlugin::ShutdownFlag AnalyzerPlugin::aboutToShutdown() { - if (const IAnalyzerTool *tool = d->m_manager->currentTool()) { - QSettings *settings = Core::ICore::instance()->settings(); - settings->setValue(QLatin1String(lastActiveToolC), tool->id()); - } - d->m_manager->shutdown(); return SynchronousShutdown; } |