1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2018-10-11 18:19:35 +02:00
parent b73072795a
commit 8f4ce8d38c
12 changed files with 32 additions and 41 deletions

View File

@ -19,7 +19,7 @@ HEADERS += src/config.h \
src/common/range.h \
src/common/rectc.h \
src/common/wgs84.h \
src/common/str2int.h \
src/common/util.h \
src/common/rtree.h \
src/common/kv.h \
src/GUI/app.h \
@ -71,7 +71,6 @@ HEADERS += src/config.h \
src/GUI/gearratiographitem.h \
src/GUI/oddspinbox.h \
src/GUI/settings.h \
src/GUI/nicenum.h \
src/GUI/cpuarch.h \
src/GUI/searchpointer.h \
src/GUI/mapview.h \
@ -150,7 +149,7 @@ SOURCES += src/main.cpp \
src/common/coordinates.cpp \
src/common/rectc.cpp \
src/common/range.cpp \
src/common/str2int.cpp \
src/common/util.cpp \
src/GUI/app.cpp \
src/GUI/gui.cpp \
src/GUI/axisitem.cpp \
@ -192,7 +191,6 @@ SOURCES += src/main.cpp \
src/GUI/cadencegraphitem.cpp \
src/GUI/powergraphitem.cpp \
src/GUI/gearratiographitem.cpp \
src/GUI/nicenum.cpp \
src/GUI/mapview.cpp \
src/map/maplist.cpp \
src/map/onlinemap.cpp \

View File

@ -1,7 +1,7 @@
#include <cmath>
#include <QPainter>
#include "common/util.h"
#include "config.h"
#include "nicenum.h"
#include "axisitem.h"

View File

@ -1,6 +0,0 @@
#ifndef MISC_H
#define MISC_H
double niceNum(double x, int round);
#endif // MISC_H

View File

@ -1,11 +1,8 @@
#include <cmath>
#include <QApplication>
#include <QCursor>
#include <QPainter>
#include "common/greatcircle.h"
#include "map/map.h"
#include "tooltip.h"
#include "nicenum.h"
#include "pathitem.h"
@ -50,6 +47,7 @@ void PathItem::updateShape()
void PathItem::addSegment(const Coordinates &c1, const Coordinates &c2)
{
if (fabs(c1.lon() - c2.lon()) > 180.0) {
// Split segment on date line crossing
QPointF p;
if (c2.lon() < 0) {

View File

@ -1,7 +1,7 @@
#include <cmath>
#include <QPainter>
#include "common/util.h"
#include "config.h"
#include "nicenum.h"
#include "scaleitem.h"

View File

@ -1,16 +0,0 @@
#include <cctype>
#include "str2int.h"
int str2int(const char *str, int len)
{
int res = 0;
for (const char *sp = str; sp < str + len; sp++) {
if (::isdigit(*sp))
res = res * 10 + *sp - '0';
else
return -1;
}
return res;
}

View File

@ -1,6 +0,0 @@
#ifndef MISC_H
#define MISC_H
int str2int(const char *str, int len);
#endif // MISC_H

View File

@ -1,5 +1,21 @@
#include <cctype>
#include <cmath>
#include "nicenum.h"
#include "util.h"
int str2int(const char *str, int len)
{
int res = 0;
for (const char *sp = str; sp < str + len; sp++) {
if (::isdigit(*sp))
res = res * 10 + *sp - '0';
else
return -1;
}
return res;
}
double niceNum(double x, int round)
{

7
src/common/util.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef UTIL_H
#define UTIL_H
int str2int(const char *str, int len);
double niceNum(double x, int round);
#endif // UTIL_H

View File

@ -1,5 +1,5 @@
#include <cstring>
#include "common/str2int.h"
#include "common/util.h"
#include "igcparser.h"

View File

@ -1,5 +1,5 @@
#include <cstring>
#include "common/str2int.h"
#include "common/util.h"
#include "nmeaparser.h"

View File

@ -1,5 +1,5 @@
#include "common/coordinates.h"
#include "common/str2int.h"
#include "common/util.h"
#include "angularunits.h"
static double sDMS2deg(double val)