1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 14:53:21 +02:00

Removed debug stuff from release builds

This commit is contained in:
Martin Tůma 2018-02-13 23:03:18 +01:00
parent 18fc6cc3e2
commit b6e798f5c3
35 changed files with 82 additions and 7 deletions

View File

@ -25,11 +25,13 @@ private:
qreal _left, _top, _right, _bottom;
};
#ifndef QT_NO_DEBUG
inline QDebug operator<<(QDebug dbg, const MarginsF &margins)
{
dbg.nospace() << "MarginsF(" << margins.left() << ", " << margins.top()
<< ", " << margins.right() << margins.bottom() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
#endif // MARGINS_H

View File

@ -37,9 +37,11 @@ void Palette::reset()
_state = _h;
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Palette &palette)
{
dbg.nospace() << "Palette(" << palette.color() << ", " << palette.shift()
<< ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -28,6 +28,8 @@ private:
qreal _state;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Palette &palette);
#endif // QT_NO_DEBUG
#endif // PALLETE_H

View File

@ -16,12 +16,6 @@ qreal Coordinates::distanceTo(const Coordinates &c) const
return (WGS84_RADIUS * (2.0 * atan2(sqrt(a), sqrt(1.0 - a))));
}
QDebug operator<<(QDebug dbg, const Coordinates &c)
{
dbg.nospace() << "Coordinates(" << c.lon() << ", " << c.lat() << ")";
return dbg.space();
}
QPair<Coordinates, Coordinates> Coordinates::boundingRect(qreal distance) const
{
qreal radDist = distance / WGS84_RADIUS;
@ -50,3 +44,11 @@ QPair<Coordinates, Coordinates> Coordinates::boundingRect(qreal distance) const
maxLon)), rad2deg(qMin(minLat, maxLat))), Coordinates(rad2deg(qMax(minLon,
maxLon)), rad2deg(qMax(minLat, maxLat))));
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Coordinates &c)
{
dbg.nospace() << "Coordinates(" << c.lon() << ", " << c.lat() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -43,6 +43,8 @@ inline bool operator==(const Coordinates &c1, const Coordinates &c2)
inline bool operator!=(const Coordinates &c1, const Coordinates &c2)
{return !(c1 == c2);}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Coordinates &c);
#endif // QT_NO_DEBUG
#endif // COORDINATES_H

View File

@ -8,6 +8,7 @@ void RangeF::resize(qreal size)
_max += adj;
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Range &range)
{
dbg.nospace() << "Range(" << range.min() << ", " << range.max() << ")";
@ -19,3 +20,4 @@ QDebug operator<<(QDebug dbg, const RangeF &range)
dbg.nospace() << "RangeF(" << range.min() << ", " << range.max() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -34,7 +34,9 @@ private:
qreal _min, _max;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Range &range);
QDebug operator<<(QDebug dbg, const RangeF &range);
#endif // QT_NO_DEBUG
#endif // RANGE_H

View File

@ -61,8 +61,10 @@ void RectC::unite(const Coordinates &c)
}
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const RectC &rect)
{
dbg.nospace() << "RectC(" << rect.topLeft() << ", " << rect.size() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -37,6 +37,8 @@ private:
Coordinates _tl, _br;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const RectC &rect);
#endif // QT_NO_DEBUG
#endif // RECTC_H

View File

@ -30,12 +30,14 @@ private:
Q_DECLARE_TYPEINFO(GraphPoint, Q_PRIMITIVE_TYPE);
#ifndef QT_NO_DEBUG
inline QDebug operator<<(QDebug dbg, const GraphPoint &point)
{
dbg.nospace() << "GraphPoint(" << point.s() << ", " << point.t() << ", "
<< point.y() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
typedef QVector<GraphPoint> Graph;

View File

@ -13,9 +13,11 @@ RectC Path::boundingRect() const
return ret;
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PathPoint &point)
{
dbg.nospace() << "PathPoint(" << point.distance() << ", "
<< point.coordinates() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -23,7 +23,9 @@ private:
};
Q_DECLARE_TYPEINFO(PathPoint, Q_PRIMITIVE_TYPE);
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PathPoint &point);
#endif // QT_NO_DEBUG
class Path : public QVector<PathPoint>

