File indexing completed on 2022-11-22 13:51:30

0001 /* This file is part of KDevelop
0002  * Copyright 2011 Mathieu Lornac <mathieu.lornac@gmail.com>
0003  * Copyright 2011 Damien Coppel <damien.coppel@gmail.com>
0004  * Copyright 2011 Lionel Duc <lionel.data@gmail.com>
0005  * Copyright 2017 Anton Anikin <anton@anikin.xyz>
0006 
0007    This program is free software; you can redistribute it and/or
0008    modify it under the terms of the GNU General Public
0009    License as published by the Free Software Foundation; either
0010    version 2 of the License, or (at your option) any later version.
0011 
0012    This program is distributed in the hope that it will be useful,
0013    but WITHOUT ANY WARRANTY; without even the implied warranty of
0014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015     General Public License for more details.
0016 
0017    You should have received a copy of the GNU General Public License
0018    along with this program; see the file COPYING.  If not, write to
0019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020    Boston, MA 02110-1301, USA.
0021 */
0022 
0023 #include "memcheck_configpage.h"
0024 #include "ui_memcheck_configpage.h"
0025 
0026 #include "debug.h"
0027 #include "memcheck_config.h"
0028 #include "memcheck_tool.h"
0029 
0030 #include <QMenu>
0031 
0032 #include <KLocalizedString>
0033 
0034 namespace Valgrind
0035 {
0036 
0037 MemcheckConfigPage::MemcheckConfigPage(QWidget* parent)
0038     : ConfigPage(MemcheckTool::self()->name(), parent)
0039 {
0040     Ui::MemcheckConfigPage ui;
0041     ui.setupUi(this);
0042 
0043     ui.kcfg_showLeakKinds->addAction(i18n("definite"), QStringLiteral("definite"));
0044     ui.kcfg_showLeakKinds->addAction(i18n("possible"), QStringLiteral("possible"));
0045     ui.kcfg_showLeakKinds->addAction(i18n("indirect"), QStringLiteral("indirect"));
0046     ui.kcfg_showLeakKinds->addAction(i18n("reachable"), QStringLiteral("reachable"));
0047     connect(ui.kcfg_showLeakKinds, &MenuButton::valueChanged, this, &MemcheckConfigPage::changed);
0048 
0049     // FIXME fix i18n text ?
0050     ui.kcfg_leakCheckHeuristics->addAction(i18n("stdstring"), QStringLiteral("stdstring"));
0051     ui.kcfg_leakCheckHeuristics->addAction(i18n("length64"), QStringLiteral("length64"));
0052     ui.kcfg_leakCheckHeuristics->addAction(i18n("newarray"), QStringLiteral("newarray"));
0053     ui.kcfg_leakCheckHeuristics->addAction(i18n("multipleinheritance"), QStringLiteral("multipleinheritance"));
0054     connect(ui.kcfg_leakCheckHeuristics, &MenuButton::valueChanged, this, &MemcheckConfigPage::changed);
0055 
0056     ui.kcfg_leakResolution->addItem(i18n("high"), QStringLiteral("high"));
0057     ui.kcfg_leakResolution->addItem(i18n("medium"), QStringLiteral("med"));
0058     ui.kcfg_leakResolution->addItem(i18n("low"), QStringLiteral("low"));
0059 
0060     ui.kcfg_keepStacktraces->addItem(i18n("alloc"), QStringLiteral("alloc"));
0061     ui.kcfg_keepStacktraces->addItem(i18n("free"), QStringLiteral("free"));
0062     ui.kcfg_keepStacktraces->addItem(i18n("alloc-and-free"), QStringLiteral("alloc-and-free"));
0063     ui.kcfg_keepStacktraces->addItem(i18n("alloc-then-free"), QStringLiteral("alloc-then-free"));
0064     ui.kcfg_keepStacktraces->addItem(i18n("none"), QStringLiteral("none"));
0065 
0066     init(new MemcheckConfig);
0067 }
0068 
0069 }