From 2cfb35b6d7b5bb7bb7275f078bf2aff959e6ecef Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 3 Nov 2019 15:25:23 +0100 Subject: Cleanup: return value type from WeightModel::weightSystemAt() There is only one caller of WeightModel::weightSystemAt() and that certainly does not need a pointer into the weightsystem-table of the current dive. Return a value type instead of a pointer. This allows us to mark WeightModel::weightSystemAt() as const and use it from WeightModel::data(). Slightly cleaner code. Signed-off-by: Berthold Stoeger --- desktop-widgets/modeldelegates.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp index 770a828cd..6d5d9f9a4 100644 --- a/desktop-widgets/modeldelegates.cpp +++ b/desktop-widgets/modeldelegates.cpp @@ -371,9 +371,9 @@ QWidget *WSInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewIte /* First, call the combobox-create editor, it will setup our globals. */ QWidget *editor = ComboBoxDelegate::createEditor(parent, option, index); WeightModel *mymodel = qobject_cast(currCombo.model); - weightsystem_t *ws = mymodel->weightSystemAt(index); - currWeight.type = ws->description; - currWeight.weight = ws->weight.grams; + weightsystem_t ws = mymodel->weightSystemAt(index); + currWeight.type = ws.description; + currWeight.weight = ws.weight.grams; return editor; } -- cgit v1.2.3-70-g09d2