IAnalyzerTool: actionId() is re-implemented in derived classes

Change-Id: I5a0a485e239eeb33a9d8ad8cfd0f9cc40e1ff6d2
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Aurindam Jana
2013-08-02 16:38:43 +02:00
committed by hjk
parent 904dd68e5f
commit f8a2698bcd
8 changed files with 19 additions and 15 deletions

View File

@@ -60,20 +60,6 @@ IAnalyzerTool::IAnalyzerTool(QObject *parent)
: QObject(parent)
{}
Id IAnalyzerTool::actionId(StartMode mode) const
{
Id id = Id("Analyzer").withSuffix(this->id().toString());
switch (mode) {
case StartLocal:
return id.withSuffix(".Local");
case StartRemote:
return id.withSuffix(".Remote");
case StartQmlRemote:
return id.withSuffix(".Qml");
}
return Id();
}
Id IAnalyzerTool::menuGroup(StartMode mode) const
{
if (mode == StartRemote)

View File

@@ -79,7 +79,7 @@ public:
/// Returns a user readable description name for this tool.
virtual QString description() const = 0;
/// Returns an id for the start action.
virtual Core::Id actionId(StartMode mode) const;
virtual Core::Id actionId(StartMode mode) const = 0;
/// Returns the menu group the start action should go to.
virtual Core::Id menuGroup(StartMode mode) const;
/// Returns a short user readable action name for this tool.

View File

@@ -213,6 +213,11 @@ QString QmlProfilerTool::description() const
"applications using QML.");
}
Core::Id QmlProfilerTool::actionId(StartMode mode) const
{
return mode == StartLocal ? "Analyzer.QmlProfiler.Local" : "Analyzer.QmlProfiler.Remote";
}
IAnalyzerTool::ToolMode QmlProfilerTool::toolMode() const
{
return AnyMode;

View File

@@ -52,6 +52,7 @@ public:
ProjectExplorer::RunMode runMode() const;
QString displayName() const;
QString description() const;
Core::Id actionId(Analyzer::StartMode mode) const;
ToolMode toolMode() const;
void extensionsInitialized() {}

View File

@@ -535,6 +535,11 @@ QString CallgrindTool::description() const
"record function calls when a program runs.");
}
Core::Id CallgrindTool::actionId(StartMode mode) const
{
return mode == StartLocal ? "Analyzer.Callgrind.Local" : "Analyzer.Callgrind.Remote";
}
IAnalyzerTool::ToolMode CallgrindTool::toolMode() const
{
return ReleaseMode;

View File

@@ -49,6 +49,7 @@ public:
ProjectExplorer::RunMode runMode() const;
QString displayName() const;
QString description() const;
Core::Id actionId(Analyzer::StartMode mode) const;
ToolMode toolMode() const;
void extensionsInitialized();

View File

@@ -297,6 +297,11 @@ QString MemcheckTool::description() const
"memory leaks");
}
Core::Id MemcheckTool::actionId(StartMode mode) const
{
return mode == StartLocal ? "Analyzer.Memcheck.Local" : "Analyzer.Memcheck.Remote";
}
AbstractAnalyzerSubConfig *MemcheckTool::createGlobalSettings()
{
return new ValgrindGlobalSettings();

View File

@@ -88,6 +88,7 @@ public:
ProjectExplorer::RunMode runMode() const;
QString displayName() const;
QString description() const;
Core::Id actionId(Analyzer::StartMode mode) const;
// Create the valgrind settings (for all valgrind tools)
Analyzer::AbstractAnalyzerSubConfig *createGlobalSettings();