mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Fixed most clazy warnings
This commit is contained in:
parent
bda24d9091
commit
8821536419
@ -24,12 +24,12 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
|
||||
installTranslator(gpxsee);
|
||||
|
||||
QTranslator *qt = new QTranslator(this);
|
||||
#if defined(Q_OS_WINDOWS) || defined(Q_OS_MAC)
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
|
||||
qt->load(QLocale::system(), "qt", "_", TRANSLATIONS_DIR);
|
||||
#else // Q_OS_WINDOWS || Q_OS_MAC
|
||||
#else // Q_OS_WIN32 || Q_OS_MAC
|
||||
qt->load(QLocale::system(), "qt", "_", QLibraryInfo::location(
|
||||
QLibraryInfo::TranslationsPath));
|
||||
#endif // Q_OS_WINDOWS || Q_OS_MAC
|
||||
#endif // Q_OS_WIN32 || Q_OS_MAC
|
||||
installTranslator(qt);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
|
@ -81,12 +81,12 @@ GraphView::~GraphView()
|
||||
|
||||
void GraphView::createXLabel()
|
||||
{
|
||||
_xAxis->setLabel(QString("%1 [%2]").arg(_xLabel).arg(_xUnits));
|
||||
_xAxis->setLabel(QString("%1 [%2]").arg(_xLabel, _xUnits));
|
||||
}
|
||||
|
||||
void GraphView::createYLabel()
|
||||
{
|
||||
_yAxis->setLabel(QString("%1 [%2]").arg(_yLabel).arg(_yUnits));
|
||||
_yAxis->setLabel(QString("%1 [%2]").arg(_yLabel, _yUnits));
|
||||
}
|
||||
|
||||
void GraphView::setYLabel(const QString &label)
|
||||
|
@ -23,7 +23,7 @@ void InfoItem::updateBoundingRect()
|
||||
|
||||
for (i = _list.constBegin(); i != _list.constEnd(); i++) {
|
||||
width += fm.width(i->key + ": ");
|
||||
width += fm.width(i->value) + ((i == _list.end() - 1) ? 0 : PADDING);
|
||||
width += fm.width(i->value) + ((i == _list.constEnd() - 1) ? 0 : PADDING);
|
||||
}
|
||||
|
||||
_boundingRect = QRectF(0, 0, width, _list.isEmpty() ? 0 : fm.height());
|
||||
@ -49,8 +49,8 @@ void InfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->key + ": ");
|
||||
width += fm.width(i->key + ": ");
|
||||
painter->drawText(width, fm.height() - fm.descent(), i->value);
|
||||
width += fm.width(i->value) + ((i == _list.end() - 1) ? 0 : PADDING);
|
||||
if (i != _list.end() - 1) {
|
||||
width += fm.width(i->value) + ((i == _list.constEnd() - 1) ? 0 : PADDING);
|
||||
if (i != _list.constEnd() - 1) {
|
||||
painter->save();
|
||||
painter->setPen(Qt::gray);
|
||||
painter->drawLine(width - PADDING/2, fm.descent(),
|
||||
|
@ -15,7 +15,6 @@ class Coordinates
|
||||
{
|
||||
public:
|
||||
Coordinates() {_lon = NAN; _lat = NAN;}
|
||||
Coordinates(const Coordinates &c) {_lon = c._lon; _lat = c._lat;}
|
||||
Coordinates(qreal lon, qreal lat) {_lon = lon; _lat = lat;}
|
||||
|
||||
qreal &rlon() {return _lon;}
|
||||
|
@ -14,9 +14,9 @@ QMap<int, Ellipsoid> Ellipsoid::WGS84()
|
||||
|
||||
const Ellipsoid *Ellipsoid::ellipsoid(int id)
|
||||
{
|
||||
QMap<int, Ellipsoid>::const_iterator it = _ellipsoids.find(id);
|
||||
QMap<int, Ellipsoid>::const_iterator it(_ellipsoids.find(id));
|
||||
|
||||
if (it == _ellipsoids.end())
|
||||
if (it == _ellipsoids.constEnd())
|
||||
return 0;
|
||||
else
|
||||
return &(it.value());
|
||||
|
@ -116,8 +116,8 @@ QByteArray Tar::file(const QString &name)
|
||||
struct Header *hdr = (struct Header*)&buffer;
|
||||
quint64 size;
|
||||
|
||||
QMap<QString, quint64>::const_iterator it = _index.find(name);
|
||||
if (it == _index.end())
|
||||
QMap<QString, quint64>::const_iterator it(_index.find(name));
|
||||
if (it == _index.constEnd())
|
||||
return QByteArray();
|
||||
|
||||
Q_ASSERT(_file.isOpen());
|
||||
|
Loading…
x
Reference in New Issue
Block a user