diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-01-17 06:30:47 +0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-17 06:39:24 +0700 |
commit | 09d08ddc1c13850557af28e8349bddd13ef5deec (patch) | |
tree | 3db5560d2f2efb36d1b291ad0a92f9018ea5aac1 | |
parent | 2e4dcba009337dfafe6afbf97a11c6470834dabd (diff) | |
download | subsurface-09d08ddc1c13850557af28e8349bddd13ef5deec.tar.gz |
Fix compile time warnings
Plus some small whitespace fixes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/profile/divecartesianaxis.cpp | 16 | ||||
-rw-r--r-- | qt-ui/profile/diveeventitem.cpp | 12 | ||||
-rw-r--r-- | qt-ui/profile/profilewidget2.cpp | 2 |
3 files changed, 16 insertions, 14 deletions
diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index 214171d69..3ab4a4e26 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -161,7 +161,8 @@ qreal DiveCartesianAxis::posAtValue(qreal value) QPointF p = pos(); double size = max - min; - double distanceFromOrigin = value - min; + // unused for now: + // double distanceFromOrigin = value - min; double percent = (value - min) / size; double realSize = orientation == LeftToRight || orientation == RightToLeft? @@ -169,9 +170,8 @@ qreal DiveCartesianAxis::posAtValue(qreal value) m.y2() - m.y1(); // Inverted axis, just invert the percentage. - if(orientation == RightToLeft || orientation == BottomToTop){ + if (orientation == RightToLeft || orientation == BottomToTop) percent = 1 - percent; - } double retValue = realSize * percent; double adjusted = @@ -222,7 +222,7 @@ QString TimeAxis::textForValue(double value) QString TemperatureAxis::textForValue(double value) { - return QString::number(mkelvin_to_C( (int) value)); + return QString::number(mkelvin_to_C( (int) value)); } @@ -275,9 +275,11 @@ void DiveCartesianPlane::setup() // This creates a Grid around the axis, creating the cartesian plane. const int top = leftAxis->posAtValue(leftAxis->minimum()); - const int bottom = leftAxis->posAtValue(leftAxis->maximum()); + // unused for now: + // const int bottom = leftAxis->posAtValue(leftAxis->maximum()); const int left = bottomAxis->posAtValue(bottomAxis->minimum()); - const int right = bottomAxis->posAtValue(bottomAxis->maximum()); + // unused for now: + // const int right = bottomAxis->posAtValue(bottomAxis->maximum()); setRect(0, 0, horizontalSize, verticalSize); setPos(left, top); @@ -305,4 +307,4 @@ void DiveCartesianPlane::setup() verticalLines.push_back(line); scene()->addItem(line); } -}
\ No newline at end of file +} diff --git a/qt-ui/profile/diveeventitem.cpp b/qt-ui/profile/diveeventitem.cpp index 8709a1484..7b748fedd 100644 --- a/qt-ui/profile/diveeventitem.cpp +++ b/qt-ui/profile/diveeventitem.cpp @@ -5,7 +5,7 @@ #include <QDebug> DiveEventItem::DiveEventItem(QObject* parent): DivePixmapItem(parent), - vAxis(NULL), hAxis(NULL), internalEvent(NULL), dataModel(NULL) + vAxis(NULL), hAxis(NULL), dataModel(NULL), internalEvent(NULL) { setFlag(ItemIgnoresTransformations); } @@ -40,11 +40,11 @@ void DiveEventItem::setEvent(struct event* ev) void DiveEventItem::setupPixmap() { #define EVENT_PIXMAP( PIX ) QPixmap(QString(PIX)).scaled(20, 20, Qt::KeepAspectRatio, Qt::SmoothTransformation) - if(!internalEvent->name){ + if (!internalEvent->name) { setPixmap(EVENT_PIXMAP(":warning")); } else if ((strcmp(internalEvent->name, "bookmark") == 0)) { setPixmap(EVENT_PIXMAP(":flag")); - } else if(strcmp(internalEvent->name, "heading") == 0){ + } else if(strcmp(internalEvent->name, "heading") == 0) { setPixmap(EVENT_PIXMAP(":flag")); } else { setPixmap(EVENT_PIXMAP(":warning")); @@ -104,15 +104,15 @@ void DiveEventItem::eventVisibilityChanged(const QString& eventName, bool visibl void DiveEventItem::recalculatePos() { - if (!vAxis || !hAxis || !internalEvent || !dataModel){ + if (!vAxis || !hAxis || !internalEvent || !dataModel) { return; } QModelIndexList result = dataModel->match(dataModel->index(0,DivePlotDataModel::TIME), Qt::DisplayRole, internalEvent->time.seconds ); - if(result.isEmpty()){ + if (result.isEmpty()) { hide(); return; } - if(!isVisible()){ + if (!isVisible()) { show(); } int depth = dataModel->data(dataModel->index(result.first().row(), DivePlotDataModel::DEPTH)).toInt(); diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index b7489cc25..ebe9db9c3 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -27,8 +27,8 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : stateMachine(new QStateMachine(this)), background (new DivePixmapItem()), profileYAxis(new DepthAxis()), - temperatureAxis(new TemperatureAxis()), gasYAxis(new DiveCartesianAxis()), + temperatureAxis(new TemperatureAxis()), timeAxis(new TimeAxis()), depthController(new DiveRectItem()), timeController(new DiveRectItem()), |