CanFrameModel: Remove superflous breaks after return

This commit is contained in:
Andre Hartmann
2017-11-26 18:00:40 +01:00
parent 55273a1b85
commit 1b24b1677a
+1 -15
View File
@@ -261,23 +261,17 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
{ {
case 0: //timestamp case 0: //timestamp
return Utility::formatTimestamp(thisFrame.timestamp); return Utility::formatTimestamp(thisFrame.timestamp);
break;
case 1: //id case 1: //id
return Utility::formatNumber(thisFrame.ID); return Utility::formatNumber(thisFrame.ID);
break;
case 2: //ext case 2: //ext
return QString::number(thisFrame.extended); return QString::number(thisFrame.extended);
break;
case 3: //direction case 3: //direction
if (thisFrame.isReceived) return QString(tr("Rx")); if (thisFrame.isReceived) return QString(tr("Rx"));
else return QString(tr("Tx")); return QString(tr("Tx"));
break;
case 4: //bus case 4: //bus
return QString::number(thisFrame.bus); return QString::number(thisFrame.bus);
break;
case 5: //len case 5: //len
return QString::number(thisFrame.len); return QString::number(thisFrame.len);
break;
case 6: //data case 6: //data
dLen = thisFrame.len; dLen = thisFrame.len;
if (dLen < 0) dLen = 0; if (dLen < 0) dLen = 0;
@@ -307,7 +301,6 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
} }
} }
return tempString; return tempString;
break;
default: default:
return QVariant(); return QVariant();
} }
@@ -328,25 +321,18 @@ QVariant CANFrameModel::headerData(int section, Qt::Orientation orientation,
{ {
case 0: case 0:
return QString(tr("Timestamp")); return QString(tr("Timestamp"));
break;
case 1: case 1:
return QString(tr("ID")); return QString(tr("ID"));
break;
case 2: case 2:
return QString(tr("Ext")); return QString(tr("Ext"));
break;
case 3: case 3:
return QString(tr("Dir")); return QString(tr("Dir"));
break;
case 4: case 4:
return QString(tr("Bus")); return QString(tr("Bus"));
break;
case 5: case 5:
return QString(tr("Len")); return QString(tr("Len"));
break;
case 6: case 6:
return QString(tr("Data")); return QString(tr("Data"));
break;
} }
} }