1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#include "valgrind.h"
6#include "mainframe/valgrindrunner.h"
7#include "mainframe/valgrindbar.h"
8
9#include "common/common.h"
10#include "base/abstractwidget.h"
11#include "services/window/windowservice.h"
12#include "services/window/windowelement.h"
13
14#include <QAction>
15
16void Valgrind::initialize()
17{
18 qInfo() << __FUNCTION__;
19}
20
21bool Valgrind::start()
22{
23 qInfo() << __FUNCTION__;
24 using namespace dpfservice;
25 auto &ctx = dpfInstance.serviceContext();
26 auto windowService = ctx.service<WindowService>(WindowService::name());
27
28 if (windowService) {
29 ValgrindBar *valgrindBar = new ValgrindBar();
30 windowService->addContextWidget(tr("&Valgrind"), new AbstractWidget(valgrindBar), "Valgrind");
31 }
32
33 ValgrindRunner::instance()->initialize();
34
35 return true;
36}
37
38dpf::Plugin::ShutdownFlag Valgrind::stop()
39{
40 qInfo() << __FUNCTION__;
41 return Sync;
42}
43