Fixing annoying compiler warning

Adding { } to if clause to avoid dangling warning
/Users/guidolerch/src/subsurface/qt-models/cylindermodel.cpp:117:
warning: add explicit braces to avoid dangling else [-Wdangling-else]

[Dirk Hohndel: combined two of Guido's patches to one that is simpler]

Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Guido Lerch 2015-10-22 00:17:05 +02:00 committed by Dirk Hohndel
parent ac8e05c4ec
commit f1c682b55a

View file

@ -111,18 +111,20 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
}
break;
case Qt::DecorationRole:
if (index.column() == REMOVE)
if (index.column() == REMOVE) {
if (rowCount() > 1)
ret = trashIcon();
else
ret = trashForbiddenIcon();
}
break;
case Qt::SizeHintRole:
if (index.column() == REMOVE)
if (index.column() == REMOVE) {
if (rowCount() > 1)
ret = trashIcon();
else
ret = trashForbiddenIcon();
}
break;
case Qt::ToolTipRole: