mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-27 21:24:47 +01:00
Code cleanup
This commit is contained in:
parent
5bd5b88be5
commit
0b4ee95591
@ -3,14 +3,12 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "axisitem.h"
|
#include "axisitem.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#define TICK 6
|
#define TICK 6
|
||||||
#define PADDING 6
|
#define PADDING 6
|
||||||
#define XTICKS 15
|
#define XTICKS 15
|
||||||
#define YTICKS 10
|
#define YTICKS 10
|
||||||
|
|
||||||
|
|
||||||
struct Label {
|
struct Label {
|
||||||
double min;
|
double min;
|
||||||
double max;
|
double max;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "colorshop.h"
|
#include "colorshop.h"
|
||||||
|
|
||||||
|
|
||||||
#define HUE_INIT 0.1f
|
#define HUE_INIT 0.1f
|
||||||
#define HUE_INCREMENT 0.62f
|
#define HUE_INCREMENT 0.62f
|
||||||
#define SATURATION 0.99f
|
#define SATURATION 0.99f
|
||||||
#define VALUE 0.99f
|
#define VALUE 0.99f
|
||||||
|
|
||||||
|
|
||||||
static unsigned hsv2rgb(float h, float s, float v)
|
static unsigned hsv2rgb(float h, float s, float v)
|
||||||
{
|
{
|
||||||
unsigned hi;
|
unsigned hi;
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "downloader.h"
|
#include "downloader.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
#define PLATFORM_STR "Linux"
|
#define PLATFORM_STR "Linux"
|
||||||
@ -18,7 +16,6 @@
|
|||||||
|
|
||||||
#define USER_AGENT APP_NAME"/"APP_VERSION" ("PLATFORM_STR"; Qt "QT_VERSION_STR")"
|
#define USER_AGENT APP_NAME"/"APP_VERSION" ("PLATFORM_STR"; Qt "QT_VERSION_STR")"
|
||||||
|
|
||||||
|
|
||||||
Downloader::Downloader()
|
Downloader::Downloader()
|
||||||
{
|
{
|
||||||
connect(&manager, SIGNAL(finished(QNetworkReply*)),
|
connect(&manager, SIGNAL(finished(QNetworkReply*)),
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "elevationgraph.h"
|
#include "elevationgraph.h"
|
||||||
|
|
||||||
|
|
||||||
ElevationGraph::ElevationGraph(QWidget *parent) : Graph(parent)
|
ElevationGraph::ElevationGraph(QWidget *parent) : Graph(parent)
|
||||||
{
|
{
|
||||||
_ascent = 0;
|
_ascent = 0;
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include "filebrowser.h"
|
#include "filebrowser.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
FileBrowser::FileBrowser(QObject *parent) : QObject(parent)
|
FileBrowser::FileBrowser(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
|
@ -3,14 +3,11 @@
|
|||||||
#include "ll.h"
|
#include "ll.h"
|
||||||
#include "gpx.h"
|
#include "gpx.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
#define WINDOW_EF 3
|
#define WINDOW_EF 3
|
||||||
#define WINDOW_SE 11
|
#define WINDOW_SE 11
|
||||||
#define WINDOW_SF 11
|
#define WINDOW_SF 11
|
||||||
|
|
||||||
|
|
||||||
static bool lt(const QPointF &p1, const QPointF &p2)
|
static bool lt(const QPointF &p1, const QPointF &p2)
|
||||||
{
|
{
|
||||||
return p1.y() < p2.y();
|
return p1.y() < p2.y();
|
||||||
|
@ -9,12 +9,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
#define MARGIN 10.0
|
#define MARGIN 10.0
|
||||||
|
|
||||||
|
|
||||||
void Scene::mousePressEvent(QGraphicsSceneMouseEvent *e)
|
void Scene::mousePressEvent(QGraphicsSceneMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (e->button() == Qt::LeftButton)
|
if (e->button() == Qt::LeftButton)
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
#include "filebrowser.h"
|
#include "filebrowser.h"
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
static QString timeSpan(qreal time)
|
static QString timeSpan(qreal time)
|
||||||
{
|
{
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
#include "ll.h"
|
#include "ll.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
Map::Map(const QString &name, const QString &url)
|
Map::Map(const QString &name, const QString &url)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include "maplist.h"
|
#include "maplist.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
QList<Map*> MapList::load(const QString &fileName)
|
QList<Map*> MapList::load(const QString &fileName)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "markeritem.h"
|
#include "markeritem.h"
|
||||||
|
|
||||||
|
|
||||||
#define SIZE 8
|
#define SIZE 8
|
||||||
|
|
||||||
MarkerItem::MarkerItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
MarkerItem::MarkerItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
void Parser::handleExtensionData(QVector<TrackPoint> &data,
|
void Parser::handleExtensionData(QVector<TrackPoint> &data,
|
||||||
QStringRef element, const QString &value)
|
QStringRef element, const QString &value)
|
||||||
|
11
src/poi.cpp
11
src/poi.cpp
@ -5,6 +5,8 @@
|
|||||||
#include "poi.h"
|
#include "poi.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define BOUNDING_RECT_SIZE 0.01
|
||||||
|
|
||||||
bool POI::loadFile(const QString &fileName)
|
bool POI::loadFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
@ -64,7 +66,6 @@ static bool cb(const Entry* data, void* context)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RECT 0.01
|
|
||||||
QVector<Entry> POI::points(const QVector<QPointF> &path) const
|
QVector<Entry> POI::points(const QVector<QPointF> &path) const
|
||||||
{
|
{
|
||||||
QVector<Entry> ret;
|
QVector<Entry> ret;
|
||||||
@ -72,10 +73,10 @@ QVector<Entry> POI::points(const QVector<QPointF> &path) const
|
|||||||
qreal min[2], max[2];
|
qreal min[2], max[2];
|
||||||
|
|
||||||
for (int i = 0; i < path.count(); i++) {
|
for (int i = 0; i < path.count(); i++) {
|
||||||
min[0] = path.at(i).x() - RECT;
|
min[0] = path.at(i).x() - BOUNDING_RECT_SIZE;
|
||||||
min[1] = path.at(i).y() - RECT;
|
min[1] = path.at(i).y() - BOUNDING_RECT_SIZE;
|
||||||
max[0] = path.at(i).x() + RECT;
|
max[0] = path.at(i).x() + BOUNDING_RECT_SIZE;
|
||||||
max[1] = path.at(i).y() + RECT;
|
max[1] = path.at(i).y() + BOUNDING_RECT_SIZE;
|
||||||
_tree.Search(min, max, cb, &set);
|
_tree.Search(min, max, cb, &set);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,9 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "poiitem.h"
|
#include "poiitem.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#define POINT_SIZE 8
|
#define POINT_SIZE 8
|
||||||
|
|
||||||
|
|
||||||
POIItem::POIItem(const Entry &entry, QGraphicsItem *parent)
|
POIItem::POIItem(const Entry &entry, QGraphicsItem *parent)
|
||||||
: QGraphicsItem(parent)
|
: QGraphicsItem(parent)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include "slideritem.h"
|
#include "slideritem.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#define SIZE 10
|
#define SIZE 10
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "speedgraph.h"
|
#include "speedgraph.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
SpeedGraph::SpeedGraph(QWidget *parent) : Graph(parent)
|
SpeedGraph::SpeedGraph(QWidget *parent) : Graph(parent)
|
||||||
{
|
{
|
||||||
|
@ -3,19 +3,15 @@
|
|||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
#include <QGraphicsEllipseItem>
|
|
||||||
#include "poiitem.h"
|
#include "poiitem.h"
|
||||||
#include "markeritem.h"
|
#include "markeritem.h"
|
||||||
#include "ll.h"
|
#include "ll.h"
|
||||||
#include "track.h"
|
#include "track.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
#define MARGIN 10.0
|
#define MARGIN 10.0
|
||||||
#define TRACK_WIDTH 3
|
#define TRACK_WIDTH 3
|
||||||
|
|
||||||
|
|
||||||
Track::Track(QWidget *parent)
|
Track::Track(QWidget *parent)
|
||||||
: QGraphicsView(parent)
|
: QGraphicsView(parent)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user