mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
9ba7b12767
commit
ff58fd7dca
1 changed files with 60 additions and 64 deletions
|
@ -447,9 +447,8 @@ void DivePlannerGraphics::drawProfile()
|
||||||
plannerModel->createTemporaryPlan();
|
plannerModel->createTemporaryPlan();
|
||||||
struct diveplan diveplan = plannerModel->getDiveplan();
|
struct diveplan diveplan = plannerModel->getDiveplan();
|
||||||
struct divedatapoint *dp = diveplan.dp;
|
struct divedatapoint *dp = diveplan.dp;
|
||||||
while(dp->next){
|
while(dp->next)
|
||||||
dp = dp->next;
|
dp = dp->next;
|
||||||
}
|
|
||||||
|
|
||||||
if (!activeDraggedHandler && (timeLine->maximum() < dp->time / 60.0 + 5 || dp->time / 60.0 + 15 < timeLine->maximum())) {
|
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);
|
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)
|
void Button::setPixmap(const QPixmap& pixmap)
|
||||||
{
|
{
|
||||||
icon->setPixmap(pixmap.scaled(20,20, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
icon->setPixmap(pixmap.scaled(20,20, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||||
if(pixmap.isNull()){
|
if(pixmap.isNull())
|
||||||
icon->hide();
|
icon->hide();
|
||||||
}else{
|
else
|
||||||
icon->show();
|
icon->show();
|
||||||
}
|
|
||||||
setRect(childrenBoundingRect());
|
setRect(childrenBoundingRect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -943,13 +942,11 @@ QVariant DivePlannerPointsModel::data(const QModelIndex& index, int role) const
|
||||||
case DURATION: return p.time / 60;
|
case DURATION: return p.time / 60;
|
||||||
case GAS: return strForAir(p);
|
case GAS: return strForAir(p);
|
||||||
}
|
}
|
||||||
}
|
} else if (role == Qt::DecorationRole) {
|
||||||
else if (role == Qt::DecorationRole){
|
|
||||||
switch(index.column()) {
|
switch(index.column()) {
|
||||||
case REMOVE : return QIcon(":trash");
|
case REMOVE : return QIcon(":trash");
|
||||||
}
|
}
|
||||||
}
|
} else if (role == Qt::FontRole) {
|
||||||
else if (role == Qt::FontRole){
|
|
||||||
return defaultModelFont();
|
return defaultModelFont();
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
@ -992,8 +989,7 @@ QVariant DivePlannerPointsModel::headerData(int section, Qt::Orientation orienta
|
||||||
case GAS: return tr("Used Gas");
|
case GAS: return tr("Used Gas");
|
||||||
case CCSETPOINT: return tr("CC Set Point");
|
case CCSETPOINT: return tr("CC Set Point");
|
||||||
}
|
}
|
||||||
}
|
} else if (role == Qt::FontRole) {
|
||||||
else if (role == Qt::FontRole){
|
|
||||||
return defaultModelFont();
|
return defaultModelFont();
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
@ -1059,9 +1055,11 @@ void DivePlannerPointsModel::setStartTime(const QTime& t)
|
||||||
emit dataChanged(createIndex(0, 0), createIndex(rowCount()-1, COLUMNS-1));
|
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;
|
return p1.time <= p2.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas, int ccpoint)
|
int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas, int ccpoint)
|
||||||
{
|
{
|
||||||
int row = divepoints.count();
|
int row = divepoints.count();
|
||||||
|
@ -1069,8 +1067,7 @@ int DivePlannerPointsModel::addStop(int meters, int minutes, const QString& gas,
|
||||||
if(row == 0) {
|
if(row == 0) {
|
||||||
meters = 10000;
|
meters = 10000;
|
||||||
minutes = 600;
|
minutes = 600;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
divedatapoint p = at(row-1);
|
divedatapoint p = at(row-1);
|
||||||
meters = p.depth;
|
meters = p.depth;
|
||||||
minutes = p.time + 600;
|
minutes = p.time + 600;
|
||||||
|
@ -1194,9 +1191,8 @@ void DivePlannerPointsModel::deleteTemporaryPlan()
|
||||||
|
|
||||||
void DivePlannerPointsModel::deleteTemporaryPlan(struct divedatapoint *dp)
|
void DivePlannerPointsModel::deleteTemporaryPlan(struct divedatapoint *dp)
|
||||||
{
|
{
|
||||||
if (!dp){
|
if (!dp)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
deleteTemporaryPlan(dp->next);
|
deleteTemporaryPlan(dp->next);
|
||||||
free(dp);
|
free(dp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue