Good deal of whitespace fixes and code cleanup.

I just went thru all of subsurface code removing
some whitespaces issues and trying to make the
code prettyer, I also removed a few QString issues.d

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-10-11 10:21:04 -03:00
parent 9ed933d033
commit 1b9a4f2bf8
11 changed files with 50 additions and 131 deletions

View file

@ -211,17 +211,15 @@ void DivePlannerGraphics::pointInserted(const QModelIndex& parent, int start , i
void DivePlannerGraphics::keyDownAction()
{
if (scene()->selectedItems().count()) {
Q_FOREACH(QGraphicsItem *i, scene()->selectedItems()) {
if (DiveHandler *handler = qgraphicsitem_cast<DiveHandler*>(i)) {
int row = handles.indexOf(handler);
divedatapoint dp = plannerModel->at(row);
if (dp.depth >= depthLine->maximum())
continue;
Q_FOREACH(QGraphicsItem *i, scene()->selectedItems()) {
if (DiveHandler *handler = qgraphicsitem_cast<DiveHandler*>(i)) {
int row = handles.indexOf(handler);
divedatapoint dp = plannerModel->at(row);
if (dp.depth >= depthLine->maximum())
continue;
dp.depth += M_OR_FT(1,5);
plannerModel->editStop(row, dp);
}
dp.depth += M_OR_FT(1,5);
plannerModel->editStop(row, dp);
}
}
}
@ -397,13 +395,9 @@ void DivePlannerGraphics::decreaseDepth()
void DivePlannerGraphics::decreaseTime()
{
if (timeLine->maximum() - 10 < TIME_INITIAL_MAX) {
if (timeLine->maximum() - 10 < TIME_INITIAL_MAX || timeLine->maximum() - 10 < dpMaxTime)
return;
}
if (timeLine->maximum() - 10 < dpMaxTime) {
qDebug() << timeLine->maximum() << dpMaxTime;
return;
}
minMinutes -= 10;
timeLine->setMaximum(timeLine->maximum() - 10);
timeLine->updateTicks();
@ -575,7 +569,6 @@ void DivePlannerGraphics::moveActiveHandler(const QPointF& mappedPos, const int
maxtime = plannerModel->at(pos + 1).time;
int minutes = rint(timeLine->valueAt(mappedPos));
if (minutes * 60 <= mintime || minutes * 60 >= maxtime)
return;
@ -591,10 +584,7 @@ void DivePlannerGraphics::moveActiveHandler(const QPointF& mappedPos, const int
activeDraggedHandler->setPos(QPointF(xpos, ypos));
qDeleteAll(lines);
lines.clear();
drawProfile();
}
bool DivePlannerGraphics::isPointOutOfBoundaries(const QPointF& point)
@ -758,7 +748,6 @@ void Ruler::setTickSize(qreal size)
tickSize = size;
}
void Ruler::setTickInterval(double i)
{
interval = i;
@ -796,7 +785,6 @@ qreal Ruler::percentAt(const QPointF& p)
return percent;
}
double Ruler::maximum() const
{
return max;
@ -1228,6 +1216,5 @@ void DivePlannerPointsModel::createPlan()
beginRemoveRows(QModelIndex(), 0, rowCount() -1 );
divepoints.clear();
endRemoveRows();
planCreated();
}