Whitespace fixes in dive planner

I know this may seem anal retentive... but it's driving me insane.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-09-22 12:34:50 -07:00
parent 9ba7b12767
commit ff58fd7dca

View file

@ -447,9 +447,8 @@ void DivePlannerGraphics::drawProfile()
plannerModel->createTemporaryPlan();
struct diveplan diveplan = plannerModel->getDiveplan();
struct divedatapoint *dp = diveplan.dp;
while(dp->next){
while(dp->next)
dp = dp->next;
}
if (!activeDraggedHandler && (timeLine->maximum() < dp->time / 60.0 + 5 || dp->time / 60.0 + 15 < timeLine->maximum())) {
double newMax = fmax(dp->time / 60.0 + 5, minMinutes);
@ -823,11 +822,11 @@ Button::Button(QObject* parent): QObject(parent), QGraphicsRectItem()
void Button::setPixmap(const QPixmap& pixmap)
{
icon->setPixmap(pixmap.scaled(20,20, Qt::KeepAspectRatio, Qt::SmoothTransformation));
if(pixmap.isNull()){
if(pixmap.isNull())
icon->hide();
}else{
else
icon->show();
}
setRect(childrenBoundingRect());
}
@ -943,13 +942,11 @@ QVariant DivePlannerPointsModel::data(const QModelIndex& index, int role) const
case DURATION: return p.time / 60;
case GAS: return strForAir(p);
}
}
else if (role == Qt::DecorationRole){
} else if (role == Qt::DecorationRole) {
switch(index.column()) {
case REMOVE : return QIcon(":trash");
}
}
else if (role == Qt::FontRole){
} else if (role == Qt::FontRole) {
return defaultModelFont();
}
return QVariant();
@ -992,8 +989,7 @@ QVariant DivePlannerPointsModel::headerData(int section, Qt::Orientation orienta
case GAS: return tr("Used Gas");
case CCSETPOINT: return tr("CC Set Point");
}
}
else if (role == Qt::FontRole){
} else if (role == Qt::FontRole) {
return defaultModelFont();
}
return QVariant();
@ -1059,9 +1055,11 @@ void DivePlannerPointsModel::setStartTime(const QTime& t)
emit dataChanged(createIndex(0, 0), createIndex(rowCount()-1, COLUMNS-1));
}
bool divePointsLessThan(const divedatapoint& p1, const divedatapoint& p2){
bool divePointsLessThan(const divedatapoint& p1, const divedatapoint& p2)
{
return p1.time <= p2.time;
}
int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas, int ccpoint)
{
int row = divepoints.count();
@ -1069,8 +1067,7 @@ int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas,
if(row == 0) {
meters = 10000;
minutes = 600;
}
else{
} else {
divedatapoint p = at(row-1);
meters = p.depth;
minutes = p.time + 600;
@ -1194,9 +1191,8 @@ void DivePlannerPointsModel::deleteTemporaryPlan()
void DivePlannerPointsModel::deleteTemporaryPlan(struct divedatapoint *dp)
{
if (!dp){
if (!dp)
return;
}
deleteTemporaryPlan(dp->next);
free(dp);