View File

@ -57,6 +57,7 @@ private:
Q_DECLARE_TYPEINFO(Trackpoint, Q_MOVABLE_TYPE);
#ifndef QT_NO_DEBUG
inline QDebug operator<<(QDebug dbg, const Trackpoint &trackpoint)
{
dbg.nospace() << "Trackpoint(" << trackpoint.coordinates() << ", "
@ -65,5 +66,6 @@ inline QDebug operator<<(QDebug dbg, const Trackpoint &trackpoint)
<< trackpoint.temperature() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
#endif // TRACKPOINT_H

View File

@ -48,12 +48,14 @@ inline uint qHash(const Waypoint &key)
return ::qHash(key.name());
}
#ifndef QT_NO_DEBUG
inline QDebug operator<<(QDebug dbg, const Waypoint &waypoint)
{
dbg.nospace() << "Waypoint(" << waypoint.coordinates() << ", "
<< waypoint.name() << ", " << waypoint.description() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
Q_DECLARE_TYPEINFO(Waypoint, Q_MOVABLE_TYPE);

View File

@ -83,8 +83,10 @@ double AngularUnits::fromDegrees(double val) const
return (_code == 9110) ? deg2sDMS(val) : val / _f;
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const AngularUnits &au)
{
dbg.nospace() << "AngularUnits(" << deg2rad(au._f) << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -17,8 +17,9 @@ public:
double fromDegrees(double val) const;
friend bool operator==(const AngularUnits &au1, const AngularUnits &au2);
#ifndef QT_NO_DEBUG
friend QDebug operator<<(QDebug dbg, const AngularUnits &au);
#endif // QT_NO_DEBUG
private:
int _code;
double _f;
@ -27,6 +28,8 @@ private:
inline bool operator==(const AngularUnits &au1, const AngularUnits &au2)
{return (au1._f == au2._f);}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const AngularUnits &au);
#endif // QT_NO_DEBUG
#endif // ANGULARUNITS_H

View File

@ -61,9 +61,11 @@ Coordinates Datum::fromWGS84(const Coordinates &c) const
return _WGS84 ? c : molodensky(c, WGS84, *this);
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Datum &datum)
{
dbg.nospace() << "Datum(" << *datum.ellipsoid() << ", " << datum.dx()
<< ", " << datum.dy() << ", " << datum.dz() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -39,6 +39,8 @@ inline bool operator==(const Datum &d1, const Datum &d2)
{return (d1.ellipsoid() == d2.ellipsoid() && d1.dx() == d2.dx()
&& d1.dy() == d2.dy() && d1.dz() == d2.dz());}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Datum &datum);
#endif // QT_NO_DEBUG
#endif // DATUM_H

View File

@ -66,9 +66,11 @@ void Ellipsoid::loadList(const QString &path)
}
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Ellipsoid &ellipsoid)
{
dbg.nospace() << "Ellipsoid(" << ellipsoid.radius() << ", "
<< 1.0 / ellipsoid.flattening() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -35,6 +35,8 @@ private:
inline bool operator==(const Ellipsoid &e1, const Ellipsoid &e2)
{return (e1.radius() == e2.radius() && e1.flattening() == e2.flattening());}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Ellipsoid &ellipsoid);
#endif // QT_NO_DEBUG
#endif // ELLIPSOID_H

View File

@ -183,9 +183,11 @@ Coordinates GCS::fromWGS84(const Coordinates &c) const
return Coordinates(_primeMeridian.fromGreenwich(ds.lon()), ds.lat());
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const GCS &gcs)
{
dbg.nospace() << "GCS(" << gcs.datum() << ", " << gcs.primeMeridian()
<< ", " << gcs.angularUnits() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -50,6 +50,8 @@ inline bool operator==(const GCS &gcs1, const GCS &gcs2)
&& gcs1.primeMeridian() == gcs2.primeMeridian()
&& gcs1.angularUnits() == gcs2.angularUnits());}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const GCS &gcs);
#endif // QT_NO_DEBUG
#endif // GCS_H

View File

