Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gui/aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AboutDialog : public QDialog {
public:
AboutDialog(const QString &version,
const QString &extraVersion,
QWidget *parent = nullptr);
QWidget *parent);

~AboutDialog() override;

Expand Down
2 changes: 1 addition & 1 deletion gui/applicationdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ApplicationDialog : public QDialog {
*/
ApplicationDialog(const QString &title,
Application &app,
QWidget *parent = nullptr);
QWidget *parent);
~ApplicationDialog() override;

protected slots:
Expand Down
2 changes: 1 addition & 1 deletion gui/applicationlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ApplicationList : public QObject {
Q_OBJECT
public:

explicit ApplicationList(QObject *parent = nullptr);
explicit ApplicationList(QObject *parent);
~ApplicationList() override;

/**
Expand Down
2 changes: 1 addition & 1 deletion gui/checkstatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
class CheckStatistics : public QObject {
public:
explicit CheckStatistics(QObject *parent = nullptr);
explicit CheckStatistics(QObject *parent);

/**
* @brief Add new checked item to statistics.
Expand Down
4 changes: 2 additions & 2 deletions gui/codeeditstyledialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class QStringList;
class StyleEditDialog : public QDialog {
Q_OBJECT
public:
explicit StyleEditDialog(const CodeEditorStyle& newStyle,
QWidget *parent = nullptr);
StyleEditDialog(const CodeEditorStyle& newStyle,
QWidget *parent);

CodeEditorStyle getStyle();

Expand Down
2 changes: 1 addition & 1 deletion gui/fileviewdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class FileViewDialog : public QDialog {
public:
FileViewDialog(const QString &file,
const QString &title,
QWidget *parent = nullptr);
QWidget *parent);

~FileViewDialog() override;

Expand Down
4 changes: 2 additions & 2 deletions gui/helpdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Ui {

class HelpBrowser : public QTextBrowser {
public:
explicit HelpBrowser(QWidget* parent = nullptr) : QTextBrowser(parent) {}
explicit HelpBrowser(QWidget* parent) : QTextBrowser(parent) {}
HelpBrowser(const HelpBrowser&) = delete;
HelpBrowser(HelpBrowser&&) = delete;
HelpBrowser& operator=(const HelpBrowser&) = delete;
Expand All @@ -49,7 +49,7 @@ class HelpDialog : public QDialog {
Q_OBJECT

public:
explicit HelpDialog(QWidget *parent = nullptr);
explicit HelpDialog(QWidget *parent);
~HelpDialog() override;

private:
Expand Down
2 changes: 1 addition & 1 deletion gui/libraryaddfunctiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LibraryAddFunctionDialog : public QDialog {
Q_OBJECT

public:
explicit LibraryAddFunctionDialog(QWidget *parent = nullptr);
explicit LibraryAddFunctionDialog(QWidget *parent);
LibraryAddFunctionDialog(const LibraryAddFunctionDialog &) = delete;
~LibraryAddFunctionDialog() override;
LibraryAddFunctionDialog &operator=(const LibraryAddFunctionDialog &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion gui/librarydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void LibraryDialog::saveCfgAs()

void LibraryDialog::addFunction()
{
auto *d = new LibraryAddFunctionDialog;
auto *d = new LibraryAddFunctionDialog(nullptr); // TODO: pass parent?
if (d->exec() == QDialog::Accepted && !d->functionName().isEmpty()) {

CppcheckLibraryData::Function f;
Expand Down
2 changes: 1 addition & 1 deletion gui/librarydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class LibraryDialog : public QDialog {
Q_OBJECT

public:
explicit LibraryDialog(QWidget *parent = nullptr);
explicit LibraryDialog(QWidget *parent);
LibraryDialog(const LibraryDialog &) = delete;
~LibraryDialog() override;
LibraryDialog &operator=(const LibraryDialog &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ void MainWindow::openHelpContents()

void MainWindow::openOnlineHelp()
{
auto *helpDialog = new HelpDialog;
auto *helpDialog = new HelpDialog(nullptr); // TODO: pass parent?
helpDialog->showMaximized();
}

Expand Down
2 changes: 1 addition & 1 deletion gui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class MainWindow : public QMainWindow {
/**
* List of checked platforms.
*/
Platforms mPlatforms;
Platforms mPlatforms{nullptr}; // TODO: pass parent?

/**
* @brief Analyze given code
Expand Down
2 changes: 1 addition & 1 deletion gui/newsuppressiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NewSuppressionDialog : public QDialog {
Q_OBJECT

public:
explicit NewSuppressionDialog(QWidget *parent = nullptr);
explicit NewSuppressionDialog(QWidget *parent);
NewSuppressionDialog(const NewSuppressionDialog &) = delete;
~NewSuppressionDialog() override;
NewSuppressionDialog &operator=(const NewSuppressionDialog &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion gui/platforms.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Platforms : public QObject {
Q_OBJECT

public:
explicit Platforms(QObject *parent = nullptr);
explicit Platforms(QObject *parent);
void add(const QString &title, Platform::Type platform);
int getCount() const;
void init();
Expand Down
4 changes: 2 additions & 2 deletions gui/projectfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class ProjectFile : public QObject {
Q_OBJECT

public:
explicit ProjectFile(QObject *parent = nullptr);
explicit ProjectFile(QString filename, QObject *parent = nullptr);
explicit ProjectFile(QObject *parent);
ProjectFile(QString filename, QObject *parent);
~ProjectFile() override {
if (this == mActiveProject) mActiveProject = nullptr;
}
Expand Down
6 changes: 3 additions & 3 deletions gui/projectfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ ProjectFileDialog::ProjectFileDialog(ProjectFile *projectFile, bool premium, QWi
}

// Platforms..
Platforms platforms;
Platforms platforms(nullptr); // TODO: pass parent?
for (const Platform::Type builtinPlatform : builtinPlatforms)
mUI->mComboBoxPlatform->addItem(platforms.get(builtinPlatform).mTitle);
QStringList platformFiles;
Expand Down Expand Up @@ -869,7 +869,7 @@ void ProjectFileDialog::moveIncludePathDown()

void ProjectFileDialog::addSuppression()
{
NewSuppressionDialog dlg;
NewSuppressionDialog dlg(nullptr); // TODO: pass parent?
if (dlg.exec() == QDialog::Accepted) {
addSingleSuppression(dlg.getSuppression());
}
Expand All @@ -894,7 +894,7 @@ void ProjectFileDialog::editSuppression(const QModelIndex & /*index*/)
QListWidgetItem *item = mUI->mListSuppressions->item(row);
const int suppressionIndex = getSuppressionIndex(item->text());
if (suppressionIndex >= 0) { // TODO what if suppression is not found?
NewSuppressionDialog dlg;
NewSuppressionDialog dlg(nullptr); // TODO: pass parent?
dlg.setSuppression(mSuppressions[suppressionIndex]);
if (dlg.exec() == QDialog::Accepted) {
mSuppressions[suppressionIndex] = dlg.getSuppression();
Expand Down
2 changes: 1 addition & 1 deletion gui/projectfiledialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ProjectFile;
class ProjectFileDialog : public QDialog {
Q_OBJECT
public:
explicit ProjectFileDialog(ProjectFile *projectFile, bool premium, QWidget *parent = nullptr);
ProjectFileDialog(ProjectFile *projectFile, bool premium, QWidget *parent);
~ProjectFileDialog() override;

private:
Expand Down
2 changes: 1 addition & 1 deletion gui/resultstree.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum class Severity;
class ResultsTree : public QTreeView {
Q_OBJECT
public:
explicit ResultsTree(QWidget * parent = nullptr);
explicit ResultsTree(QWidget * parent);

void initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler);

Expand Down
2 changes: 1 addition & 1 deletion gui/resultsview.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ResultsView : public QWidget {
Q_OBJECT
public:

explicit ResultsView(QWidget * parent = nullptr);
explicit ResultsView(QWidget * parent);
void initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler);
ResultsView(const ResultsView &) = delete;
~ResultsView() override;
Expand Down
2 changes: 1 addition & 1 deletion gui/settingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SettingsDialog : public QDialog {
SettingsDialog(ApplicationList *list,
TranslationHandler *translator,
bool premium,
QWidget *parent = nullptr);
QWidget *parent);
SettingsDialog(const SettingsDialog &) = delete;
~SettingsDialog() override;
SettingsDialog &operator=(const SettingsDialog &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion gui/statsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace Ui {
class StatsDialog : public QDialog {
Q_OBJECT
public:
explicit StatsDialog(QWidget *parent = nullptr);
explicit StatsDialog(QWidget *parent);
~StatsDialog() override;

/**
Expand Down
14 changes: 7 additions & 7 deletions gui/test/projectfile/testprojectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ bool ImportProject::sourceFileExists(const std::string & /*file*/) {
void TestProjectFile::loadInexisting() const
{
const QString filepath(QString(SRCDIR) + "/../data/projectfiles/foo.cppcheck");
ProjectFile pfile(filepath);
ProjectFile pfile(filepath, nullptr);
QCOMPARE(pfile.read(), false);
}

void TestProjectFile::loadSimple() const
{
const QString filepath(QString(SRCDIR) + "/../data/projectfiles/simple.cppcheck");
ProjectFile pfile(filepath);
ProjectFile pfile(filepath, nullptr);
QVERIFY(pfile.read());
QCOMPARE(pfile.getRootPath(), QString("../.."));
QStringList includes = pfile.getIncludeDirs();
Expand All @@ -79,7 +79,7 @@ void TestProjectFile::loadSimple() const
void TestProjectFile::loadSimpleWithIgnore() const
{
const QString filepath(QString(SRCDIR) + "/../data/projectfiles/simple_ignore.cppcheck");
ProjectFile pfile(filepath);
ProjectFile pfile(filepath, nullptr);
QVERIFY(pfile.read());
QCOMPARE(pfile.getRootPath(), QString("../.."));
QStringList includes = pfile.getIncludeDirs();
Expand All @@ -101,7 +101,7 @@ void TestProjectFile::loadSimpleWithIgnore() const
void TestProjectFile::loadSimpleNoroot() const
{
const QString filepath(QString(SRCDIR) + "/../data/projectfiles/simple_noroot.cppcheck");
ProjectFile pfile(filepath);
ProjectFile pfile(filepath, nullptr);
QVERIFY(pfile.read());
QCOMPARE(pfile.getRootPath(), QString());
QStringList includes = pfile.getIncludeDirs();
Expand Down Expand Up @@ -143,7 +143,7 @@ void TestProjectFile::getCheckingSuppressionsRelative() const
{
const SuppressionList::Suppression suppression("*", "externals/*");
const QList<SuppressionList::Suppression> suppressions{suppression};
ProjectFile projectFile;
ProjectFile projectFile(nullptr);
projectFile.setFilename("/some/path/123.cppcheck");
projectFile.setSuppressions(suppressions);
QCOMPARE(projectFile.getCheckingSuppressions()[0].fileName, "/some/path/externals/*");
Expand All @@ -153,7 +153,7 @@ void TestProjectFile::getCheckingSuppressionsAbsolute() const
{
const SuppressionList::Suppression suppression("*", "/some/path/1.h");
const QList<SuppressionList::Suppression> suppressions{suppression};
ProjectFile projectFile;
ProjectFile projectFile(nullptr);
projectFile.setFilename("/other/123.cppcheck");
projectFile.setSuppressions(suppressions);
QCOMPARE(projectFile.getCheckingSuppressions()[0].fileName, "/some/path/1.h");
Expand All @@ -163,7 +163,7 @@ void TestProjectFile::getCheckingSuppressionsStar() const
{
const SuppressionList::Suppression suppression("*", "*.cpp");
const QList<SuppressionList::Suppression> suppressions{suppression};
ProjectFile projectFile;
ProjectFile projectFile(nullptr);
projectFile.setFilename("/some/path/123.cppcheck");
projectFile.setSuppressions(suppressions);
QCOMPARE(projectFile.getCheckingSuppressions()[0].fileName, "*.cpp");
Expand Down
2 changes: 1 addition & 1 deletion gui/test/translationhandler/testtranslationhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static QStringList getTranslationNames(const TranslationHandler& handler)

void TestTranslationHandler::construct() const
{
TranslationHandler handler;
TranslationHandler handler(nullptr);
QCOMPARE(getTranslationNames(handler).size(), 13); // 12 translations + english
QCOMPARE(handler.getCurrentLanguage(), QString("en"));
}
Expand Down
2 changes: 1 addition & 1 deletion gui/threadhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ErrorItem;
class ThreadHandler : public QObject {
Q_OBJECT
public:
explicit ThreadHandler(QObject *parent = nullptr);
explicit ThreadHandler(QObject *parent);
~ThreadHandler() override;

/**
Expand Down
2 changes: 1 addition & 1 deletion gui/translationhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct TranslationInfo {
class TranslationHandler : QObject {
Q_OBJECT
public:
explicit TranslationHandler(QObject *parent = nullptr);
explicit TranslationHandler(QObject *parent);

/**
* @brief Get a list of available translations.
Expand Down