Use existing helper function

And remove spurious extra ';'

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-12 16:33:01 +09:00
parent 662b1061f0
commit 83a7f1f5b4

View file

@ -175,7 +175,7 @@ cylinder_t* CylindersModel::cylinderAt(const QModelIndex& index)
// so we only implement the two columns we care about // so we only implement the two columns we care about
void CylindersModel::passInData(const QModelIndex& index, const QVariant& value) void CylindersModel::passInData(const QModelIndex& index, const QVariant& value)
{ {
cylinder_t *cyl = &current->cylinder[index.row()]; cylinder_t *cyl = cylinderAt(index);
switch(index.column()) { switch(index.column()) {
case SIZE: case SIZE:
if (cyl->type.size.mliter != value.toInt()) { if (cyl->type.size.mliter != value.toInt()) {
@ -196,7 +196,7 @@ void CylindersModel::passInData(const QModelIndex& index, const QVariant& value)
bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, int role) bool CylindersModel::setData(const QModelIndex& index, const QVariant& value, int role)
{ {
cylinder_t *cyl = &current->cylinder[index.row()]; cylinder_t *cyl = cylinderAt(index);
switch(index.column()) { switch(index.column()) {
case TYPE: case TYPE:
if (!value.isNull()) { if (!value.isNull()) {
@ -1510,7 +1510,7 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const
switch (role) { switch (role) {
case Qt::DisplayRole: { case Qt::DisplayRole: {
struct DiveItem di; struct DiveItem di;
di.dive = dive;; di.dive = dive;
char buf[80]; char buf[80];
const QString unknown = tr("unknown"); const QString unknown = tr("unknown");