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

Code cleanup

This commit is contained in:
Martin Tůma 2015-11-25 23:58:46 +01:00
parent 5bd5b88be5
commit 0b4ee95591
17 changed files with 9 additions and 35 deletions

View File

@ -3,14 +3,12 @@
#include "config.h"
#include "axisitem.h"
#include <QDebug>
#define TICK 6
#define PADDING 6
#define XTICKS 15
#define YTICKS 10
struct Label {
double min;
double max;

View File

@ -1,11 +1,11 @@
#include "colorshop.h"
#define HUE_INIT 0.1f
#define HUE_INCREMENT 0.62f
#define SATURATION 0.99f
#define VALUE 0.99f
static unsigned hsv2rgb(float h, float s, float v)
{
unsigned hi;

View File

@ -3,8 +3,6 @@
#include "config.h"
#include "downloader.h"
#include <QDebug>
#if defined(Q_OS_LINUX)
#define PLATFORM_STR "Linux"
@ -18,7 +16,6 @@
#define USER_AGENT APP_NAME"/"APP_VERSION" ("PLATFORM_STR"; Qt "QT_VERSION_STR")"
Downloader::Downloader()
{
connect(&manager, SIGNAL(finished(QNetworkReply*)),

View File

@ -2,6 +2,7 @@
#include "config.h"
#include "elevationgraph.h"
ElevationGraph::ElevationGraph(QWidget *parent) : Graph(parent)
{
_ascent = 0;

View File

@ -2,8 +2,6 @@
#include <QDir>
#include "filebrowser.h"
#include <QDebug>
FileBrowser::FileBrowser(QObject *parent) : QObject(parent)
{

View File

@ -3,14 +3,11 @@
#include "ll.h"
#include "gpx.h"
#include <QDebug>
#define WINDOW_EF 3
#define WINDOW_SE 11
#define WINDOW_SF 11
static bool lt(const QPointF &p1, const QPointF &p2)
{
return p1.y() < p2.y();

View File

@ -9,12 +9,9 @@
#include "config.h"
#include "graph.h"
#include <QDebug>
#define MARGIN 10.0
void Scene::mousePressEvent(QGraphicsSceneMouseEvent *e)
{
if (e->button() == Qt::LeftButton)

View File

@ -21,8 +21,6 @@
#include "filebrowser.h"
#include "gui.h"
#include <QDebug>
static QString timeSpan(qreal time)
{

View File

@ -4,8 +4,6 @@
#include "ll.h"
#include "map.h"
#include <QDebug>
Map::Map(const QString &name, const QString &url)
{

View File

@ -1,7 +1,6 @@
#include <QFile>
#include "maplist.h"
#include <QDebug>
QList<Map*> MapList::load(const QString &fileName)
{

View File

@ -1,6 +1,7 @@
#include <QPainter>
#include "markeritem.h"
#define SIZE 8
MarkerItem::MarkerItem(QGraphicsItem *parent) : QGraphicsItem(parent)

View File

@ -1,7 +1,5 @@
#include "parser.h"
#include <QDebug>
void Parser::handleExtensionData(QVector<TrackPoint> &data,
QStringRef element, const QString &value)

View File

@ -5,6 +5,8 @@
#include "poi.h"
#define BOUNDING_RECT_SIZE 0.01
bool POI::loadFile(const QString &fileName)
{
QFile file(fileName);
@ -64,7 +66,6 @@ static bool cb(const Entry* data, void* context)
return true;
}
#define RECT 0.01
QVector<Entry> POI::points(const QVector<QPointF> &path) const
{
QVector<Entry> ret;
@ -72,10 +73,10 @@ QVector<Entry> POI::points(const QVector<QPointF> &path) const
qreal min[2], max[2];
for (int i = 0; i < path.count(); i++) {
min[0] = path.at(i).x() - RECT;
min[1] = path.at(i).y() - RECT;
max[0] = path.at(i).x() + RECT;
max[1] = path.at(i).y() + RECT;
min[0] = path.at(i).x() - BOUNDING_RECT_SIZE;
min[1] = path.at(i).y() - BOUNDING_RECT_SIZE;
max[0] = path.at(i).x() + BOUNDING_RECT_SIZE;
max[1] = path.at(i).y() + BOUNDING_RECT_SIZE;
_tree.Search(min, max, cb, &set);
}

View File

@ -2,11 +2,9 @@
#include "config.h"
#include "poiitem.h"
#include <QDebug>
#define POINT_SIZE 8
POIItem::POIItem(const Entry &entry, QGraphicsItem *parent)
: QGraphicsItem(parent)
{

View File

@ -1,7 +1,6 @@
#include <QPainter>
#include "slideritem.h"
#include <QDebug>
#define SIZE 10

View File

@ -1,8 +1,6 @@
#include "config.h"
#include "speedgraph.h"
#include <QDebug>
SpeedGraph::SpeedGraph(QWidget *parent) : Graph(parent)
{

View File

@ -3,19 +3,15 @@
#include <QGraphicsScene>
#include <QPainterPath>
#include <QWheelEvent>
#include <QGraphicsEllipseItem>
#include "poiitem.h"
#include "markeritem.h"
#include "ll.h"
#include "track.h"
#include <QDebug>
#define MARGIN 10.0
#define TRACK_WIDTH 3
Track::Track(QWidget *parent)
: QGraphicsView(parent)
{