From 0c9d71234fd49e1924124e8898604d087b21792e Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Mon, 19 Oct 2015 20:05:24 +0200 Subject: Show correct icon when only one gasmix in the list When there is only one gasmix in the list we should show the icon that tells the user that they can't remove the last gasmix from the list. Signed-off-by: Joakim Bygdell Signed-off-by: Dirk Hohndel --- qt-models/cylindermodel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index 8786f7889..8c9bee8b1 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -112,11 +112,17 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const break; case Qt::DecorationRole: if (index.column() == REMOVE) - ret = trashIcon(); + if (rowCount() > 1) + ret = trashIcon(); + else + ret = trashForbiddenIcon(); break; case Qt::SizeHintRole: if (index.column() == REMOVE) - ret = trashIcon().size(); + if (rowCount() > 1) + ret = trashIcon(); + else + ret = trashForbiddenIcon(); break; case Qt::ToolTipRole: -- cgit v1.2.3-70-g09d2