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

Split the config header to config+hash headers

This commit is contained in:
Martin Tůma 2023-01-26 01:11:56 +01:00
parent 51511a9bf9
commit af3e5d41c2
15 changed files with 30 additions and 26 deletions

View File

@ -29,6 +29,7 @@ HEADERS += src/common/config.h \
src/GUI/pluginparameters.h \
src/common/garmin.h \
src/common/coordinates.h \
src/common/hash.h \
src/common/linec.h \
src/common/range.h \
src/common/rectc.h \

View File

@ -28,10 +28,10 @@ App::App(int &argc, char **argv) : QApplication(argc, argv)
#endif
setApplicationVersion(APP_VERSION);
QTranslator *gpxsee = new QTranslator(this);
if (gpxsee->load(QLocale::system(), "gpxsee", "_",
QTranslator *app = new QTranslator(this);
if (app->load(QLocale::system(), "gpxsee", "_",
ProgramPaths::translationsDir()))
installTranslator(gpxsee);
installTranslator(app);
QTranslator *qt = new QTranslator(this);
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)

View File

@ -26,6 +26,7 @@
#include <QStyle>
#include <QTabBar>
#include <QGeoPositionInfoSource>
#include "common/config.h"
#include "common/programpaths.h"
#include "common/downloader.h"
#include "data/data.h"

View File

@ -7,7 +7,6 @@
#include <QList>
#include <QFlags>
#include "common/rectc.h"
#include "common/config.h"
#include "data/waypoint.h"
#include "map/projection.h"
#include "searchpointer.h"

View File

@ -1,7 +1,7 @@
#ifndef SEARCHPOINTER_H
#define SEARCHPOINTER_H
#include "common/config.h"
#include "common/hash.h"
template <class T>
class SearchPointer

View File

@ -1,21 +1,7 @@
#ifndef CONFIG_H
#define CONFIG_H
#include <QtGlobal>
#include <QPoint>
#define APP_NAME "GPXSee"
#define APP_HOMEPAGE "http://www.gpxsee.org"
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#define HASH_T uint
#else // QT6
#define HASH_T size_t
#endif // QT6
inline HASH_T qHash(const QPoint &p)
{
return ::qHash(p.x()) ^ ::qHash(p.y());
}
#endif /* CONFIG_H */

18
src/common/hash.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef HASH_H
#define HASH_H
#include <QtGlobal>
#include <QPoint>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#define HASH_T uint
#else // QT6
#define HASH_T size_t
#endif // QT6
inline HASH_T qHash(const QPoint &p)
{
return ::qHash(p.x()) ^ ::qHash(p.y());
}
#endif // HASH_H

View File

@ -4,7 +4,7 @@
#include <QString>
#include <QCache>
#include <QByteArray>
#include "common/config.h"
#include "common/hash.h"
#include "area.h"
class QString;

View File

@ -7,7 +7,7 @@
#include <QVector>
#include <QPixmap>
#include <QDebug>
#include "common/config.h"
#include "common/hash.h"
#include "common/coordinates.h"
#include "link.h"
#include "style.h"

View File

@ -2,7 +2,7 @@
#define IMG_SHIELD_H
#include <QString>
#include "common/config.h"
#include "common/hash.h"
#define FIRST_SHIELD Shield::USInterstate
#define LAST_SHIELD Shield::Oval

View File

@ -4,6 +4,7 @@
#include <QImageReader>
#include <QBuffer>
#include <QtConcurrent>
#include "common/hash.h"
#include "osm.h"
#include "tile.h"
#include "aqmmap.h"

View File

@ -4,7 +4,6 @@
#include <QDebug>
#include <QFile>
#include <QHash>
#include "common/config.h"
#include "map.h"
class AQMMap : public Map

View File

@ -4,7 +4,7 @@
#include <QFile>
#include <QCache>
#include <QPainterPath>
#include "common/config.h"
#include "common/hash.h"
#include "common/rectc.h"
#include "common/rtree.h"
#include "common/range.h"

View File

@ -8,7 +8,6 @@
#include <QRegularExpression>
#include "common/coordinates.h"
#include "common/rectc.h"
#include "common/config.h"
#include "tar.h"
#include "ozf.h"
#include "image.h"

View File

@ -6,7 +6,7 @@
#include <QSet>
#include <QList>
#include <QHash>
#include "common/config.h"
#include "common/hash.h"
#include "common/rectc.h"
#include "common/kv.h"
#include "common/downloader.h"