Another braces warning this that I overlooked

Dirk Hohndel dirk at hohndel.org
Thu Oct 22 00:15:37 PDT 2015


On Thu, Oct 22, 2015 at 12:45:47AM +0200, Guido Lerch wrote:
> 
> Morace braces needed.Sorry

Why? What does the compiler complain about? The existing code is correct
and unambiguous. What am I missing?

> diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp
> index c697145..7992545 100644
> --- a/qt-models/cylindermodel.cpp
> +++ b/qt-models/cylindermodel.cpp
> @@ -111,20 +111,22 @@ 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:
> -- 
> 2.3.8 (Apple Git-58)
> 

> _______________________________________________
> subsurface mailing list
> subsurface at subsurface-divelog.org
> http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface



More information about the subsurface mailing list