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 <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Joakim Bygdell 2015-10-19 20:05:24 +02:00 committed by Dirk Hohndel
parent dffd2857f6
commit 0c9d71234f

View file

@ -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: