forked from qt-creator/qt-creator
Analyzer: Remove some unused code
Change-Id: Ifa1468e357cae873df6a34380957100521317471 Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include "analyzerplugin.h"
|
||||
#include "ianalyzertool.h"
|
||||
#include "analyzersettings.h"
|
||||
#include "analyzerruncontrol.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
@@ -659,9 +658,6 @@ AnalyzerManager::~AnalyzerManager()
|
||||
|
||||
void AnalyzerManager::extensionsInitialized()
|
||||
{
|
||||
if (m_instance->d->m_tools.isEmpty())
|
||||
return;
|
||||
|
||||
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
||||
tool->extensionsInitialized();
|
||||
}
|
||||
@@ -760,19 +756,12 @@ void AnalyzerManager::handleToolFinished()
|
||||
AnalyzerRunControl *AnalyzerManager::createRunControl(
|
||||
const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
ProjectExplorer::RunMode runMode,
|
||||
QString *errorMessage)
|
||||
ProjectExplorer::RunMode runMode)
|
||||
{
|
||||
foreach (IAnalyzerTool *tool, m_instance->d->m_tools) {
|
||||
if (tool->runMode() == runMode) {
|
||||
AnalyzerRunControl *rc = tool->createRunControl(sp, runConfiguration);
|
||||
showStatusMessage(tr("Tool \"%1\" started...").arg(rc->displayName()));
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
if (errorMessage)
|
||||
*errorMessage = tr("No analyzer tool selected.");
|
||||
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
||||
if (tool->runMode() == runMode)
|
||||
return tool->createRunControl(sp, runConfiguration);
|
||||
QTC_CHECK(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -93,8 +93,7 @@ public:
|
||||
static QAction *stopAction();
|
||||
|
||||
static AnalyzerRunControl *createRunControl(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode runMode,
|
||||
QString *errorMessage);
|
||||
ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode runMode);
|
||||
|
||||
private:
|
||||
friend class AnalyzerManagerPrivate;
|
||||
|
@@ -69,7 +69,7 @@ RunControl *AndroidAnalyzeSupport::createAnalyzeRunControl(AndroidRunConfigurati
|
||||
}
|
||||
|
||||
AnalyzerRunControl *analyzerRunControl =
|
||||
AnalyzerManager::createRunControl(params, runConfig, runMode, errorMessage);
|
||||
AnalyzerManager::createRunControl(params, runConfig, runMode);
|
||||
(void) new AndroidAnalyzeSupport(runConfig, analyzerRunControl);
|
||||
return analyzerRunControl;
|
||||
}
|
||||
|
@@ -75,9 +75,6 @@ static AnalyzerStartParameters createQmlProfilerStartParameters(RunConfiguration
|
||||
{
|
||||
AnalyzerStartParameters sp;
|
||||
EnvironmentAspect *environment = runConfiguration->extraAspect<EnvironmentAspect>();
|
||||
Debugger::DebuggerRunConfigurationAspect *debugger
|
||||
= runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
|
||||
QTC_ASSERT(debugger, return sp);
|
||||
|
||||
// FIXME: This is only used to communicate the connParams settings.
|
||||
if (QmlProjectManager::QmlProjectRunConfiguration *rc1 =
|
||||
@@ -126,7 +123,7 @@ RunControl *QmlProfilerRunControlFactory::create(RunConfiguration *runConfigurat
|
||||
const IDevice::ConstPtr device = DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
||||
|
||||
AnalyzerRunControl *rc = AnalyzerManager::createRunControl(sp, runConfiguration, mode, errorMessage);
|
||||
AnalyzerRunControl *rc = AnalyzerManager::createRunControl(sp, runConfiguration, mode);
|
||||
QmlProfilerRunControl *engine = qobject_cast<QmlProfilerRunControl *>(rc);
|
||||
if (!engine) {
|
||||
delete rc;
|
||||
|
@@ -190,7 +190,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
|
||||
}
|
||||
case QmlProfilerRunMode: {
|
||||
const AnalyzerStartParameters params = createAnalyzerStartParameters(rc, mode);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode, errorMessage);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode);
|
||||
QnxAnalyzeSupport * const analyzeSupport = new QnxAnalyzeSupport(rc, runControl);
|
||||
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
|
||||
return runControl;
|
||||
|
@@ -108,7 +108,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
|
||||
}
|
||||
case QmlProfilerRunMode: {
|
||||
AnalyzerStartParameters params = RemoteLinuxAnalyzeSupport::startParameters(rc, mode);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode, errorMessage);
|
||||
AnalyzerRunControl *runControl = AnalyzerManager::createRunControl(params, runConfig, mode);
|
||||
RemoteLinuxAnalyzeSupport * const analyzeSupport =
|
||||
new RemoteLinuxAnalyzeSupport(rc, runControl, mode);
|
||||
connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
|
||||
|
@@ -65,9 +65,11 @@ bool ValgrindRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMo
|
||||
return mode == CallgrindRunMode || mode == MemcheckRunMode;
|
||||
}
|
||||
|
||||
static AnalyzerStartParameters createValgrindStartParameters(RunConfiguration *runConfiguration)
|
||||
RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
|
||||
{
|
||||
Analyzer::AnalyzerStartParameters sp;
|
||||
Q_UNUSED(errorMessage);
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
sp.displayName = runConfiguration->displayName();
|
||||
if (LocalApplicationRunConfiguration *rc1 =
|
||||
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
@@ -79,35 +81,28 @@ static AnalyzerStartParameters createValgrindStartParameters(RunConfiguration *r
|
||||
sp.debuggeeArgs = rc1->commandLineArguments();
|
||||
const IDevice::ConstPtr device =
|
||||
DeviceKitInformation::device(runConfiguration->target()->kit());
|
||||
QTC_ASSERT(device, return sp);
|
||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp);
|
||||
QTC_ASSERT(device, return 0);
|
||||
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0);
|
||||
QTcpServer server;
|
||||
if (!server.listen(QHostAddress::LocalHost) && !server.listen(QHostAddress::LocalHostIPv6)) {
|
||||
qWarning() << "Cannot open port on host for profiling.";
|
||||
return sp;
|
||||
return 0;
|
||||
}
|
||||
sp.connParams.host = server.serverAddress().toString();
|
||||
sp.connParams.port = server.serverPort();
|
||||
sp.startMode = Analyzer::StartLocal;
|
||||
sp.startMode = StartLocal;
|
||||
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc2 =
|
||||
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp.startMode = Analyzer::StartRemote;
|
||||
sp.startMode = StartRemote;
|
||||
sp.debuggee = rc2->remoteExecutableFilePath();
|
||||
sp.connParams = DeviceKitInformation::device(rc2->target()->kit())->sshParameters();
|
||||
sp.analyzerCmdPrefix = rc2->commandPrefix();
|
||||
sp.debuggeeArgs = rc2->arguments();
|
||||
} else {
|
||||
// Might be S60DeviceRunfiguration, or something else ...
|
||||
//sp.startMode = StartRemote;
|
||||
sp.startMode = Analyzer::StartRemote;
|
||||
}
|
||||
return sp;
|
||||
QTC_ASSERT(false, return 0);
|
||||
}
|
||||
|
||||
RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
|
||||
{
|
||||
AnalyzerStartParameters sp = createValgrindStartParameters(runConfiguration);
|
||||
return AnalyzerManager::createRunControl(sp, runConfiguration, mode, errorMessage);
|
||||
return AnalyzerManager::createRunControl(sp, runConfiguration, mode);
|
||||
}
|
||||
|
||||
IRunConfigurationAspect *ValgrindRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc)
|
||||
|
Reference in New Issue
Block a user