@ -20,8 +20,10 @@ LinearUnits::LinearUnits(int code)
}
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const LinearUnits &lu)
{
dbg.nospace() << "LinearUnits(" << lu._f << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -22,7 +22,9 @@ public:
{return QPointF(p.x() / _f, p.y() /_f);}
friend bool operator==(const LinearUnits &lu1, const LinearUnits &lu2);
#ifndef QT_NO_DEBUG
friend QDebug operator<<(QDebug dbg, const LinearUnits &lu);
#endif // QT_NO_DEBUG
private:
double _f;
@ -31,6 +33,8 @@ private:
inline bool operator==(const LinearUnits &lu1, const LinearUnits &lu2)
{return (lu1._f == lu2._f);}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const LinearUnits &lu);
#endif // QT_NO_DEBUG
#endif // LINEARUNITS_H

View File

@ -116,6 +116,7 @@ void Matrix::zeroize()
_m[i] = 0;
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Matrix &matrix)
{
dbg.nospace() << "Matrix(" << endl;
@ -128,3 +129,4 @@ QDebug operator<<(QDebug dbg, const Matrix &matrix)
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -31,6 +31,8 @@ private:
size_t _w;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Matrix &matrix);
#endif // QT_NO_DEBUG
#endif // MATRIX_H

View File

@ -187,9 +187,11 @@ void PCS::loadList(const QString &path)
}
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PCS &pcs)
{
dbg.nospace() << "PCS(" << *pcs.gcs() << ", " << pcs.method() << ", "
<< pcs.units() << ", " << pcs.setup() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -43,6 +43,8 @@ private:
static GCS _nullGCS;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PCS &pcs);
#endif // QT_NO_DEBUG
#endif // PCS_H

View File

@ -66,8 +66,10 @@ double PrimeMeridian::fromGreenwich(double val) const
return shift(val, -_pm);
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PrimeMeridian &pm)
{
dbg.nospace() << "PrimeMeridian(" << pm._pm << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -17,7 +17,9 @@ public:
double fromGreenwich(double val) const;
friend bool operator==(const PrimeMeridian &pm1, const PrimeMeridian &pm2);
#ifndef QT_NO_DEBUG
friend QDebug operator<<(QDebug dbg, const PrimeMeridian &pm);
#endif // QT_NO_DEBUG
private:
double _pm;
@ -26,6 +28,8 @@ private:
inline bool operator==(const PrimeMeridian &pm1, const PrimeMeridian &pm2)
{return (pm1._pm == pm2._pm);}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const PrimeMeridian &pm);
#endif // QT_NO_DEBUG
#endif // PRIMEMERIDIAN_H

View File

@ -105,6 +105,7 @@ Coordinates Projection::xy2ll(const QPointF &p) const
return _gcs->toWGS84(_ct->xy2ll(_units.toMeters(p)));
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Projection::Setup &setup)
{
dbg.nospace() << "Setup(" << setup.latitudeOrigin() << ", "
@ -119,3 +120,4 @@ QDebug operator<<(QDebug dbg, const Projection::Method &method)
dbg.nospace() << "Method(" << method.id() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -86,7 +86,9 @@ private:
LinearUnits _units;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const Projection::Setup &setup);
QDebug operator<<(QDebug dbg, const Projection::Method &method);
#endif // QT_NO_DEBUG
#endif // PROJECTION_H

View File

@ -21,10 +21,12 @@ private:
QPixmap _pixmap;
};
#ifndef QT_NO_DEBUG
inline QDebug operator<<(QDebug dbg, const Tile &tile)
{
dbg.nospace() << "Tile(" << tile.zoom() << ", " << tile.xy() << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG
#endif // TILE_H

View File

@ -73,8 +73,10 @@ Transform::Transform(const QList<ReferencePoint> &points)
affine(points);
}
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const ReferencePoint &p)
{
dbg.nospace() << "ReferencePoint(" << p.xy << ", " << p.pp << ")";
return dbg.space();
}
#endif // QT_NO_DEBUG

View File

@ -27,6 +27,8 @@ private:
QString _errorString;
};
#ifndef QT_NO_DEBUG
QDebug operator<<(QDebug dbg, const ReferencePoint &p);
#endif // QT_NO_DEBUG
#endif // TRANSFORM_H