mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-06-28 12:09:15 +02:00
Code cleanup
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#include <cmath>
|
||||
#include <QPainter>
|
||||
#include "common/util.h"
|
||||
#include "config.h"
|
||||
#include "nicenum.h"
|
||||
#include "axisitem.h"
|
||||
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
#ifndef MISC_H
|
||||
#define MISC_H
|
||||
|
||||
double niceNum(double x, int round);
|
||||
|
||||
#endif // MISC_H
|
@ -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) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <cmath>
|
||||
#include <QPainter>
|
||||
#include "common/util.h"
|
||||
#include "config.h"
|
||||
#include "nicenum.h"
|
||||
#include "scaleitem.h"
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
#ifndef MISC_H
|
||||
#define MISC_H
|
||||
|
||||
int str2int(const char *str, int len);
|
||||
|
||||
#endif // MISC_H
|
@ -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
7
src/common/util.h
Normal 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
|
@ -1,5 +1,5 @@
|
||||
#include <cstring>
|
||||
#include "common/str2int.h"
|
||||
#include "common/util.h"
|
||||
#include "igcparser.h"
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include <cstring>
|
||||
#include "common/str2int.h"
|
||||
#include "common/util.h"
|
||||
#include "nmeaparser.h"
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "common/coordinates.h"
|
||||
#include "common/str2int.h"
|
||||
#include "common/util.h"
|
||||
#include "angularunits.h"
|
||||
|
||||
static double sDMS2deg(double val)
|
||||
|
Reference in New Issue
Block a user