From e7f764b09056e3a1fecd09ccd011f28ea6f97791 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 29 May 2014 23:51:25 -0300 Subject: Do not show 'trash' icon for deco stops. Besides not deleting them, we shouldn't offer the icon for it. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui/diveplanner.cpp') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 957097507..7091d4f40 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -350,8 +350,8 @@ int DivePlannerPointsModel::columnCount(const QModelIndex &parent) const QVariant DivePlannerPointsModel::data(const QModelIndex &index, int role) const { + divedatapoint p = divepoints.at(index.row()); if (role == Qt::DisplayRole) { - divedatapoint p = divepoints.at(index.row()); switch (index.column()) { case CCSETPOINT: return (double)p.po2 / 1000; @@ -370,7 +370,7 @@ QVariant DivePlannerPointsModel::data(const QModelIndex &index, int role) const } else if (role == Qt::DecorationRole) { switch (index.column()) { case REMOVE: - return QIcon(":trash"); + return p.entered ? QIcon(":trash") : QVariant(); } } else if (role == Qt::FontRole) { if (divepoints.at(index.row()).entered) { -- cgit v1.2.3-70-g09d2