forked from qt-creator/qt-creator
CppCheck: Move widget creation for manual run closer to its use
Change-Id: I08d50f5e4534b8a58d374ae37bfd03dbd234a483 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <cppeditor/projectinfo.h>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QBoxLayout>
|
||||
@@ -18,8 +19,7 @@
|
||||
|
||||
namespace Cppcheck::Internal {
|
||||
|
||||
ManualRunDialog::ManualRunDialog(QWidget *optionsWidget,
|
||||
const ProjectExplorer::Project *project)
|
||||
ManualRunDialog::ManualRunDialog(const ProjectExplorer::Project *project)
|
||||
: m_model(new ProjectExplorer::SelectableFilesFromDirModel(this))
|
||||
{
|
||||
QTC_ASSERT(project, return );
|
||||
@@ -52,6 +52,8 @@ ManualRunDialog::ManualRunDialog(QWidget *optionsWidget,
|
||||
analyzeButton->setEnabled(m_model->hasCheckedFiles());
|
||||
});
|
||||
|
||||
auto optionsWidget = settings().layouter()().emerge();
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addWidget(optionsWidget);
|
||||
layout->addWidget(view);
|
||||
|
@@ -20,7 +20,7 @@ namespace Cppcheck::Internal {
|
||||
class ManualRunDialog : public QDialog
|
||||
{
|
||||
public:
|
||||
ManualRunDialog(QWidget *optionsWidget, const ProjectExplorer::Project *project);
|
||||
explicit ManualRunDialog(const ProjectExplorer::Project *project);
|
||||
|
||||
Utils::FilePaths filePaths() const;
|
||||
QSize sizeHint() const override;
|
||||
|
@@ -112,9 +112,7 @@ void CppcheckPluginPrivate::startManualRun()
|
||||
|
||||
manualRunTool.updateOptions();
|
||||
|
||||
auto optionsWidget = settings().layouter()().emerge();
|
||||
|
||||
ManualRunDialog dialog(optionsWidget, project);
|
||||
ManualRunDialog dialog(project);
|
||||
if (dialog.exec() == ManualRunDialog::Rejected)
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user