forked from qt-creator/qt-creator
Analyzer: Introduce AnalzyerAction
This wraps the menu related aspects of an IAnalyzerTool. Change-Id: I065cb5f269a40af2137f434a7cdf915bd9a76839 Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
This commit is contained in:
@@ -37,7 +37,15 @@
|
||||
#include <QtPlugin>
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace QmlProfiler::Internal;
|
||||
|
||||
namespace QmlProfiler {
|
||||
namespace Internal {
|
||||
|
||||
class QmlProfilerAction : public AnalyzerAction
|
||||
{
|
||||
public:
|
||||
QmlProfilerAction() {}
|
||||
};
|
||||
|
||||
bool QmlProfilerPlugin::debugOutput = false;
|
||||
|
||||
@@ -47,8 +55,30 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
IAnalyzerTool *tool = new QmlProfilerTool(this);
|
||||
AnalyzerManager::addTool(tool, StartLocal);
|
||||
AnalyzerManager::addTool(tool, StartRemote);
|
||||
|
||||
QmlProfilerAction *action = 0;
|
||||
|
||||
QString description = QmlProfilerTool::tr(
|
||||
"The QML Profiler can be used to find performance bottlenecks in "
|
||||
"applications using QML.");
|
||||
|
||||
action = new QmlProfilerAction;
|
||||
action->setId("QmlProfiler.Local");
|
||||
action->setTool(tool);
|
||||
action->setText(tr("QML Profiler"));
|
||||
action->setToolTip(description);
|
||||
action->setStartMode(StartLocal);
|
||||
action->setMenuGroup(Constants::G_ANALYZER_TOOLS);
|
||||
AnalyzerManager::addAction(action);
|
||||
|
||||
action = new QmlProfilerAction;
|
||||
action->setId("QmlProfiler.Remote");
|
||||
action->setTool(tool);
|
||||
action->setText(tr("QML Profiler (External)"));
|
||||
action->setToolTip(description);
|
||||
action->setStartMode(StartRemote);
|
||||
action->setMenuGroup(Constants::G_ANALYZER_REMOTE_TOOLS);
|
||||
AnalyzerManager::addAction(action);
|
||||
|
||||
addAutoReleasedObject(new QmlProfilerRunControlFactory());
|
||||
|
||||
@@ -70,5 +100,8 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN(QmlProfilerPlugin)
|
||||
} // namespace Internal
|
||||
} // namespace QmlProfiler
|
||||
|
||||
Q_EXPORT_PLUGIN(QmlProfiler::Internal::QmlProfilerPlugin)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user