Valgrind: Use named classes for run worker factories

Change-Id: I05009aa2fe4541e10fa56a3a095db030e18b79b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-01-05 09:07:46 +01:00
parent 15d6e1df1b
commit 67195f4270
4 changed files with 32 additions and 27 deletions

View File

@@ -78,14 +78,23 @@ using namespace TextEditor;
using namespace ProjectExplorer;
using namespace Utils;
namespace Valgrind {
namespace Internal {
namespace Valgrind::Internal {
const char CallgrindLocalActionId[] = "Callgrind.Local.Action";
const char CallgrindRemoteActionId[] = "Callgrind.Remote.Action";
const char CALLGRIND_RUN_MODE[] = "CallgrindTool.CallgrindRunMode";
class CallgrindToolPrivate : public QObject
class CallgrindToolRunnerFactory final : public RunWorkerFactory
{
public:
CallgrindToolRunnerFactory()
{
setProduct<CallgrindToolRunner>();
addSupportedRunMode(CALLGRIND_RUN_MODE);
}
};
class CallgrindToolPrivate final : public QObject
{
Q_OBJECT
@@ -195,10 +204,7 @@ public:
Perspective m_perspective{"Callgrind.Perspective", Tr::tr("Callgrind")};
RunWorkerFactory callgrindRunWorkerFactory{
RunWorkerFactory::make<CallgrindToolRunner>(),
{CALLGRIND_RUN_MODE}
};
CallgrindToolRunnerFactory callgrindRunWorkerFactory;
};
CallgrindToolPrivate::CallgrindToolPrivate()
@@ -965,7 +971,6 @@ CallgrindTool::~CallgrindTool()
delete dd;
}
} // namespace Internal
} // namespace Valgrind
} // Valgrind::Internal
#include "callgrindtool.moc"