diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-22 21:25:05 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-22 21:31:45 -0700 |
commit | 115e5e5fbc5fcf190ceafaa2b800160cec93d52e (patch) | |
tree | 81f8308c48c11b7b3ff393ab35b3ae6999351d5c /qt-ui/models.cpp | |
parent | 775736395363ddfe65387b6e05d37546a4601ab9 (diff) | |
download | subsurface-115e5e5fbc5fcf190ceafaa2b800160cec93d52e.tar.gz |
The never ending, futile fight for whitespace consistency
I just need to write a tool that does this...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index eb5a9a5b4..7ccbe1e49 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -103,12 +103,9 @@ QVariant CylindersModel::data(const QModelIndex& index, int role) const ret = QString("%1%").arg((cyl->gasmix.he.permille + 5) / 10); break; } - } - - else if (role == Qt::DecorationRole){ - if (index.column() == REMOVE){ + } else if (role == Qt::DecorationRole) { + if (index.column() == REMOVE) ret = QIcon(":trash"); - } } return ret; @@ -237,7 +234,7 @@ void CylindersModel::setDive(dive* d) clear(); int amount = MAX_CYLINDERS; - for(int i = 0; i < MAX_CYLINDERS; i++){ + for(int i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cylinder = &d->cylinder[i]; if (cylinder_none(cylinder)) { amount = i; @@ -260,7 +257,7 @@ Qt::ItemFlags CylindersModel::flags(const QModelIndex& index) const void CylindersModel::remove(const QModelIndex& index) { - if (index.column() != REMOVE){ + if (index.column() != REMOVE) { return; } beginRemoveRows(QModelIndex(), index.row(), index.row()); // yah, know, ugly. @@ -272,7 +269,7 @@ void CylindersModel::remove(const QModelIndex& index) void WeightModel::remove(const QModelIndex& index) { - if (index.column() != REMOVE){ + if (index.column() != REMOVE) { return; } beginRemoveRows(QModelIndex(), index.row(), index.row()); // yah, know, ugly. @@ -312,12 +309,9 @@ QVariant WeightModel::data(const QModelIndex& index, int role) const ret = get_weight_string(ws->weight, TRUE); break; } - } - - else if (role == Qt::DecorationRole){ - if (index.column() == REMOVE){ + } else if (role == Qt::DecorationRole) { + if (index.column() == REMOVE) ret = QIcon(":trash"); - } } return ret; } @@ -493,7 +487,7 @@ TankInfoModel::TankInfoModel() : QAbstractTableModel(), rows(-1) void TankInfoModel::update() { - if(rows > -1) { + if (rows > -1) { beginRemoveRows(QModelIndex(), 0, rows); endRemoveRows(); } @@ -548,7 +542,7 @@ QVariant TreeItemDT::data(int column, int role) const ret = tr("min"); break; case TEMPERATURE: - ret = QString("%1%2").arg(UTF8_DEGREE).arg( (get_units()->temperature == units::CELSIUS) ? "C" : "F"); + ret = QString("%1%2").arg(UTF8_DEGREE).arg((get_units()->temperature == units::CELSIUS) ? "C" : "F"); break; case TOTALWEIGHT: ret = (get_units()->weight == units::KG) ? tr("kg") : tr("lbs"); @@ -789,7 +783,7 @@ QVariant DiveTripModel::data(const QModelIndex& index, int role) const if (!index.isValid()) return QVariant(); - if (role == Qt::FontRole){ + if (role == Qt::FontRole) { QFont font; font.setPointSizeF(font.pointSizeF() * 0.7); return font; |