forked from qt-creator/qt-creator
analyzer: refactoring of analyzer manager
Change-Id: I60268b8bc86e439beb3fca8f4b6a87ea03925bad Reviewed-on: http://codereview.qt.nokia.com/1049 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -61,6 +61,9 @@ const char * const START = "Analyzer.Start";
|
||||
const char * const STARTREMOTE = "Analyzer.StartRemote";
|
||||
const char * const STOP = "Analyzer.Stop";
|
||||
|
||||
const char * const G_ANALYZER_TOOLS = "Menu.Group.Analyzer.Tools";
|
||||
const char * const G_ANALYZER_REMOTE_TOOLS = "Menu.Group.Analyzer.RemoteTools";
|
||||
|
||||
// options dialog
|
||||
const char * const ANALYZER_SETTINGS_CATEGORY = "T.Analyzer";
|
||||
const char * const ANALYZER_SETTINGS_TR_CATEGORY =
|
||||
|
||||
@@ -76,7 +76,9 @@
|
||||
#include <utils/statuslabel.h>
|
||||
#include <utils/ssh/sshconnection.h>
|
||||
|
||||
#include <cmakeprojectmanager/cmakeprojectconstants.h>
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QDebug>
|
||||
@@ -105,10 +107,44 @@ namespace Analyzer {
|
||||
namespace Internal {
|
||||
|
||||
const char lastActiveToolC[] = "Analyzer.Plugin.LastActiveTool";
|
||||
const char G_ANALYZER_TOOLS[] = "Menu.Group.Analyzer.Tools";
|
||||
const char G_ANALYZER_REMOTE_TOOLS[] = "Menu.Group.Analyzer.RemoteTools";
|
||||
const char INITIAL_DOCK_AREA[] = "initial_dock_area";
|
||||
|
||||
AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerStartParameters sp;
|
||||
QTC_ASSERT(runConfiguration, return sp);
|
||||
ProjectExplorer::LocalApplicationRunConfiguration *rc =
|
||||
qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc, return sp);
|
||||
|
||||
sp.startMode = StartLocal;
|
||||
sp.environment = rc->environment();
|
||||
sp.workingDirectory = rc->workingDirectory();
|
||||
sp.debuggee = rc->executable();
|
||||
sp.debuggeeArgs = rc->commandLineArguments();
|
||||
sp.displayName = rc->displayName();
|
||||
sp.connParams.host = QLatin1String("localhost");
|
||||
sp.connParams.port = rc->qmlDebugServerPort();
|
||||
return sp;
|
||||
}
|
||||
|
||||
AnalyzerStartParameters remoteLinuxStartParameters(ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerStartParameters sp;
|
||||
RemoteLinux::RemoteLinuxRunConfiguration * const rc
|
||||
= qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc, return sp);
|
||||
|
||||
sp.debuggee = rc->remoteExecutableFilePath();
|
||||
sp.debuggeeArgs = rc->arguments();
|
||||
sp.connParams = rc->deviceConfig()->sshParameters();
|
||||
sp.analyzerCmdPrefix = rc->commandPrefix();
|
||||
sp.startMode = StartRemote;
|
||||
sp.displayName = rc->displayName();
|
||||
return sp;
|
||||
}
|
||||
|
||||
|
||||
// AnalyzerMode ////////////////////////////////////////////////////
|
||||
|
||||
class AnalyzerMode : public Core::IMode
|
||||
@@ -175,44 +211,40 @@ public:
|
||||
const QString &stopButtonText, const QString &cancelButtonText) const;
|
||||
|
||||
void addDock(Qt::DockWidgetArea area, QDockWidget *dockWidget);
|
||||
void startAction(int tool);
|
||||
void startLocalTool(IAnalyzerTool *tool);
|
||||
void startRemoteTool(IAnalyzerTool *tool);
|
||||
void addTool(IAnalyzerTool *tool);
|
||||
void addToolAction(IAnalyzerTool *tool, bool local);
|
||||
void stopTool(IAnalyzerTool *tool);
|
||||
void handleToolFinished(IAnalyzerTool *tool);
|
||||
int indexOf(IAnalyzerTool *tool) const;
|
||||
int indexOf(QAction *action) const;
|
||||
IAnalyzerTool *toolAt(int idx) const;
|
||||
void saveToolSettings(IAnalyzerTool *tool);
|
||||
void loadToolSettings(IAnalyzerTool *tool);
|
||||
|
||||
void registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory);
|
||||
ProjectExplorer::RunControl *createRunControl
|
||||
(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
|
||||
|
||||
public slots:
|
||||
void startAction() { startAction(m_currentIndex); }
|
||||
void startToolRemote();
|
||||
void stopTool();
|
||||
void startTool();
|
||||
void stopTool() { stopTool(m_currentTool); }
|
||||
|
||||
void handleToolFinished();
|
||||
void selectAction();
|
||||
void selectAction(int);
|
||||
void selectAction(QAction *);
|
||||
void selectTool();
|
||||
void selectTool(IAnalyzerTool *tool);
|
||||
void selectTool(QAction *);
|
||||
void selectTool(int);
|
||||
void modeChanged(Core::IMode *mode);
|
||||
void runControlCreated(Analyzer::AnalyzerRunControl *);
|
||||
void resetLayout();
|
||||
void saveToolSettings(Analyzer::IAnalyzerTool *tool);
|
||||
void loadToolSettings(Analyzer::IAnalyzerTool *tool);
|
||||
void updateRunActions();
|
||||
void registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory);
|
||||
|
||||
public:
|
||||
struct ToolData {
|
||||
IAnalyzerTool *tool;
|
||||
QAction *action;
|
||||
bool local;
|
||||
};
|
||||
|
||||
AnalyzerManager *q;
|
||||
AnalyzerMode *m_mode;
|
||||
AnalyzerRunControlFactory *m_runControlFactory;
|
||||
ProjectExplorer::RunControl *m_currentRunControl;
|
||||
Utils::FancyMainWindow *m_mainWindow;
|
||||
int m_currentIndex;
|
||||
QList<ToolData> m_actions;
|
||||
IAnalyzerTool *m_currentTool;
|
||||
QHash<QAction *, IAnalyzerTool *> m_toolFromAction;
|
||||
QList<IAnalyzerTool *> m_tools;
|
||||
QAction *m_startAction;
|
||||
QAction *m_stopAction;
|
||||
@@ -222,7 +254,7 @@ public:
|
||||
ActionContainer *m_viewsMenu;
|
||||
Utils::StatusLabel *m_statusLabel;
|
||||
typedef QMap<IAnalyzerTool *, FancyMainWindowSettings> MainWindowSettingsMap;
|
||||
QMap<IAnalyzerTool *, QList<QDockWidget *> > m_toolWidgets;
|
||||
QHash<IAnalyzerTool *, QList<QDockWidget *> > m_toolWidgets;
|
||||
MainWindowSettingsMap m_defaultSettings;
|
||||
|
||||
// list of dock widgets to prevent memory leak
|
||||
@@ -239,7 +271,7 @@ AnalyzerManager::AnalyzerManagerPrivate::AnalyzerManagerPrivate(AnalyzerManager
|
||||
m_runControlFactory(0),
|
||||
m_currentRunControl(0),
|
||||
m_mainWindow(0),
|
||||
m_currentIndex(-1),
|
||||
m_currentTool(0),
|
||||
m_startAction(0),
|
||||
m_stopAction(0),
|
||||
m_menu(0),
|
||||
@@ -251,7 +283,7 @@ AnalyzerManager::AnalyzerManagerPrivate::AnalyzerManagerPrivate(AnalyzerManager
|
||||
m_initialized(false)
|
||||
{
|
||||
m_toolBox->setObjectName(QLatin1String("AnalyzerManagerToolBox"));
|
||||
connect(m_toolBox, SIGNAL(currentIndexChanged(int)), SLOT(selectAction(int)));
|
||||
connect(m_toolBox, SIGNAL(currentIndexChanged(int)), SLOT(selectTool(int)));
|
||||
|
||||
m_runControlFactory = new AnalyzerRunControlFactory();
|
||||
registerRunControlFactory(m_runControlFactory);
|
||||
@@ -279,8 +311,6 @@ void AnalyzerManager::AnalyzerManagerPrivate::registerRunControlFactory
|
||||
(ProjectExplorer::IRunControlFactory *factory)
|
||||
{
|
||||
AnalyzerPlugin::instance()->addAutoReleasedObject(factory);
|
||||
connect(factory, SIGNAL(runControlCreated(Analyzer::AnalyzerRunControl*)),
|
||||
this, SLOT(runControlCreated(Analyzer::AnalyzerRunControl*)));
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::setupActions()
|
||||
@@ -295,8 +325,8 @@ void AnalyzerManager::AnalyzerManagerPrivate::setupActions()
|
||||
m_menu->menu()->setTitle(tr("&Analyze"));
|
||||
m_menu->menu()->setEnabled(true);
|
||||
|
||||
m_menu->appendGroup(G_ANALYZER_TOOLS);
|
||||
m_menu->appendGroup(G_ANALYZER_REMOTE_TOOLS);
|
||||
m_menu->appendGroup(Constants::G_ANALYZER_TOOLS);
|
||||
m_menu->appendGroup(Constants::G_ANALYZER_REMOTE_TOOLS);
|
||||
|
||||
Core::ActionContainer *menubar =
|
||||
am->actionContainer(Core::Constants::MENU_BAR);
|
||||
@@ -307,7 +337,7 @@ void AnalyzerManager::AnalyzerManagerPrivate::setupActions()
|
||||
m_startAction = new QAction(tr("Start"), m_menu);
|
||||
m_startAction->setIcon(QIcon(Constants::ANALYZER_CONTROL_START_ICON));
|
||||
command = am->registerAction(m_startAction, Constants::START, globalcontext);
|
||||
connect(m_startAction, SIGNAL(triggered()), this, SLOT(startAction()));
|
||||
connect(m_startAction, SIGNAL(triggered()), this, SLOT(startTool()));
|
||||
|
||||
m_stopAction = new QAction(tr("Stop"), m_menu);
|
||||
m_stopAction->setEnabled(false);
|
||||
@@ -319,7 +349,7 @@ void AnalyzerManager::AnalyzerManagerPrivate::setupActions()
|
||||
separatorAction->setSeparator(true);
|
||||
command = am->registerAction(separatorAction,
|
||||
"Menu.Action.Analyzer.Tools.Separator", globalcontext);
|
||||
m_menu->addAction(command, G_ANALYZER_REMOTE_TOOLS);
|
||||
m_menu->addAction(command, Constants::G_ANALYZER_REMOTE_TOOLS);
|
||||
|
||||
m_viewsMenu = am->actionContainer(Core::Id(Core::Constants::M_WINDOW_VIEWS));
|
||||
}
|
||||
@@ -477,8 +507,30 @@ bool AnalyzerManager::AnalyzerManagerPrivate::showPromptDialog(const QString &ti
|
||||
return messageBox.clickedStandardButton() == QDialogButtonBox::Yes;
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::startToolRemote()
|
||||
ProjectExplorer::RunControl *AnalyzerManager::AnalyzerManagerPrivate::createRunControl
|
||||
(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode)
|
||||
{
|
||||
Q_UNUSED(mode);
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
if (qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
sp = localStartParameters(runConfiguration);
|
||||
} else if (qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp = remoteLinuxStartParameters(runConfiguration);
|
||||
} else {
|
||||
// might be S60DeviceRunfiguration, or something else ...
|
||||
sp.startMode = StartRemote;
|
||||
}
|
||||
|
||||
IAnalyzerTool *tool = m_currentTool;
|
||||
AnalyzerRunControl *rc = new AnalyzerRunControl(tool, sp, runConfiguration);
|
||||
m_currentRunControl = rc;
|
||||
return rc;
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::startRemoteTool(IAnalyzerTool *tool)
|
||||
{
|
||||
Q_UNUSED(tool);
|
||||
StartRemoteDialog dlg;
|
||||
if (dlg.exec() != QDialog::Accepted)
|
||||
return;
|
||||
@@ -491,23 +543,20 @@ void AnalyzerManager::AnalyzerManagerPrivate::startToolRemote()
|
||||
sp.startMode = StartRemote;
|
||||
sp.workingDirectory = dlg.workingDirectory();
|
||||
|
||||
AnalyzerRunControl *runControl = m_runControlFactory->create(sp, 0);
|
||||
AnalyzerRunControl *runControl = new AnalyzerRunControl(tool, sp, 0);
|
||||
|
||||
m_currentRunControl = runControl;
|
||||
|
||||
QTC_ASSERT(runControl, return);
|
||||
ProjectExplorer::ProjectExplorerPlugin::instance()
|
||||
->startRunControl(runControl, Constants::MODE_ANALYZE);
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::startAction(int index)
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::startLocalTool(IAnalyzerTool *tool)
|
||||
{
|
||||
int index = indexOf(tool);
|
||||
QTC_ASSERT(index >= 0, return);
|
||||
QTC_ASSERT(index < m_actions.size(), return);
|
||||
QTC_ASSERT(index == m_currentIndex, return);
|
||||
|
||||
if (!m_actions.at(index).local) {
|
||||
startToolRemote();
|
||||
return;
|
||||
}
|
||||
QTC_ASSERT(index < m_tools.size(), return);
|
||||
QTC_ASSERT(tool == m_currentTool, return);
|
||||
|
||||
// make sure mode is shown
|
||||
q->showMode();
|
||||
@@ -543,11 +592,10 @@ void AnalyzerManager::AnalyzerManagerPrivate::startAction(int index)
|
||||
|
||||
// user selected to stop the active run. stop it, activate restart on stop
|
||||
m_restartOnStop = true;
|
||||
stopTool();
|
||||
stopTool(m_currentTool);
|
||||
return;
|
||||
}
|
||||
|
||||
IAnalyzerTool *tool = toolAt(index);
|
||||
IAnalyzerTool::ToolMode toolMode = tool->mode();
|
||||
|
||||
// Check the project for whether the build config is in the correct mode
|
||||
@@ -588,15 +636,21 @@ void AnalyzerManager::AnalyzerManagerPrivate::startAction(int index)
|
||||
updateRunActions();
|
||||
}
|
||||
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::stopTool()
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::startTool()
|
||||
{
|
||||
if (m_currentTool)
|
||||
m_currentTool->startTool();
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::stopTool(IAnalyzerTool *tool)
|
||||
{
|
||||
QTC_ASSERT(tool == m_currentTool, /**/);
|
||||
if (m_currentRunControl)
|
||||
return;
|
||||
|
||||
// be sure to call handleToolFinished only once, and only when the engine is really finished
|
||||
if (m_currentRunControl->stop() == ProjectExplorer::RunControl::StoppedSynchronously)
|
||||
handleToolFinished();
|
||||
handleToolFinished(tool);
|
||||
// else: wait for the finished() signal to trigger handleToolFinished()
|
||||
}
|
||||
|
||||
@@ -610,14 +664,20 @@ void AnalyzerManager::AnalyzerManagerPrivate::modeChanged(IMode *mode)
|
||||
m_mainWindow->setDockActionsVisible(makeVisible);
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::selectAction(int idx)
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::selectTool(int index)
|
||||
{
|
||||
selectTool(m_tools[index]);
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::selectTool(IAnalyzerTool *tool)
|
||||
{
|
||||
int idx = indexOf(tool);
|
||||
QTC_ASSERT(idx >= 0, return);
|
||||
if (m_currentIndex == idx)
|
||||
if (m_currentTool == tool)
|
||||
return;
|
||||
|
||||
if (m_currentIndex != -1) {
|
||||
IAnalyzerTool *oldTool = toolAt(m_currentIndex);
|
||||
if (m_currentTool) {
|
||||
IAnalyzerTool *oldTool = m_currentTool;
|
||||
saveToolSettings(oldTool);
|
||||
|
||||
ActionManager *am = ICore::instance()->actionManager();
|
||||
@@ -638,113 +698,81 @@ void AnalyzerManager::AnalyzerManagerPrivate::selectAction(int idx)
|
||||
oldTool->toolDeselected();
|
||||
}
|
||||
|
||||
m_currentIndex = idx;
|
||||
m_currentTool = tool;
|
||||
|
||||
m_toolBox->setCurrentIndex(idx);
|
||||
m_controlsWidget->setCurrentIndex(idx);
|
||||
|
||||
IAnalyzerTool *newTool = toolAt(idx);
|
||||
|
||||
const bool firstTime = !m_defaultSettings.contains(newTool);
|
||||
const bool firstTime = !m_defaultSettings.contains(tool);
|
||||
if (firstTime) {
|
||||
newTool->initializeDockWidgets();
|
||||
m_defaultSettings.insert(newTool, m_mainWindow->saveSettings());
|
||||
tool->initializeDockWidgets();
|
||||
m_defaultSettings.insert(tool, m_mainWindow->saveSettings());
|
||||
} else {
|
||||
foreach (QDockWidget *widget, m_toolWidgets.value(newTool))
|
||||
foreach (QDockWidget *widget, m_toolWidgets.value(tool))
|
||||
addDock(Qt::DockWidgetArea(widget->property(INITIAL_DOCK_AREA).toInt()), widget);
|
||||
}
|
||||
|
||||
loadToolSettings(newTool);
|
||||
loadToolSettings(tool);
|
||||
updateRunActions();
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::selectAction()
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::selectTool()
|
||||
{
|
||||
selectAction(qobject_cast<QAction *>(sender()));
|
||||
selectTool(qobject_cast<QAction *>(sender()));
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::selectAction(QAction *action)
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::selectTool(QAction *action)
|
||||
{
|
||||
selectAction(indexOf(action));
|
||||
}
|
||||
|
||||
int AnalyzerManager::AnalyzerManagerPrivate::indexOf(QAction *action) const
|
||||
{
|
||||
for (int i = 0; i != m_actions.size(); ++i)
|
||||
if (m_actions.at(i).action == action)
|
||||
return i;
|
||||
return -1;
|
||||
selectTool(m_toolFromAction[action]);
|
||||
}
|
||||
|
||||
int AnalyzerManager::AnalyzerManagerPrivate::indexOf(IAnalyzerTool *tool) const
|
||||
{
|
||||
for (int i = 0; i != m_actions.size(); ++i)
|
||||
if (toolAt(i) == tool)
|
||||
return i;
|
||||
return -1;
|
||||
return m_tools.indexOf(tool);
|
||||
}
|
||||
|
||||
IAnalyzerTool *AnalyzerManager::AnalyzerManagerPrivate::toolAt(int idx) const
|
||||
{
|
||||
QTC_ASSERT(idx >= 0, return 0);
|
||||
QTC_ASSERT(idx < m_actions.size(), return 0);
|
||||
return m_actions.at(idx).tool;
|
||||
QTC_ASSERT(idx < m_tools.size(), return 0);
|
||||
return m_tools.at(idx);
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::addToolAction(IAnalyzerTool *tool, bool local)
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool)
|
||||
{
|
||||
ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
delayedInit(); // be sure that there is a valid IMode instance
|
||||
|
||||
QString actionId = QString("Action.Analyzer.Tools.%1").arg(m_actions.size());
|
||||
QString displayName = tool->displayName() + (local ? QString() : tr(" (Remote)"));
|
||||
QString actionId = QString("Action.Analyzer.Tools." + tool->id());
|
||||
QString displayName = tool->displayName();
|
||||
QAction *action = new QAction(displayName, 0);
|
||||
|
||||
ToolData data;
|
||||
data.tool = tool;
|
||||
data.local = local;
|
||||
data.action = action;
|
||||
m_actions.append(data);
|
||||
qDebug() << "ACTION: " << tool << actionId;
|
||||
|
||||
Core::Command *command = am->registerAction(action, actionId,
|
||||
Core::Context(Core::Constants::C_GLOBAL));
|
||||
m_menu->addAction(command, local ? G_ANALYZER_TOOLS : G_ANALYZER_REMOTE_TOOLS);
|
||||
connect(action, SIGNAL(triggered()), SLOT(selectAction()));
|
||||
m_menu->addAction(command, QString::fromLatin1(tool->menuGroup()));
|
||||
connect(action, SIGNAL(triggered()), SLOT(selectTool()));
|
||||
|
||||
const bool blocked = m_toolBox->blockSignals(true); // Do not make current.
|
||||
m_toolBox->addItem(displayName);
|
||||
m_toolBox->blockSignals(blocked);
|
||||
m_toolBox->setEnabled(true);
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool)
|
||||
{
|
||||
delayedInit(); // be sure that there is a valid IMode instance
|
||||
m_tools.append(tool);
|
||||
if (tool->canRunLocally())
|
||||
addToolAction(tool, true);
|
||||
if (tool->canRunRemotely())
|
||||
addToolAction(tool, false);
|
||||
// Populate controls widget.
|
||||
QWidget *controlWidget = tool->createControlWidget(); // might be 0
|
||||
m_controlsWidget->addWidget(controlWidget
|
||||
? controlWidget : AnalyzerUtils::createDummyWidget());
|
||||
tool->initialize();
|
||||
m_tools.append(tool);
|
||||
m_toolFromAction[action] = tool;
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::runControlCreated(AnalyzerRunControl *rc)
|
||||
{
|
||||
QTC_ASSERT(!m_currentRunControl, /**/);
|
||||
m_currentRunControl = rc;
|
||||
connect(rc, SIGNAL(finished()), this, SLOT(handleToolFinished()));
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::handleToolFinished()
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::handleToolFinished(IAnalyzerTool *tool)
|
||||
{
|
||||
QTC_ASSERT(tool == m_currentTool, /**/);
|
||||
m_currentRunControl = 0;
|
||||
updateRunActions();
|
||||
|
||||
if (m_restartOnStop) {
|
||||
startAction(m_currentIndex);
|
||||
m_currentTool->startTool();
|
||||
m_restartOnStop = false;
|
||||
}
|
||||
}
|
||||
@@ -781,12 +809,12 @@ void AnalyzerManager::AnalyzerManagerPrivate::updateRunActions()
|
||||
|
||||
bool startEnabled = !m_currentRunControl
|
||||
&& pe->canRun(project, Constants::MODE_ANALYZE)
|
||||
&& m_currentIndex >= 0;
|
||||
&& m_currentTool >= 0;
|
||||
|
||||
QString disabledReason;
|
||||
if (m_currentRunControl)
|
||||
disabledReason = tr("An analysis is still in progress.");
|
||||
else if (m_currentIndex == -1)
|
||||
else if (!m_currentTool)
|
||||
disabledReason = tr("No analyzer tool selected.");
|
||||
else
|
||||
disabledReason = pe->cannotRunReason(project, Constants::MODE_ANALYZE);
|
||||
@@ -825,42 +853,37 @@ void AnalyzerManager::extensionsInitialized()
|
||||
const QSettings *settings = Core::ICore::instance()->settings();
|
||||
const QString lastActiveToolId =
|
||||
settings->value(QLatin1String(lastActiveToolC), QString()).toString();
|
||||
int lastAction = 0;
|
||||
IAnalyzerTool *lastTool = 0;
|
||||
|
||||
foreach (IAnalyzerTool *tool, d->m_tools) {
|
||||
tool->extensionsInitialized();
|
||||
if (tool->id() == lastActiveToolId)
|
||||
lastAction = d->indexOf(tool);
|
||||
lastTool = tool;
|
||||
}
|
||||
|
||||
d->selectAction(lastAction);
|
||||
d->selectTool(lastTool);
|
||||
}
|
||||
|
||||
void AnalyzerManager::shutdown()
|
||||
{
|
||||
d->saveToolSettings(d->m_actions[d->m_currentIndex].tool);
|
||||
}
|
||||
|
||||
AnalyzerManager *AnalyzerManager::instance()
|
||||
{
|
||||
return m_instance;
|
||||
d->saveToolSettings(d->m_currentTool);
|
||||
}
|
||||
|
||||
void AnalyzerManager::registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory)
|
||||
{
|
||||
d->registerRunControlFactory(factory);
|
||||
m_instance->d->registerRunControlFactory(factory);
|
||||
}
|
||||
|
||||
void AnalyzerManager::addTool(IAnalyzerTool *tool)
|
||||
{
|
||||
d->addTool(tool);
|
||||
m_instance->d->addTool(tool);
|
||||
}
|
||||
|
||||
QDockWidget *AnalyzerManager::createDockWidget(IAnalyzerTool *tool, const QString &title,
|
||||
QWidget *widget, Qt::DockWidgetArea area)
|
||||
{
|
||||
QTC_ASSERT(!widget->objectName().isEmpty(), return 0;);
|
||||
|
||||
QTC_ASSERT(!widget->objectName().isEmpty(), return 0);
|
||||
AnalyzerManagerPrivate *d = m_instance->d;
|
||||
QDockWidget *dockWidget = d->m_mainWindow->addDockForWidget(widget);
|
||||
dockWidget->setProperty(INITIAL_DOCK_AREA, int(area));
|
||||
d->m_dockWidgets.append(AnalyzerManagerPrivate::DockPtr(dockWidget));
|
||||
@@ -870,37 +893,30 @@ QDockWidget *AnalyzerManager::createDockWidget(IAnalyzerTool *tool, const QStrin
|
||||
return dockWidget;
|
||||
}
|
||||
|
||||
IAnalyzerEngine *AnalyzerManager::createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
IAnalyzerTool *tool = d->toolAt(d->m_currentIndex);
|
||||
QTC_ASSERT(tool, return 0);
|
||||
return tool->createEngine(sp, runConfiguration);
|
||||
}
|
||||
|
||||
void AnalyzerManager::selectTool(IAnalyzerTool *tool)
|
||||
{
|
||||
d->selectAction(d->indexOf(tool));
|
||||
m_instance->d->selectTool(tool);
|
||||
}
|
||||
|
||||
void AnalyzerManager::startTool(IAnalyzerTool *tool)
|
||||
{
|
||||
d->startAction(d->indexOf(tool));
|
||||
QTC_ASSERT(tool == m_instance->d->m_currentTool, return);
|
||||
m_instance->d->startTool();
|
||||
}
|
||||
|
||||
Utils::FancyMainWindow *AnalyzerManager::mainWindow() const
|
||||
Utils::FancyMainWindow *AnalyzerManager::mainWindow()
|
||||
{
|
||||
return d->m_mainWindow;
|
||||
return m_instance->d->m_mainWindow;
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::resetLayout()
|
||||
{
|
||||
m_mainWindow->restoreSettings(m_defaultSettings.value(toolAt(m_currentIndex)));
|
||||
m_mainWindow->restoreSettings(m_defaultSettings.value(m_currentTool));
|
||||
}
|
||||
|
||||
void AnalyzerManager::showStatusMessage(const QString &message, int timeoutMS)
|
||||
{
|
||||
d->m_statusLabel->showStatusMessage(message, timeoutMS);
|
||||
m_instance->d->m_statusLabel->showStatusMessage(message, timeoutMS);
|
||||
}
|
||||
|
||||
void AnalyzerManager::showPermanentStatusMessage(const QString &message)
|
||||
@@ -922,13 +938,43 @@ QString AnalyzerManager::msgToolFinished(const QString &name, int issuesFound)
|
||||
|
||||
void AnalyzerManager::showMode()
|
||||
{
|
||||
if (d->m_mode)
|
||||
ModeManager::instance()->activateMode(d->m_mode->id());
|
||||
if (m_instance->d->m_mode)
|
||||
ModeManager::instance()->activateMode(m_instance->d->m_mode->id());
|
||||
}
|
||||
|
||||
void AnalyzerManager::stopTool()
|
||||
void AnalyzerManager::stopTool(IAnalyzerTool *tool)
|
||||
{
|
||||
d->stopTool();
|
||||
m_instance->stopTool(tool);
|
||||
}
|
||||
|
||||
void AnalyzerManager::startLocalTool(IAnalyzerTool *tool)
|
||||
{
|
||||
m_instance->startLocalTool(tool);
|
||||
}
|
||||
|
||||
void AnalyzerManager::startRemoteTool(IAnalyzerTool *tool)
|
||||
{
|
||||
m_instance->startRemoteTool(tool);
|
||||
}
|
||||
|
||||
ProjectExplorer::RunControl *AnalyzerManager::createRunControl
|
||||
(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode)
|
||||
{
|
||||
return m_instance->createRunControl(runConfiguration, mode);
|
||||
}
|
||||
|
||||
void AnalyzerManager::handleToolFinished(IAnalyzerTool *tool)
|
||||
{
|
||||
m_instance->d->handleToolFinished(tool);
|
||||
}
|
||||
|
||||
IAnalyzerTool *AnalyzerManager::toolById(const QByteArray &id)
|
||||
{
|
||||
foreach (IAnalyzerTool *tool, m_instance->d->m_tools)
|
||||
if (tool->id() == id)
|
||||
return tool;
|
||||
QTC_ASSERT(false, qDebug() << "NO ANAYLYZER TOOL FOUND FOR ID" << id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "analyzermanager.moc"
|
||||
|
||||
@@ -48,10 +48,6 @@ namespace Utils {
|
||||
class FancyMainWindow;
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class RunConfiguration;
|
||||
}
|
||||
|
||||
namespace Analyzer {
|
||||
class IAnalyzerTool;
|
||||
class IAnalyzerEngine;
|
||||
@@ -65,37 +61,39 @@ public:
|
||||
explicit AnalyzerManager(QObject *parent = 0);
|
||||
~AnalyzerManager();
|
||||
|
||||
static AnalyzerManager *instance();
|
||||
void registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory);
|
||||
|
||||
static void registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory);
|
||||
void extensionsInitialized();
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Register a tool and initialize it.
|
||||
*/
|
||||
void addTool(Analyzer::IAnalyzerTool *tool);
|
||||
static ProjectExplorer::RunControl *createRunControl
|
||||
(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
|
||||
|
||||
// Register a tool and initialize it.
|
||||
static void addTool(Analyzer::IAnalyzerTool *tool);
|
||||
static IAnalyzerTool *toolById(const QByteArray &id);
|
||||
|
||||
// Dockwidgets are registered to the main window.
|
||||
QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title,
|
||||
static QDockWidget *createDockWidget(IAnalyzerTool *tool, const QString &title,
|
||||
QWidget *widget, Qt::DockWidgetArea area = Qt::TopDockWidgetArea);
|
||||
|
||||
Utils::FancyMainWindow *mainWindow() const;
|
||||
static Utils::FancyMainWindow *mainWindow();
|
||||
|
||||
void showMode();
|
||||
void selectTool(IAnalyzerTool *tool);
|
||||
void startTool(IAnalyzerTool *tool);
|
||||
void stopTool();
|
||||
static void showMode();
|
||||
static void selectTool(IAnalyzerTool *tool);
|
||||
static void startTool(IAnalyzerTool *tool);
|
||||
static void stopTool(IAnalyzerTool *tool);
|
||||
|
||||
// Convienience functions.
|
||||
static void startLocalTool(IAnalyzerTool *tool);
|
||||
static void startRemoteTool(IAnalyzerTool *tool);
|
||||
|
||||
static QString msgToolStarted(const QString &name);
|
||||
static QString msgToolFinished(const QString &name, int issuesFound);
|
||||
|
||||
IAnalyzerEngine *createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
static void showStatusMessage(const QString &message, int timeoutMS = 10000);
|
||||
static void showPermanentStatusMessage(const QString &message);
|
||||
|
||||
public slots:
|
||||
void showStatusMessage(const QString &message, int timeoutMS = 10000);
|
||||
void showPermanentStatusMessage(const QString &message);
|
||||
static void handleToolFinished(IAnalyzerTool *tool);
|
||||
|
||||
private:
|
||||
class AnalyzerManagerPrivate;
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <coreplugin/ioutputpane.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
using namespace Analyzer;
|
||||
|
||||
@@ -67,12 +68,12 @@ AnalyzerRunControl::Private::Private()
|
||||
|
||||
|
||||
// AnalyzerRunControl ////////////////////////////////////////////////////
|
||||
AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
AnalyzerRunControl::AnalyzerRunControl(IAnalyzerTool *tool,
|
||||
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||
: RunControl(runConfiguration, Constants::MODE_ANALYZE),
|
||||
d(new Private)
|
||||
{
|
||||
d->m_engine = AnalyzerManager::instance()->createEngine(sp, runConfiguration);
|
||||
d->m_engine = tool->createEngine(sp, runConfiguration);
|
||||
|
||||
if (!d->m_engine)
|
||||
return;
|
||||
@@ -83,6 +84,7 @@ AnalyzerRunControl::AnalyzerRunControl(const AnalyzerStartParameters &sp,
|
||||
SLOT(addTask(ProjectExplorer::Task::TaskType,QString,QString,int)));
|
||||
connect(d->m_engine, SIGNAL(finished()),
|
||||
SLOT(engineFinished()));
|
||||
connect(this, SIGNAL(finished()), SLOT(runControlFinished()), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
AnalyzerRunControl::~AnalyzerRunControl()
|
||||
@@ -127,6 +129,11 @@ void AnalyzerRunControl::engineFinished()
|
||||
emit finished();
|
||||
}
|
||||
|
||||
void AnalyzerRunControl::runControlFinished()
|
||||
{
|
||||
AnalyzerManager::handleToolFinished(d->m_engine->tool());
|
||||
}
|
||||
|
||||
bool AnalyzerRunControl::isRunning() const
|
||||
{
|
||||
return d->m_isRunning;
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
namespace Analyzer {
|
||||
|
||||
class AnalyzerStartParameters;
|
||||
class IAnalyzerTool;
|
||||
|
||||
class ANALYZER_EXPORT AnalyzerRunControl: public ProjectExplorer::RunControl
|
||||
{
|
||||
@@ -52,8 +53,8 @@ class ANALYZER_EXPORT AnalyzerRunControl: public ProjectExplorer::RunControl
|
||||
|
||||
public:
|
||||
typedef ProjectExplorer::RunConfiguration RunConfiguration;
|
||||
// the constructor is likely to gain more arguments later
|
||||
explicit AnalyzerRunControl(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration);
|
||||
AnalyzerRunControl(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration);
|
||||
~AnalyzerRunControl();
|
||||
|
||||
// pure virtuals from ProjectExplorer::RunControl
|
||||
@@ -70,6 +71,7 @@ private slots:
|
||||
const QString &file, int line);
|
||||
|
||||
void engineFinished();
|
||||
void runControlFinished();
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
||||
@@ -33,59 +33,25 @@
|
||||
#include "analyzerruncontrolfactory.h"
|
||||
#include "analyzerruncontrol.h"
|
||||
#include "analyzerconstants.h"
|
||||
#include "analyzermanager.h"
|
||||
#include "analyzerrunconfigwidget.h"
|
||||
#include "analyzersettings.h"
|
||||
#include "analyzerstartparameters.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <projectexplorer/applicationrunconfiguration.h>
|
||||
|
||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||
#include <remotelinux/remotelinuxrunconfiguration.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace Analyzer::Internal;
|
||||
|
||||
AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerStartParameters sp;
|
||||
QTC_ASSERT(runConfiguration, return sp);
|
||||
ProjectExplorer::LocalApplicationRunConfiguration *rc =
|
||||
qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc, return sp);
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AnalyzerRunControlFactory
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
sp.startMode = StartLocal;
|
||||
sp.environment = rc->environment();
|
||||
sp.workingDirectory = rc->workingDirectory();
|
||||
sp.debuggee = rc->executable();
|
||||
sp.debuggeeArgs = rc->commandLineArguments();
|
||||
sp.displayName = rc->displayName();
|
||||
sp.connParams.host = QLatin1String("localhost");
|
||||
sp.connParams.port = rc->qmlDebugServerPort();
|
||||
return sp;
|
||||
}
|
||||
|
||||
AnalyzerStartParameters remoteLinuxStartParameters(ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerStartParameters sp;
|
||||
RemoteLinux::RemoteLinuxRunConfiguration * const rc
|
||||
= qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc, return sp);
|
||||
|
||||
sp.debuggee = rc->remoteExecutableFilePath();
|
||||
sp.debuggeeArgs = rc->arguments();
|
||||
sp.connParams = rc->deviceConfig()->sshParameters();
|
||||
sp.analyzerCmdPrefix = rc->commandPrefix();
|
||||
sp.startMode = StartRemote;
|
||||
sp.displayName = rc->displayName();
|
||||
return sp;
|
||||
}
|
||||
|
||||
|
||||
// AnalyzerRunControlFactory ////////////////////////////////////////////////////
|
||||
AnalyzerRunControlFactory::AnalyzerRunControlFactory(QObject *parent)
|
||||
: IRunControlFactory(parent)
|
||||
{
|
||||
@@ -100,26 +66,7 @@ ProjectExplorer::RunControl *AnalyzerRunControlFactory::create(RunConfiguration
|
||||
const QString &mode)
|
||||
{
|
||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
if (qobject_cast<ProjectExplorer::LocalApplicationRunConfiguration *>(runConfiguration)) {
|
||||
sp = localStartParameters(runConfiguration);
|
||||
} else if (qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
|
||||
sp = remoteLinuxStartParameters(runConfiguration);
|
||||
} else {
|
||||
// might be S60DeviceRunfiguration, or something else ...
|
||||
sp.startMode = StartRemote;
|
||||
}
|
||||
|
||||
return create(sp, runConfiguration);
|
||||
}
|
||||
|
||||
AnalyzerRunControl *AnalyzerRunControlFactory::create(const AnalyzerStartParameters &sp,
|
||||
RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerRunControl *rc = new AnalyzerRunControl(sp, runConfiguration);
|
||||
emit runControlCreated(rc);
|
||||
return rc;
|
||||
return AnalyzerManager::createRunControl(runConfiguration, mode);
|
||||
}
|
||||
|
||||
QString AnalyzerRunControlFactory::displayName() const
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace Analyzer {
|
||||
|
||||
class AnalyzerRunControl;
|
||||
class AnalyzerStartParameters;
|
||||
class IAnalyzerTool;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
@@ -52,10 +53,9 @@ public:
|
||||
typedef ProjectExplorer::RunConfiguration RunConfiguration;
|
||||
typedef ProjectExplorer::RunControl RunControl;
|
||||
|
||||
// virtuals from IRunControlFactory
|
||||
// IRunControlFactory
|
||||
bool canRun(RunConfiguration *runConfiguration, const QString &mode) const;
|
||||
RunControl *create(RunConfiguration *runConfiguration, const QString &mode);
|
||||
AnalyzerRunControl *create(const AnalyzerStartParameters &sp, RunConfiguration *rc = 0);
|
||||
QString displayName() const;
|
||||
|
||||
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
||||
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
AnalyzerStartMode startMode;
|
||||
Utils::SshConnectionParameters connParams;
|
||||
|
||||
QByteArray toolId;
|
||||
QString debuggee;
|
||||
QString debuggeeArgs;
|
||||
QString analyzerCmdPrefix;
|
||||
|
||||
@@ -36,21 +36,12 @@
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
IAnalyzerEngine::IAnalyzerEngine(const AnalyzerStartParameters &sp,
|
||||
IAnalyzerEngine::IAnalyzerEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: m_runConfig(runConfiguration)
|
||||
, m_sp(sp)
|
||||
{
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration *IAnalyzerEngine::runConfiguration() const
|
||||
{
|
||||
return m_runConfig;
|
||||
}
|
||||
|
||||
AnalyzerStartParameters IAnalyzerEngine::startParameters() const
|
||||
{
|
||||
return m_sp;
|
||||
m_runConfig = runConfiguration;
|
||||
m_sp = sp;
|
||||
m_tool = tool;
|
||||
}
|
||||
|
||||
} // namespace Analyzer
|
||||
|
||||
@@ -51,6 +51,8 @@ class RunConfiguration;
|
||||
|
||||
namespace Analyzer {
|
||||
|
||||
class IAnalyzerTool;
|
||||
|
||||
/**
|
||||
* An IAnalyzerEngine instance handles the launch of an analyzation tool.
|
||||
*
|
||||
@@ -61,40 +63,44 @@ class ANALYZER_EXPORT IAnalyzerEngine : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit IAnalyzerEngine(const AnalyzerStartParameters &sp,
|
||||
IAnalyzerEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
/// start analyzation process
|
||||
/// Start analyzation process.
|
||||
virtual void start() = 0;
|
||||
/// trigger async stop of the analyzation process
|
||||
/// Trigger async stop of the analyzation process.
|
||||
virtual void stop() = 0;
|
||||
|
||||
/// controller actions
|
||||
/// Controller actions.
|
||||
virtual bool canPause() const { return false; }
|
||||
virtual void pause() {}
|
||||
virtual void unpause() {}
|
||||
|
||||
/// the active run configuration for this engine, might be zero
|
||||
ProjectExplorer::RunConfiguration *runConfiguration() const;
|
||||
/// The active run configuration for this engine, might be zero.
|
||||
ProjectExplorer::RunConfiguration *runConfiguration() const { return m_runConfig; }
|
||||
|
||||
/// the start parameters for this engine
|
||||
AnalyzerStartParameters startParameters() const;
|
||||
/// The start parameters for this engine.
|
||||
const AnalyzerStartParameters &startParameters() const { return m_sp; }
|
||||
|
||||
/// The tool this engine is associated with.
|
||||
IAnalyzerTool *tool() { return m_tool; }
|
||||
|
||||
signals:
|
||||
/// should be emitted when the debuggee outputted something
|
||||
/// Should be emitted when the debuggee outputted something.
|
||||
void outputReceived(const QString &, Utils::OutputFormat format);
|
||||
/// can be emitted when you want to show a task, e.g. to display an error
|
||||
/// Can be emitted when you want to show a task, e.g. to display an error.
|
||||
void taskToBeAdded(ProjectExplorer::Task::TaskType type, const QString &description,
|
||||
const QString &file, int line);
|
||||
|
||||
/// must be emitted when the engine finished
|
||||
/// Must be emitted when the engine finished.
|
||||
void finished();
|
||||
/// must be emitted when the engine is starting
|
||||
/// Must be emitted when the engine is starting.
|
||||
void starting(const Analyzer::IAnalyzerEngine *);
|
||||
|
||||
private:
|
||||
ProjectExplorer::RunConfiguration *m_runConfig;
|
||||
AnalyzerStartParameters m_sp;
|
||||
IAnalyzerTool *m_tool;
|
||||
};
|
||||
|
||||
} // namespace Analyzer
|
||||
|
||||
@@ -67,11 +67,13 @@ public:
|
||||
explicit IAnalyzerTool(QObject *parent = 0);
|
||||
|
||||
/// Returns a unique ID for this tool.
|
||||
virtual QString id() const = 0;
|
||||
virtual QByteArray id() const = 0;
|
||||
/// Returns a short user readable display name for this tool.
|
||||
virtual QString displayName() const = 0;
|
||||
/// Returns a user readable description name for this tool.
|
||||
virtual QString description() const = 0;
|
||||
/// Returns the name of the menu group of the start action.
|
||||
virtual QByteArray menuGroup() const = 0;
|
||||
|
||||
/**
|
||||
* The mode in which this tool should preferably be run
|
||||
@@ -89,11 +91,6 @@ public:
|
||||
|
||||
static QString modeString(ToolMode mode);
|
||||
|
||||
/**
|
||||
* The implementation should setup widgets for the output pane here and
|
||||
* optionally add dock widgets in the analyzation mode if wanted.
|
||||
*/
|
||||
virtual void initialize() = 0;
|
||||
/// This gets called after all analyzation tools where initialized.
|
||||
virtual void extensionsInitialized() = 0;
|
||||
|
||||
@@ -112,11 +109,8 @@ public:
|
||||
virtual IAnalyzerEngine *createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0) = 0;
|
||||
|
||||
/// Returns true when this tool can be run on the loca machine.
|
||||
virtual bool canRunLocally() const = 0;
|
||||
|
||||
/// Returns true when this tool can be run on a remote machine.
|
||||
virtual bool canRunRemotely() const = 0;
|
||||
/// Starts the tool.
|
||||
virtual void startTool() = 0;
|
||||
|
||||
/// Called when tools gets selected.
|
||||
virtual void toolSelected() const {}
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
using namespace Analyzer;
|
||||
|
||||
namespace QmlProfiler {
|
||||
namespace Internal {
|
||||
|
||||
@@ -65,12 +67,12 @@ public:
|
||||
|
||||
bool attach(const QString &address, uint port);
|
||||
static AbstractQmlProfilerRunner *createRunner(ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
const Analyzer::AnalyzerStartParameters &m_params,
|
||||
const AnalyzerStartParameters &m_params,
|
||||
QObject *parent);
|
||||
|
||||
QmlProfilerEngine *q;
|
||||
|
||||
Analyzer::AnalyzerStartParameters m_params;
|
||||
AnalyzerStartParameters m_params;
|
||||
AbstractQmlProfilerRunner *m_runner;
|
||||
bool m_running;
|
||||
bool m_fetchingData;
|
||||
@@ -79,11 +81,11 @@ public:
|
||||
|
||||
AbstractQmlProfilerRunner *
|
||||
QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunConfiguration *configuration,
|
||||
const Analyzer::AnalyzerStartParameters &m_params,
|
||||
const AnalyzerStartParameters &m_params,
|
||||
QObject *parent)
|
||||
{
|
||||
AbstractQmlProfilerRunner *runner = 0;
|
||||
if (m_params.startMode == Analyzer::StartLocal) {
|
||||
if (m_params.startMode == StartLocal) {
|
||||
LocalQmlProfilerRunner::Configuration configuration;
|
||||
configuration.executable = m_params.debuggee;
|
||||
configuration.executableArguments = m_params.debuggeeArgs;
|
||||
@@ -92,7 +94,7 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
|
||||
configuration.port = m_params.connParams.port;
|
||||
|
||||
runner = new LocalQmlProfilerRunner(configuration, parent);
|
||||
} else if (m_params.startMode == Analyzer::StartRemote) {
|
||||
} else if (m_params.startMode == StartRemote) {
|
||||
if (Qt4ProjectManager::S60DeviceRunConfiguration *s60Config
|
||||
= qobject_cast<Qt4ProjectManager::S60DeviceRunConfiguration*>(configuration)) {
|
||||
runner = new CodaQmlProfilerRunner(s60Config, parent);
|
||||
@@ -108,9 +110,9 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo
|
||||
// QmlProfilerEngine
|
||||
//
|
||||
|
||||
QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
QmlProfilerEngine::QmlProfilerEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: IAnalyzerEngine(sp, runConfiguration)
|
||||
: IAnalyzerEngine(tool, sp, runConfiguration)
|
||||
, d(new QmlProfilerEnginePrivate(this))
|
||||
{
|
||||
d->m_params = sp;
|
||||
@@ -157,7 +159,7 @@ void QmlProfilerEngine::stop()
|
||||
void QmlProfilerEngine::stopped()
|
||||
{
|
||||
d->m_running = false;
|
||||
Analyzer::AnalyzerManager::instance()->stopTool();
|
||||
AnalyzerManager::stopTool(tool());
|
||||
emit finished();
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,9 @@ namespace Internal {
|
||||
class QmlProfilerEngine : public Analyzer::IAnalyzerEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
QmlProfilerEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
~QmlProfilerEngine();
|
||||
|
||||
|
||||
@@ -32,98 +32,59 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "qmlprofilerplugin.h"
|
||||
#include "qmlprofilerconstants.h"
|
||||
#include "qmlprojectanalyzerruncontrolfactory.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include "qmlprofilertool.h"
|
||||
#include "qmlprojectanalyzerruncontrolfactory.h"
|
||||
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QtGui/QMenu>
|
||||
|
||||
#include <QtCore/QtPlugin>
|
||||
|
||||
#include "qmlprofilertool.h"
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace QmlProfiler::Internal;
|
||||
|
||||
QmlProfilerPlugin *QmlProfilerPlugin::m_instance = 0;
|
||||
bool QmlProfilerPlugin::debugOutput = false;
|
||||
|
||||
|
||||
class QmlProfilerPlugin::QmlProfilerPluginPrivate
|
||||
{
|
||||
public:
|
||||
QmlProfilerPluginPrivate(QmlProfilerPlugin *qq):
|
||||
q(qq)
|
||||
{}
|
||||
|
||||
void initialize(const QStringList &arguments, QString *errorString);
|
||||
|
||||
QmlProjectAnalyzerRunControlFactory *m_runControlFactory;
|
||||
QmlProfilerPlugin *q;
|
||||
};
|
||||
|
||||
void QmlProfilerPlugin::QmlProfilerPluginPrivate::initialize(const QStringList &arguments, QString *errorString)
|
||||
{
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
m_runControlFactory = new QmlProjectAnalyzerRunControlFactory();
|
||||
Analyzer::AnalyzerManager::instance()->registerRunControlFactory(m_runControlFactory);
|
||||
}
|
||||
|
||||
|
||||
|
||||
QmlProfilerPlugin::QmlProfilerPlugin()
|
||||
: d(new QmlProfilerPluginPrivate(this))
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
: d(new QmlProfilerPluginPrivate())
|
||||
{}
|
||||
|
||||
QmlProfilerPlugin::~QmlProfilerPlugin()
|
||||
{
|
||||
delete d;
|
||||
m_instance = 0;
|
||||
}
|
||||
|
||||
bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||
{
|
||||
d->initialize(arguments, errorString);
|
||||
|
||||
AnalyzerManager::instance()->addTool(new QmlProfilerTool(this));
|
||||
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
d->m_runControlFactory = new QmlProjectAnalyzerRunControlFactory();
|
||||
AnalyzerManager::registerRunControlFactory(d->m_runControlFactory);
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(true, this));
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(false, this));
|
||||
return true;
|
||||
}
|
||||
|
||||
void QmlProfilerPlugin::extensionsInitialized()
|
||||
{
|
||||
// Retrieve objects from the plugin manager's object pool
|
||||
// Retrieve objects from the plugin manager's object pool.
|
||||
// "In the extensionsInitialized method, a plugin can be sure that all
|
||||
// plugins that depend on it are completely initialized."
|
||||
}
|
||||
|
||||
ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
|
||||
{
|
||||
// Save settings
|
||||
// Save settings.
|
||||
// Disconnect from signals that are not needed during shutdown
|
||||
// Hide UI (if you add UI that is not in the main window directly)
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
|
||||
QmlProfilerPlugin *QmlProfilerPlugin::instance()
|
||||
{
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN(QmlProfilerPlugin)
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@ class QmlProfilerPlugin : public ExtensionSystem::IPlugin
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static QmlProfilerPlugin *instance();
|
||||
|
||||
QmlProfilerPlugin();
|
||||
~QmlProfilerPlugin();
|
||||
|
||||
@@ -60,8 +58,6 @@ public:
|
||||
private:
|
||||
class QmlProfilerPluginPrivate;
|
||||
QmlProfilerPluginPrivate *d;
|
||||
|
||||
static QmlProfilerPlugin *m_instance;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -92,6 +92,7 @@ public:
|
||||
|
||||
QmlProfilerTool *q;
|
||||
|
||||
bool m_local;
|
||||
QDeclarativeDebugConnection *m_client;
|
||||
QTimer m_connectionTimer;
|
||||
int m_connectionAttempts;
|
||||
@@ -118,9 +119,10 @@ public:
|
||||
QString m_ostDevice;
|
||||
};
|
||||
|
||||
QmlProfilerTool::QmlProfilerTool(QObject *parent)
|
||||
QmlProfilerTool::QmlProfilerTool(bool local, QObject *parent)
|
||||
: IAnalyzerTool(parent), d(new QmlProfilerToolPrivate(this))
|
||||
{
|
||||
d->m_local = local;
|
||||
d->m_client = 0;
|
||||
d->m_connectionAttempts = 0;
|
||||
d->m_traceWindow = 0;
|
||||
@@ -132,6 +134,13 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
|
||||
|
||||
d->m_connectionTimer.setInterval(200);
|
||||
connect(&d->m_connectionTimer, SIGNAL(timeout()), SLOT(tryToConnect()));
|
||||
|
||||
qmlRegisterType<Canvas>("Monitor", 1, 0, "Canvas");
|
||||
qmlRegisterType<TiledCanvas>("Monitor", 1, 0, "TiledCanvas");
|
||||
qmlRegisterType<Context2D>();
|
||||
qmlRegisterType<CanvasImage>();
|
||||
qmlRegisterType<CanvasGradient>();
|
||||
qmlRegisterType<TimelineView>("Monitor", 1, 0,"TimelineView");
|
||||
}
|
||||
|
||||
QmlProfilerTool::~QmlProfilerTool()
|
||||
@@ -140,14 +149,26 @@ QmlProfilerTool::~QmlProfilerTool()
|
||||
delete d;
|
||||
}
|
||||
|
||||
QString QmlProfilerTool::id() const
|
||||
QByteArray QmlProfilerTool::id() const
|
||||
{
|
||||
return "QmlProfiler";
|
||||
return d->m_local ? "QmlLocalProfiler" : "QmlRemoteProfiler";
|
||||
}
|
||||
|
||||
QString QmlProfilerTool::displayName() const
|
||||
{
|
||||
return tr("QML Profiler");
|
||||
return d->m_local ? tr("QML Profiler") : tr("QML Profiler (Remote)");
|
||||
}
|
||||
|
||||
QByteArray QmlProfilerTool::menuGroup() const
|
||||
{
|
||||
return d->m_local ? Analyzer::Constants::G_ANALYZER_TOOLS
|
||||
: Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
|
||||
}
|
||||
|
||||
void QmlProfilerTool::startTool()
|
||||
{
|
||||
return d->m_local ? AnalyzerManager::startLocalTool(this)
|
||||
: AnalyzerManager::startRemoteTool(this);
|
||||
}
|
||||
|
||||
QString QmlProfilerTool::description() const
|
||||
@@ -164,7 +185,7 @@ IAnalyzerTool::ToolMode QmlProfilerTool::mode() const
|
||||
IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration);
|
||||
QmlProfilerEngine *engine = new QmlProfilerEngine(this, sp, runConfiguration);
|
||||
|
||||
// Check minimum Qt Version. We cannot really be sure what the Qt version
|
||||
// at runtime is, but guess that the active build configuraiton has been used.
|
||||
@@ -218,24 +239,9 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp
|
||||
return engine;
|
||||
}
|
||||
|
||||
void QmlProfilerTool::initialize()
|
||||
{
|
||||
qmlRegisterType<Canvas>("Monitor", 1, 0, "Canvas");
|
||||
qmlRegisterType<TiledCanvas>("Monitor", 1, 0, "TiledCanvas");
|
||||
qmlRegisterType<Context2D>();
|
||||
qmlRegisterType<CanvasImage>();
|
||||
qmlRegisterType<CanvasGradient>();
|
||||
qmlRegisterType<TimelineView>("Monitor", 1, 0,"TimelineView");
|
||||
}
|
||||
|
||||
void QmlProfilerTool::extensionsInitialized()
|
||||
{
|
||||
}
|
||||
|
||||
void QmlProfilerTool::initializeDockWidgets()
|
||||
{
|
||||
Analyzer::AnalyzerManager *analyzerMgr = Analyzer::AnalyzerManager::instance();
|
||||
Utils::FancyMainWindow *mw = analyzerMgr->mainWindow();
|
||||
Utils::FancyMainWindow *mw = AnalyzerManager::mainWindow();
|
||||
|
||||
d->m_traceWindow = new TraceWindow(mw);
|
||||
d->m_traceWindow->reset(d->m_client);
|
||||
@@ -282,21 +288,14 @@ void QmlProfilerTool::initializeDockWidgets()
|
||||
|
||||
updateAttachAction(false);
|
||||
|
||||
QDockWidget *summaryDock =
|
||||
analyzerMgr->createDockWidget(this, tr("Bindings"),
|
||||
d->m_summary, Qt::BottomDockWidgetArea);
|
||||
|
||||
QDockWidget *timelineDock =
|
||||
analyzerMgr->createDockWidget(this, tr("Timeline"),
|
||||
d->m_traceWindow, Qt::BottomDockWidgetArea);
|
||||
|
||||
QDockWidget *calleeDock =
|
||||
analyzerMgr->createDockWidget(this, tr("Callees"),
|
||||
d->m_calleetree, Qt::BottomDockWidgetArea);
|
||||
|
||||
QDockWidget *callerDock =
|
||||
analyzerMgr->createDockWidget(this, tr("Callers"),
|
||||
d->m_callertree, Qt::BottomDockWidgetArea);
|
||||
QDockWidget *summaryDock = AnalyzerManager::createDockWidget
|
||||
(this, tr("Bindings"), d->m_summary, Qt::BottomDockWidgetArea);
|
||||
QDockWidget *timelineDock = AnalyzerManager::createDockWidget
|
||||
(this, tr("Timeline"), d->m_traceWindow, Qt::BottomDockWidgetArea);
|
||||
QDockWidget *calleeDock = AnalyzerManager::createDockWidget
|
||||
(this, tr("Callees"), d->m_calleetree, Qt::BottomDockWidgetArea);
|
||||
QDockWidget *callerDock = AnalyzerManager::createDockWidget
|
||||
(this, tr("Callers"), d->m_callertree, Qt::BottomDockWidgetArea);
|
||||
|
||||
mw->splitDockWidget(mw->toolBarDockWidget(), summaryDock, Qt::Vertical);
|
||||
mw->tabifyDockWidget(summaryDock, timelineDock);
|
||||
@@ -447,17 +446,6 @@ void QmlProfilerTool::updateProjectFileList()
|
||||
d->m_project->files(ProjectExplorer::Project::ExcludeGeneratedFiles));
|
||||
}
|
||||
|
||||
bool QmlProfilerTool::canRunRemotely() const
|
||||
{
|
||||
// TODO: Is this correct?
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QmlProfilerTool::canRunLocally() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void QmlProfilerTool::clearDisplay()
|
||||
{
|
||||
d->m_traceWindow->clearDisplay();
|
||||
@@ -479,7 +467,7 @@ void QmlProfilerTool::attach()
|
||||
d->m_tcpHost = dialog.address();
|
||||
|
||||
connectClient(d->m_tcpPort);
|
||||
AnalyzerManager::instance()->showMode();
|
||||
AnalyzerManager::showMode();
|
||||
} else {
|
||||
stopRecording();
|
||||
}
|
||||
|
||||
@@ -45,28 +45,26 @@ class QmlProfilerTool : public Analyzer::IAnalyzerTool
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QmlProfilerTool(QObject *parent = 0);
|
||||
QmlProfilerTool(bool local, QObject *parent);
|
||||
~QmlProfilerTool();
|
||||
|
||||
QString id() const;
|
||||
QByteArray id() const;
|
||||
QString displayName() const;
|
||||
QByteArray menuGroup() const;
|
||||
QString description() const;
|
||||
ToolMode mode() const;
|
||||
|
||||
void initialize();
|
||||
void extensionsInitialized();
|
||||
void extensionsInitialized() {}
|
||||
void initializeDockWidgets();
|
||||
void toolSelected();
|
||||
void toolDeselected();
|
||||
void startTool();
|
||||
|
||||
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
QWidget *createControlWidget();
|
||||
|
||||
bool canRunRemotely() const;
|
||||
bool canRunLocally() const;
|
||||
|
||||
public slots:
|
||||
void connectClient(int port);
|
||||
void disconnectClient();
|
||||
|
||||
@@ -33,7 +33,9 @@
|
||||
|
||||
#include "qmlprojectanalyzerruncontrolfactory.h"
|
||||
#include "qmlprojectmanager/qmlprojectrunconfiguration.h"
|
||||
|
||||
#include <analyzerbase/analyzerstartparameters.h>
|
||||
#include <analyzerbase/analyzermanager.h>
|
||||
#include <analyzerbase/analyzersettings.h>
|
||||
#include <analyzerbase/analyzerrunconfigwidget.h>
|
||||
|
||||
@@ -51,6 +53,7 @@ AnalyzerStartParameters localStartParameters(ProjectExplorer::RunConfiguration *
|
||||
qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration);
|
||||
QTC_ASSERT(rc, return sp);
|
||||
|
||||
sp.toolId = "QmlProfiler";
|
||||
sp.startMode = StartLocal;
|
||||
sp.environment = rc->environment();
|
||||
sp.workingDirectory = rc->workingDirectory();
|
||||
@@ -76,19 +79,15 @@ bool QmlProjectAnalyzerRunControlFactory::canRun(RunConfiguration *runConfigurat
|
||||
|
||||
RunControl *QmlProjectAnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, const QString &mode)
|
||||
{
|
||||
if (!qobject_cast<QmlProjectManager::QmlProjectRunConfiguration *>(runConfiguration)
|
||||
|| mode != Constants::MODE_ANALYZE) {
|
||||
return 0;
|
||||
}
|
||||
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
|
||||
const AnalyzerStartParameters sp = localStartParameters(runConfiguration);
|
||||
return create(sp, runConfiguration);
|
||||
}
|
||||
|
||||
AnalyzerRunControl *QmlProjectAnalyzerRunControlFactory::create(const Analyzer::AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||
AnalyzerRunControl *QmlProjectAnalyzerRunControlFactory::create
|
||||
(const Analyzer::AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||
{
|
||||
AnalyzerRunControl *rc = new AnalyzerRunControl(sp, runConfiguration);
|
||||
emit runControlCreated(rc);
|
||||
return rc;
|
||||
return new AnalyzerRunControl(AnalyzerManager::toolById(sp.toolId), sp, runConfiguration);
|
||||
}
|
||||
|
||||
QString QmlProjectAnalyzerRunControlFactory::displayName() const
|
||||
@@ -113,6 +112,7 @@ RunConfigWidget *QmlProjectAnalyzerRunControlFactory::createConfigurationWidget(
|
||||
return 0;
|
||||
|
||||
Analyzer::AnalyzerRunConfigWidget *ret = new Analyzer::AnalyzerRunConfigWidget;
|
||||
|
||||
ret->setRunConfiguration(runConfiguration);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -51,10 +51,12 @@ public:
|
||||
QmlProjectAnalyzerRunControlFactory(QObject *parent = 0);
|
||||
|
||||
// IRunControlFactory implementation
|
||||
QString displayName() const;
|
||||
bool canRun(RunConfiguration *runConfiguration, const QString &mode) const;
|
||||
ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration, const QString &mode);
|
||||
Analyzer::AnalyzerRunControl *create(const Analyzer::AnalyzerStartParameters &sp, RunConfiguration *runConfiguration = 0);
|
||||
QString displayName() const;
|
||||
|
||||
// FIXME: Remove function.
|
||||
Analyzer::AnalyzerRunControl *create(const Analyzer::AnalyzerStartParameters &sp, RunConfiguration *runConfiguration);
|
||||
|
||||
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
|
||||
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
|
||||
|
||||
@@ -45,22 +45,24 @@ using namespace Analyzer;
|
||||
using namespace Valgrind;
|
||||
using namespace Valgrind::Internal;
|
||||
|
||||
CallgrindEngine::CallgrindEngine(const AnalyzerStartParameters &sp,
|
||||
CallgrindEngine::CallgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: ValgrindEngine(sp, runConfiguration)
|
||||
: ValgrindEngine(tool, sp, runConfiguration)
|
||||
, m_markAsPaused(false)
|
||||
{
|
||||
connect(&m_runner, SIGNAL(finished()), this, SLOT(slotFinished()));
|
||||
connect(&m_runner, SIGNAL(started()), this, SLOT(slotStarted()));
|
||||
|
||||
connect(m_runner.parser(), SIGNAL(parserDataReady()), this, SLOT(slotFinished()));
|
||||
|
||||
connect(&m_runner, SIGNAL(statusMessage(QString)),
|
||||
Analyzer::AnalyzerManager::instance(), SLOT(showStatusMessage(QString)));
|
||||
connect(&m_runner, SIGNAL(statusMessage(QString)), SLOT(showStatusMessage(QString)));
|
||||
|
||||
m_progress->setProgressRange(0, 2);
|
||||
}
|
||||
|
||||
void CallgrindEngine::showStatusMessage(const QString &msg)
|
||||
{
|
||||
AnalyzerManager::showStatusMessage(msg);
|
||||
}
|
||||
|
||||
QStringList CallgrindEngine::toolArguments() const
|
||||
{
|
||||
QStringList arguments;
|
||||
|
||||
@@ -46,7 +46,7 @@ class CallgrindEngine : public Valgrind::Internal::ValgrindEngine
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CallgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
CallgrindEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
|
||||
void start();
|
||||
@@ -79,15 +79,16 @@ protected:
|
||||
signals:
|
||||
void parserDataReady(CallgrindEngine *engine);
|
||||
|
||||
private slots:
|
||||
void slotFinished();
|
||||
void slotStarted();
|
||||
void showStatusMessage(const QString &msg);
|
||||
|
||||
private:
|
||||
Valgrind::Callgrind::CallgrindRunner m_runner;
|
||||
bool m_markAsPaused;
|
||||
|
||||
QStringList m_extraArguments;
|
||||
|
||||
private slots:
|
||||
void slotFinished();
|
||||
void slotStarted();
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -175,6 +175,7 @@ public slots:
|
||||
public:
|
||||
CallgrindTool *q;
|
||||
|
||||
bool m_local;
|
||||
DataModel *m_dataModel;
|
||||
DataProxyModel *m_proxyModel;
|
||||
StackBrowser *m_stackBrowser;
|
||||
@@ -217,6 +218,7 @@ public:
|
||||
|
||||
CallgrindToolPrivate::CallgrindToolPrivate(CallgrindTool *parent)
|
||||
: q(parent)
|
||||
, m_local(true)
|
||||
, m_dataModel(new DataModel(this))
|
||||
, m_proxyModel(new DataProxyModel(this))
|
||||
, m_stackBrowser(new StackBrowser(this))
|
||||
@@ -497,10 +499,11 @@ static QToolButton *createToolButton(QAction *action)
|
||||
return button;
|
||||
}
|
||||
|
||||
CallgrindTool::CallgrindTool(QObject *parent)
|
||||
CallgrindTool::CallgrindTool(bool local, QObject *parent)
|
||||
: Analyzer::IAnalyzerTool(parent)
|
||||
{
|
||||
d = new CallgrindToolPrivate(this);
|
||||
d->m_local = local;
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
|
||||
// EditorManager
|
||||
@@ -514,14 +517,21 @@ CallgrindTool::~CallgrindTool()
|
||||
delete d;
|
||||
}
|
||||
|
||||
QString CallgrindTool::id() const
|
||||
QByteArray CallgrindTool::id() const
|
||||
{
|
||||
return "Callgrind";
|
||||
return d->m_local ? "CallgrindLocal" : "CallgrindRemote";
|
||||
}
|
||||
|
||||
QString CallgrindTool::displayName() const
|
||||
{
|
||||
return tr("Valgrind Function Profile");
|
||||
return d->m_local ? tr("Valgrind Function Profile")
|
||||
: tr("Valgrind Function Profile (Remote)");
|
||||
}
|
||||
|
||||
QByteArray CallgrindTool::menuGroup() const
|
||||
{
|
||||
return d->m_local ? Analyzer::Constants::G_ANALYZER_TOOLS
|
||||
: Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
|
||||
}
|
||||
|
||||
QString CallgrindTool::description() const
|
||||
@@ -530,15 +540,19 @@ QString CallgrindTool::description() const
|
||||
"record function calls when a program runs.");
|
||||
}
|
||||
|
||||
void CallgrindTool::startTool()
|
||||
{
|
||||
if (d->m_local)
|
||||
AnalyzerManager::startLocalTool(this);
|
||||
else
|
||||
AnalyzerManager::startRemoteTool(this);
|
||||
}
|
||||
|
||||
IAnalyzerTool::ToolMode CallgrindTool::mode() const
|
||||
{
|
||||
return ReleaseMode;
|
||||
}
|
||||
|
||||
void CallgrindTool::initialize()
|
||||
{
|
||||
}
|
||||
|
||||
void CallgrindTool::extensionsInitialized()
|
||||
{
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
@@ -577,8 +591,7 @@ void CallgrindTool::initializeDockWidgets()
|
||||
|
||||
void CallgrindToolPrivate::initializeDockWidgets()
|
||||
{
|
||||
AnalyzerManager *am = AnalyzerManager::instance();
|
||||
Utils::FancyMainWindow *mw = am->mainWindow();
|
||||
Utils::FancyMainWindow *mw = AnalyzerManager::mainWindow();
|
||||
m_visualisation = new Visualisation(mw);
|
||||
m_visualisation->setFrameStyle(QFrame::NoFrame);
|
||||
m_visualisation->setObjectName("Valgrind.CallgrindToolPrivate.Visualisation");
|
||||
@@ -621,21 +634,17 @@ void CallgrindToolPrivate::initializeDockWidgets()
|
||||
|
||||
updateCostFormat();
|
||||
|
||||
QDockWidget *callersDock =
|
||||
am->createDockWidget(q, tr("Callers"), m_callersView,
|
||||
Qt::BottomDockWidgetArea);
|
||||
QDockWidget *callersDock = AnalyzerManager::createDockWidget
|
||||
(q, tr("Callers"), m_callersView, Qt::BottomDockWidgetArea);
|
||||
|
||||
QDockWidget *flatDock =
|
||||
am->createDockWidget(q, tr("Functions"), m_flatView,
|
||||
Qt::BottomDockWidgetArea);
|
||||
QDockWidget *flatDock = AnalyzerManager::createDockWidget
|
||||
(q, tr("Functions"), m_flatView, Qt::BottomDockWidgetArea);
|
||||
|
||||
QDockWidget *calleesDock =
|
||||
am->createDockWidget(q, tr("Callees"), m_calleesView,
|
||||
Qt::BottomDockWidgetArea);
|
||||
QDockWidget *calleesDock = AnalyzerManager::createDockWidget
|
||||
(q, tr("Callees"), m_calleesView, Qt::BottomDockWidgetArea);
|
||||
|
||||
QDockWidget *visualizationDock =
|
||||
am->createDockWidget(q, tr("Visualization"), m_visualisation,
|
||||
Qt::RightDockWidgetArea);
|
||||
QDockWidget *visualizationDock = AnalyzerManager::createDockWidget
|
||||
(q, tr("Visualization"), m_visualisation, Qt::RightDockWidgetArea);
|
||||
visualizationDock->hide();
|
||||
|
||||
mw->splitDockWidget(mw->toolBarDockWidget(), calleesDock, Qt::Vertical);
|
||||
@@ -653,7 +662,7 @@ IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp,
|
||||
IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
|
||||
CallgrindEngine *engine = new CallgrindEngine(q, sp, runConfiguration);
|
||||
|
||||
connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)),
|
||||
SLOT(takeParserData(CallgrindEngine *)));
|
||||
@@ -673,7 +682,7 @@ IAnalyzerEngine *CallgrindToolPrivate::createEngine(const AnalyzerStartParameter
|
||||
engine->setToggleCollectFunction(m_toggleCollectFunction);
|
||||
m_toggleCollectFunction.clear();
|
||||
|
||||
AnalyzerManager::instance()->showStatusMessage(AnalyzerManager::msgToolStarted(q->displayName()));
|
||||
AnalyzerManager::showStatusMessage(AnalyzerManager::msgToolStarted(q->displayName()));
|
||||
|
||||
// apply project settings
|
||||
AnalyzerProjectSettings *analyzerSettings = runConfiguration->extraAspect<AnalyzerProjectSettings>();
|
||||
@@ -862,7 +871,7 @@ void CallgrindToolPrivate::engineFinished()
|
||||
if (data)
|
||||
showParserResults(data);
|
||||
else
|
||||
AnalyzerManager::instance()->showStatusMessage(tr("Profiling aborted."));
|
||||
AnalyzerManager::showStatusMessage(tr("Profiling aborted."));
|
||||
}
|
||||
|
||||
void CallgrindToolPrivate::showParserResults(const ParseData *data)
|
||||
@@ -879,7 +888,7 @@ void CallgrindToolPrivate::showParserResults(const ParseData *data)
|
||||
} else {
|
||||
msg = tr("Parsing failed.");
|
||||
}
|
||||
AnalyzerManager::instance()->showStatusMessage(msg);
|
||||
AnalyzerManager::showStatusMessage(msg);
|
||||
}
|
||||
|
||||
void CallgrindToolPrivate::editorOpened(Core::IEditor *editor)
|
||||
@@ -938,8 +947,8 @@ void CallgrindToolPrivate::handleShowCostsOfFunction()
|
||||
|
||||
m_toggleCollectFunction = QString("%1()").arg(qualifiedFunctionName);
|
||||
|
||||
AnalyzerManager::instance()->selectTool(q);
|
||||
AnalyzerManager::instance()->startTool(q);
|
||||
AnalyzerManager::selectTool(q);
|
||||
AnalyzerManager::startTool(q);
|
||||
}
|
||||
|
||||
void CallgrindToolPrivate::slotRequestDump()
|
||||
@@ -999,15 +1008,6 @@ void CallgrindToolPrivate::createTextMarks()
|
||||
}
|
||||
}
|
||||
|
||||
bool CallgrindTool::canRunLocally() const
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Valgrind
|
||||
|
||||
|
||||
@@ -45,15 +45,16 @@ class CallgrindTool : public Analyzer::IAnalyzerTool
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CallgrindTool(QObject *parent = 0);
|
||||
CallgrindTool(bool local, QObject *parent);
|
||||
~CallgrindTool();
|
||||
|
||||
QString id() const;
|
||||
QByteArray id() const;
|
||||
QString displayName() const;
|
||||
QByteArray menuGroup() const;
|
||||
QString description() const;
|
||||
ToolMode mode() const;
|
||||
|
||||
void initialize();
|
||||
void startTool();
|
||||
void extensionsInitialized();
|
||||
void initializeDockWidgets();
|
||||
|
||||
@@ -61,9 +62,6 @@ public:
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
QWidget *createControlWidget();
|
||||
|
||||
bool canRunRemotely() const { return true; }
|
||||
bool canRunLocally() const;
|
||||
|
||||
private:
|
||||
CallgrindToolPrivate *d;
|
||||
};
|
||||
|
||||
@@ -49,9 +49,9 @@ using namespace Valgrind::XmlProtocol;
|
||||
namespace Valgrind {
|
||||
namespace Internal {
|
||||
|
||||
MemcheckEngine::MemcheckEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
MemcheckEngine::MemcheckEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: ValgrindEngine(sp, runConfiguration)
|
||||
: ValgrindEngine(tool, sp, runConfiguration)
|
||||
{
|
||||
connect(&m_parser, SIGNAL(error(Valgrind::XmlProtocol::Error)),
|
||||
SIGNAL(parserError(Valgrind::XmlProtocol::Error)));
|
||||
|
||||
@@ -46,8 +46,9 @@ namespace Internal {
|
||||
class MemcheckEngine : public ValgrindEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MemcheckEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
MemcheckEngine(Analyzer::IAnalyzerTool *tool, const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
|
||||
void start();
|
||||
|
||||
@@ -184,9 +184,10 @@ static void initKindFilterAction(QAction *action, const QList<int> &kinds)
|
||||
action->setData(data);
|
||||
}
|
||||
|
||||
MemcheckTool::MemcheckTool(QObject *parent)
|
||||
MemcheckTool::MemcheckTool(bool local, QObject *parent)
|
||||
: Analyzer::IAnalyzerTool(parent)
|
||||
{
|
||||
m_local = local;
|
||||
m_settings = 0;
|
||||
m_errorModel = 0;
|
||||
m_errorProxyModel = 0;
|
||||
@@ -292,9 +293,15 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
|
||||
m_errorProxyModel->setFilterExternalIssues(memcheckSettings->filterExternalIssues());
|
||||
}
|
||||
|
||||
QString MemcheckTool::id() const
|
||||
QByteArray MemcheckTool::id() const
|
||||
{
|
||||
return "Memcheck";
|
||||
return m_local ? "MemcheckLocal" : "MemcheckGlobal";
|
||||
}
|
||||
|
||||
QByteArray MemcheckTool::menuGroup() const
|
||||
{
|
||||
return m_local ? Analyzer::Constants::G_ANALYZER_TOOLS
|
||||
: Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
|
||||
}
|
||||
|
||||
QString MemcheckTool::displayName() const
|
||||
@@ -313,6 +320,14 @@ IAnalyzerTool::ToolMode MemcheckTool::mode() const
|
||||
return DebugMode;
|
||||
}
|
||||
|
||||
void MemcheckTool::startTool()
|
||||
{
|
||||
if (m_local)
|
||||
AnalyzerManager::startLocalTool(this);
|
||||
else
|
||||
AnalyzerManager::startRemoteTool(this);
|
||||
}
|
||||
|
||||
class FrameFinder : public ErrorListModel::RelevantFrameFinder
|
||||
{
|
||||
public:
|
||||
@@ -369,8 +384,7 @@ void MemcheckTool::ensureWidgets()
|
||||
if (m_errorView)
|
||||
return;
|
||||
|
||||
AnalyzerManager *am = AnalyzerManager::instance();
|
||||
Utils::FancyMainWindow *mw = am->mainWindow();
|
||||
Utils::FancyMainWindow *mw = AnalyzerManager::mainWindow();
|
||||
|
||||
m_errorView = new MemcheckErrorView;
|
||||
m_errorView->setObjectName(QLatin1String("MemcheckErrorView"));
|
||||
@@ -390,9 +404,8 @@ void MemcheckTool::ensureWidgets()
|
||||
m_errorView->setAutoScroll(false);
|
||||
m_errorView->setObjectName("Valgrind.MemcheckTool.ErrorView");
|
||||
|
||||
QDockWidget *errorDock =
|
||||
am->createDockWidget(this, tr("Memory Issues"), m_errorView,
|
||||
Qt::BottomDockWidgetArea);
|
||||
QDockWidget *errorDock = AnalyzerManager::createDockWidget
|
||||
(this, tr("Memory Issues"), m_errorView, Qt::BottomDockWidgetArea);
|
||||
mw->splitDockWidget(mw->toolBarDockWidget(), errorDock, Qt::Vertical);
|
||||
|
||||
connect(ProjectExplorer::ProjectExplorerPlugin::instance(),
|
||||
@@ -457,9 +470,10 @@ QWidget *MemcheckTool::createControlWidget()
|
||||
IAnalyzerEngine *MemcheckTool::createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()->project()->files(ProjectExplorer::Project::AllFiles) : QStringList());
|
||||
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()
|
||||
->project()->files(ProjectExplorer::Project::AllFiles) : QStringList());
|
||||
|
||||
MemcheckEngine *engine = new MemcheckEngine(sp, runConfiguration);
|
||||
MemcheckEngine *engine = new MemcheckEngine(this, sp, runConfiguration);
|
||||
|
||||
connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
|
||||
this, SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
|
||||
@@ -468,7 +482,7 @@ IAnalyzerEngine *MemcheckTool::createEngine(const AnalyzerStartParameters &sp,
|
||||
connect(engine, SIGNAL(internalParserError(QString)),
|
||||
this, SLOT(internalParserError(QString)));
|
||||
connect(engine, SIGNAL(finished()), this, SLOT(finished()));
|
||||
AnalyzerManager::instance()->showStatusMessage(AnalyzerManager::msgToolStarted(displayName()));
|
||||
AnalyzerManager::showStatusMessage(AnalyzerManager::msgToolStarted(displayName()));
|
||||
return engine;
|
||||
}
|
||||
|
||||
@@ -556,21 +570,7 @@ void MemcheckTool::finished()
|
||||
m_goBack->setEnabled(n > 0);
|
||||
m_goNext->setEnabled(n > 0);
|
||||
const QString msg = AnalyzerManager::msgToolFinished(displayName(), n);
|
||||
AnalyzerManager::instance()->showStatusMessage(msg);
|
||||
}
|
||||
|
||||
bool MemcheckTool::canRunRemotely() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MemcheckTool::canRunLocally() const
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
AnalyzerManager::showStatusMessage(msg);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -91,12 +91,13 @@ class MemcheckTool : public Analyzer::IAnalyzerTool
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MemcheckTool(QObject *parent = 0);
|
||||
MemcheckTool(bool local, QObject *parent);
|
||||
|
||||
QString id() const;
|
||||
QByteArray id() const;
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
ToolMode mode() const;
|
||||
QByteArray menuGroup() const;
|
||||
void startTool();
|
||||
|
||||
private slots:
|
||||
void settingsDestroyed(QObject *settings);
|
||||
@@ -111,11 +112,9 @@ private slots:
|
||||
void suppressionActionTriggered();
|
||||
|
||||
private:
|
||||
ToolMode mode() const;
|
||||
void ensureWidgets();
|
||||
bool canRunRemotely() const;
|
||||
bool canRunLocally() const;
|
||||
void initializeDockWidgets();
|
||||
void initialize() {}
|
||||
void extensionsInitialized();
|
||||
QWidget *createControlWidget();
|
||||
|
||||
@@ -124,6 +123,8 @@ private:
|
||||
|
||||
void clearErrorView();
|
||||
|
||||
private:
|
||||
bool m_local;
|
||||
Analyzer::AnalyzerSettings *m_settings;
|
||||
QMenu *m_filterMenu;
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ using namespace Analyzer;
|
||||
using namespace Valgrind::Internal;
|
||||
using namespace Utils;
|
||||
|
||||
ValgrindEngine::ValgrindEngine(const AnalyzerStartParameters &sp,
|
||||
ValgrindEngine::ValgrindEngine(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
: IAnalyzerEngine(sp, runConfiguration),
|
||||
: IAnalyzerEngine(tool, sp, runConfiguration),
|
||||
m_settings(0),
|
||||
m_progress(new QFutureInterface<void>()),
|
||||
m_progressWatcher(new QFutureWatcher<void>()),
|
||||
@@ -130,7 +130,7 @@ QString ValgrindEngine::executable() const
|
||||
|
||||
void ValgrindEngine::handleProgressCanceled()
|
||||
{
|
||||
AnalyzerManager::instance()->stopTool();
|
||||
AnalyzerManager::stopTool(tool());
|
||||
}
|
||||
|
||||
void ValgrindEngine::handleProgressFinished()
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
#include "valgrind_global.h"
|
||||
|
||||
#include <analyzerbase/ianalyzerengine.h>
|
||||
#include <analyzerbase/ianalyzerengine.h>
|
||||
|
||||
#include <utils/environment.h>
|
||||
@@ -59,10 +58,12 @@ namespace Internal {
|
||||
class VALGRINDTOOLBASE_EXPORT ValgrindEngine : public Analyzer::IAnalyzerEngine
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ValgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ValgrindEngine(Analyzer::IAnalyzerTool *tool,
|
||||
const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
virtual ~ValgrindEngine();
|
||||
~ValgrindEngine();
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
@@ -80,14 +80,16 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
|
||||
AnalyzerGlobalSettings::instance()->registerSubConfigs(&globalCallgrindFactory, &projectCallgrindFactory);
|
||||
AnalyzerGlobalSettings::instance()->registerSubConfigs(&globalMemcheckFactory, &projectMemcheckFactory);
|
||||
|
||||
AnalyzerManager::instance()->addTool(new MemcheckTool(this));
|
||||
AnalyzerManager::instance()->addTool(new CallgrindTool(this));
|
||||
#ifndef Q_OS_WIN
|
||||
AnalyzerManager::addTool(new MemcheckTool(true, this));
|
||||
#endif
|
||||
AnalyzerManager::addTool(new MemcheckTool(false, this));
|
||||
#ifndef Q_OS_WIN
|
||||
AnalyzerManager::addTool(new CallgrindTool(true, this));
|
||||
#endif
|
||||
AnalyzerManager::addTool(new CallgrindTool(false, this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ValgrindPlugin::extensionsInitialized()
|
||||
{
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN(Valgrind::Internal::ValgrindPlugin)
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
ValgrindPlugin() {}
|
||||
|
||||
virtual bool initialize(const QStringList &arguments, QString *errorString);
|
||||
virtual void extensionsInitialized();
|
||||
virtual void extensionsInitialized() {}
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user