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 <cppeditor/projectinfo.h>
|
||||||
|
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
@@ -18,8 +19,7 @@
|
|||||||
|
|
||||||
namespace Cppcheck::Internal {
|
namespace Cppcheck::Internal {
|
||||||
|
|
||||||
ManualRunDialog::ManualRunDialog(QWidget *optionsWidget,
|
ManualRunDialog::ManualRunDialog(const ProjectExplorer::Project *project)
|
||||||
const ProjectExplorer::Project *project)
|
|
||||||
: m_model(new ProjectExplorer::SelectableFilesFromDirModel(this))
|
: m_model(new ProjectExplorer::SelectableFilesFromDirModel(this))
|
||||||
{
|
{
|
||||||
QTC_ASSERT(project, return );
|
QTC_ASSERT(project, return );
|
||||||
@@ -52,6 +52,8 @@ ManualRunDialog::ManualRunDialog(QWidget *optionsWidget,
|
|||||||
analyzeButton->setEnabled(m_model->hasCheckedFiles());
|
analyzeButton->setEnabled(m_model->hasCheckedFiles());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
auto optionsWidget = settings().layouter()().emerge();
|
||||||
|
|
||||||
auto layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
layout->addWidget(optionsWidget);
|
layout->addWidget(optionsWidget);
|
||||||
layout->addWidget(view);
|
layout->addWidget(view);
|
||||||
|
@@ -20,7 +20,7 @@ namespace Cppcheck::Internal {
|
|||||||
class ManualRunDialog : public QDialog
|
class ManualRunDialog : public QDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ManualRunDialog(QWidget *optionsWidget, const ProjectExplorer::Project *project);
|
explicit ManualRunDialog(const ProjectExplorer::Project *project);
|
||||||
|
|
||||||
Utils::FilePaths filePaths() const;
|
Utils::FilePaths filePaths() const;
|
||||||
QSize sizeHint() const override;
|
QSize sizeHint() const override;
|
||||||
|
@@ -112,9 +112,7 @@ void CppcheckPluginPrivate::startManualRun()
|
|||||||
|
|
||||||
manualRunTool.updateOptions();
|
manualRunTool.updateOptions();
|
||||||
|
|
||||||
auto optionsWidget = settings().layouter()().emerge();
|
ManualRunDialog dialog(project);
|
||||||
|
|
||||||
ManualRunDialog dialog(optionsWidget, project);
|
|
||||||
if (dialog.exec() == ManualRunDialog::Rejected)
|
if (dialog.exec() == ManualRunDialog::Rejected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user