1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +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/GUI/pluginparameters.h \
src/common/garmin.h \ src/common/garmin.h \
src/common/coordinates.h \ src/common/coordinates.h \
src/common/hash.h \
src/common/linec.h \ src/common/linec.h \
src/common/range.h \ src/common/range.h \
src/common/rectc.h \ src/common/rectc.h \

View File

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

View File

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

View File

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

View File

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

View File

@ -1,21 +1,7 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
#include <QtGlobal>
#include <QPoint>
#define APP_NAME "GPXSee" #define APP_NAME "GPXSee"
#define APP_HOMEPAGE "http://www.gpxsee.org" #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 */ #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 <QString>
#include <QCache> #include <QCache>
#include <QByteArray> #include <QByteArray>
#include "common/config.h" #include "common/hash.h"
#include "area.h" #include "area.h"
class QString; class QString;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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