From f4bacb54bdee09e721ef15f31f991c40ea863c3e 2017-06-28 12:44:16 From: Alexandre Leroux Date: 2017-06-28 12:44:16 Subject: [PATCH] Pull request fixes --- diff --git a/core/src/Variable/VariableModel.cpp b/core/src/Variable/VariableModel.cpp index af16df1..044b2a9 100644 --- a/core/src/Variable/VariableModel.cpp +++ b/core/src/Variable/VariableModel.cpp @@ -46,7 +46,7 @@ VariableModel::createVariable(const QString &name, const SqpDateTime &dateTime, std::shared_ptr VariableModel::variable(int index) const { - return (index >= 0 && index < impl->m_Variables.size()) ? impl->m_Variables.at(index) : nullptr; + return (index >= 0 && index < impl->m_Variables.size()) ? impl->m_Variables[index] : nullptr; } int VariableModel::columnCount(const QModelIndex &parent) const diff --git a/gui/include/Variable/VariableInspectorWidget.h b/gui/include/Variable/VariableInspectorWidget.h index 6adb0a0..cc6faee 100644 --- a/gui/include/Variable/VariableInspectorWidget.h +++ b/gui/include/Variable/VariableInspectorWidget.h @@ -1,11 +1,14 @@ #ifndef SCIQLOP_VARIABLEINSPECTORWIDGET_H #define SCIQLOP_VARIABLEINSPECTORWIDGET_H +#include #include #include #include +Q_DECLARE_LOGGING_CATEGORY(LOG_VariableInspectorWidget) + class Variable; namespace Ui { diff --git a/gui/src/Variable/VariableInspectorWidget.cpp b/gui/src/Variable/VariableInspectorWidget.cpp index 0c8dfaa..a31c7d0 100644 --- a/gui/src/Variable/VariableInspectorWidget.cpp +++ b/gui/src/Variable/VariableInspectorWidget.cpp @@ -8,6 +8,8 @@ #include +Q_LOGGING_CATEGORY(LOG_VariableInspectorWidget, "VariableInspectorWidget") + VariableInspectorWidget::VariableInspectorWidget(QWidget *parent) : QWidget{parent}, ui{new Ui::VariableInspectorWidget} { @@ -47,4 +49,9 @@ void VariableInspectorWidget::onTableMenuRequested(const QPoint &pos) noexcept } } } + else { + qCCritical(LOG_VariableInspectorWidget()) + << tr("Can't display menu : invalid index (%1;%2)") + .arg(selectedIndex.row(), selectedIndex.column()); + } }