From f1c682b55a52c11d7cb57da0fc66d6edb118ba77 Mon Sep 17 00:00:00 2001 From: Guido Lerch Date: Thu, 22 Oct 2015 00:17:05 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-models/cylindermodel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qt-models/cylindermodel.cpp') diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index 8c9bee8b1..8341d3608 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -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: -- cgit v1.2.3-70-g09d2