TargetSetupWidget: Replace a range of lists with a list of struct

Simpler to make sure all the data is in place at all times that way.

Change-Id: I73d88f4c31d8447547ccf6de808ea00066db4f37
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2018-03-08 13:01:18 +01:00
parent a23615e41c
commit 41df91ece8
2 changed files with 99 additions and 83 deletions

View File

@@ -60,7 +60,6 @@ public:
TargetSetupWidget(Kit *k,
const QString &projectPath,
const QList<BuildInfo *> &infoList);
~TargetSetupWidget() override;
Kit *kit();
void clearKit();
@@ -95,14 +94,27 @@ private:
Utils::DetailsWidget *m_detailsWidget;
QPushButton *m_manageButton;
QGridLayout *m_newBuildsLayout;
QList<QCheckBox *> m_checkboxes;
QList<Utils::PathChooser *> m_pathChoosers;
QList<BuildInfo *> m_infoList;
QList<bool> m_enabled;
QList<QLabel *> m_reportIssuesLabels;
QList<bool> m_issues;
struct BuildInfoStore {
~BuildInfoStore();
BuildInfoStore() = default;
BuildInfoStore(const BuildInfoStore &other) = delete;
BuildInfoStore(BuildInfoStore &&other);
BuildInfoStore &operator=(const BuildInfoStore &other) = delete;
BuildInfoStore &operator=(BuildInfoStore &&other) = delete;
BuildInfo *buildInfo = nullptr;
QCheckBox *checkbox = nullptr;
QLabel *label = nullptr;
QLabel *issuesLabel = nullptr;
Utils::PathChooser *pathChooser = nullptr;
bool isEnabled = false;
bool hasIssues = false;
};
std::vector<BuildInfoStore> m_infoStore;
bool m_ignoreChange = false;
int m_selected = 0; // Number of selected buildconfiguartions
int m_selected = 0; // Number of selected "buildconfiguartions"
};
} // namespace Internal