From cd8490d9043f2021e2e0e4d6a44fa14792eec725 2017-07-13 08:12:26 From: mperrinel Date: 2017-07-13 08:12:26 Subject: [PATCH] Correction MR --- diff --git a/core/include/Variable/VariableModel.h b/core/include/Variable/VariableModel.h index d2ece46..554c292 100644 --- a/core/include/Variable/VariableModel.h +++ b/core/include/Variable/VariableModel.h @@ -12,7 +12,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_VariableModel) -enum VariableRoles { progressRole = Qt::UserRole }; +enum VariableRoles { ProgressRole = Qt::UserRole }; class IDataSeries; diff --git a/core/src/Variable/VariableModel.cpp b/core/src/Variable/VariableModel.cpp index 8acdcf7..af06461 100644 --- a/core/src/Variable/VariableModel.cpp +++ b/core/src/Variable/VariableModel.cpp @@ -50,7 +50,7 @@ struct VariableModel::VariableModelPrivate { std::unordered_map, double> m_VariableToProgress; - /// Return te row index of the variable + /// Return the row index of the variable. -1 if it's not found int indexOfVariable(Variable *variable) const noexcept; }; @@ -169,7 +169,7 @@ QVariant VariableModel::data(const QModelIndex &index, int role) const qWarning(LOG_VariableModel()) << tr("Can't get data (no variable)"); } } - else if (role == VariableRoles::progressRole) { + else if (role == VariableRoles::ProgressRole) { if (auto variable = impl->m_Variables.at(index.row())) { auto it = impl->m_VariableToProgress.find(variable); diff --git a/gui/src/Variable/VariableInspectorWidget.cpp b/gui/src/Variable/VariableInspectorWidget.cpp index cded64b..3b2e9ae 100644 --- a/gui/src/Variable/VariableInspectorWidget.cpp +++ b/gui/src/Variable/VariableInspectorWidget.cpp @@ -17,13 +17,13 @@ Q_LOGGING_CATEGORY(LOG_VariableInspectorWidget, "VariableInspectorWidget") class QProgressBarItemDelegate : public QStyledItemDelegate { public: - QProgressBarItemDelegate(QObject *parent) : QStyledItemDelegate(parent) {} + QProgressBarItemDelegate(QObject *parent) : QStyledItemDelegate{parent} {} void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { auto data = index.data(Qt::DisplayRole); - auto progressData = index.data(VariableRoles::progressRole); + auto progressData = index.data(VariableRoles::ProgressRole); if (data.isValid() && progressData.isValid()) { auto name = data.value(); auto progress = progressData.value(); @@ -51,7 +51,7 @@ public: VariableInspectorWidget::VariableInspectorWidget(QWidget *parent) : QWidget{parent}, ui{new Ui::VariableInspectorWidget}, - m_ProgressBarItemDelegate{new QProgressBarItemDelegate(this)} + m_ProgressBarItemDelegate{new QProgressBarItemDelegate{this}} { ui->setupUi(this);