1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-16 11:54:23 +02:00

Compare commits

..

220 Commits
5.17 ... 7.1

Author SHA1 Message Date
35309ef452 Version++ 2019-01-02 00:49:19 +01:00
e6c9fb1971 Fixed desktop categories to work with OpenSUSE/SLES 2019-01-02 00:06:10 +01:00
fc858d6b68 Added missing activity description acquire 2018-12-21 21:10:52 +01:00
4fd4135025 Improved categories 2018-12-13 01:15:20 +01:00
c16f33abce Merge branch 'origin/master' into Weblate. 2018-12-08 23:36:47 +01:00
9b3da6a73c Merge branch 'master' of https://github.com/tumic0/GPXSee 2018-12-08 23:36:26 +01:00
ff37b91bc5 Fixed build on QT5 versions < 5.4 2018-12-08 23:35:42 +01:00
896ebe9eb4 Merge branch 'origin/master' into Weblate. 2018-12-08 23:28:37 +01:00
be87677ddf Update gpxsee_sv.ts (#174)
translated new string
2018-12-08 23:28:33 +01:00
b40586c80f Merge branch 'origin/master' into Weblate. 2018-12-08 02:28:02 +01:00
9f0fcdc13e Fixed broken map sources parsing 2018-12-08 02:27:27 +01:00
6ca51f0ec6 Translated using Weblate (German)
Currently translated at 99.7% (322 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-12-05 08:53:32 +01:00
3e03ecc9fe Translated using Weblate (Turkish)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/tr/
2018-11-29 12:57:15 +01:00
d94b189fed Translated using Weblate (Finnish)
Currently translated at 98.8% (319 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-11-27 17:52:20 +01:00
eec96cca62 Translated using Weblate (Russian)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-11-27 17:52:20 +01:00
7bc2c68a5c Translated using Weblate (Swedish)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/
2018-11-27 17:52:19 +01:00
5b21d550af English translation file shall have plurals only 2018-11-26 23:53:56 +01:00
6f4259298b Localization update 2018-11-26 22:31:27 +01:00
2c1a9f88c4 Enabled Turkish translation 2018-11-22 22:59:31 +01:00
48438f9b4d Translated using Weblate (Turkish)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/tr/
2018-11-22 22:41:49 +01:00
9b7651bad4 Translated using Weblate (Turkish)
Currently translated at 56.0% (181 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/tr/
2018-11-22 22:41:49 +01:00
b6ef1d36d6 Translated using Weblate (Turkish)
Currently translated at 2.5% (8 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/tr/
2018-11-22 22:41:49 +01:00
d3cbdb8b92 Translated using Weblate (Finnish)
Currently translated at 98.7% (320 of 324 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-11-22 22:41:49 +01:00
a98e9a9784 Fixed QT4 build 2018-11-17 21:01:08 +01:00
3c6ce2dde2 Propper handling of vector tiles scaling in all map display modes 2018-11-17 10:10:35 +01:00
4c88414677 Scale the tile images in HiDPImode when they are scalable (vector tiles) 2018-11-15 00:38:03 +01:00
ac5476868d Added Turkish translations stub 2018-11-12 20:08:16 +01:00
bf6d7616ba The default constructor is required with some C++ compilers 2018-11-11 18:54:21 +01:00
9842214bb6 Parallelized tile loader 2018-11-10 13:18:54 +01:00
b6e9400392 Code cleanup 2018-11-10 10:44:37 +01:00
c1a217847f QPixmap is not thread safe, do the parallel computations on QImage 2018-11-10 10:40:00 +01:00
409ce889cd Added support for online PBF maps
(https://maps.tilehosting.com)
2018-11-10 00:19:51 +01:00
09242841e3 Fixed Qt 4 cache paths 2018-11-07 23:07:09 +01:00
a299207e5d Use standards compliant paths for the tile chache 2018-11-07 22:53:27 +01:00
efc773d04b Run the parallel computation only for tiles to be (newly) rendered 2018-11-06 01:30:29 +01:00
16c95334a0 Added missing QtConcurrent libs to the installers 2018-11-04 01:14:31 +01:00
49ccb508a0 Fixed broken tiles dir program path 2018-11-04 01:04:47 +01:00
9c6c574443 Added support for vector MBtiles 2018-11-03 00:43:52 +01:00
f762013e1e Changed application data paths to more platform-standard locations 2018-11-02 20:01:19 +01:00
f6b1344ee2 Improved error handling 2018-10-26 18:47:34 +02:00
9f3129f899 Fixed some corner case min/max graph values issue 2018-10-26 09:15:23 +02:00
f05ff372e7 Update gpxsee_fr.ts (#166)
* Update gpxsee_fr.ts

* Update gpxsee_fr.ts

* Update gpxsee_fr.ts

* Update gpxsee_fr.ts

* Update gpxsee_fr.ts
2018-10-20 15:22:10 +02:00
c0adabe3f1 Code cleanup 2018-10-15 01:15:00 +02:00
4a612f12bb Properly handle WMTS TileMatrixLimits and default style 2018-10-15 00:20:20 +02:00
8f4ce8d38c Code cleanup 2018-10-11 18:19:35 +02:00
b73072795a Update PL translation (#165)
Update gpxsee_pl.ts
2018-10-10 23:24:08 +02:00
57d3d9c965 Cosmetics 2018-10-09 22:59:20 +02:00
d97a8c03a7 Danish localization update 2018-10-09 22:48:21 +02:00
58b44d33a7 Fixed broken bounds handling 2018-10-09 22:46:28 +02:00
5c6f405795 appveyor script fix 2018-10-09 01:16:34 +02:00
156467a261 Added missing NSIS include file to appveyor script 2018-10-09 01:04:15 +02:00
f4d5f8d057 NSIS scripts cleanup 2018-10-09 00:46:13 +02:00
b3655f6a1f Squashed commit of the following:
commit f819840aff
Merge: 46bf281 49470f2
Author: Hosted Weblate <hosted@weblate.org>
Date:   Tue Oct 9 00:01:42 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 49470f22b2
Merge: 078b272 ed03e31
Author: Hosted Weblate <hosted@weblate.org>
Date:   Mon Oct 8 23:56:36 2018 +0200

    Merge branch 'origin/master' into Weblate

commit ed03e31949
Merge: ce41409 605b09c
Author: Hosted Weblate <hosted@weblate.org>
Date:   Mon Oct 8 23:53:56 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 605b09c195
Author: Allan Nordhøy <epost@anotheragency.no>
Date:   Mon Oct 8 20:26:04 2018 +0000

    Translated using Weblate (Norwegian Bokmål)

    Currently translated at 92.2% (299 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb/

commit 0898953674
Merge: fd0401a 869fdf5
Author: Hosted Weblate <hosted@weblate.org>
Date:   Mon Oct 8 22:24:40 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 869fdf5982
Merge: 7fe5189 aa32415
Author: Hosted Weblate <hosted@weblate.org>
Date:   Mon Oct 8 22:09:51 2018 +0200

    Merge branch 'origin/master' into Weblate

commit aa32415adb
Author: jan madsen <jsm@janz.dk>
Date:   Mon Oct 8 12:01:51 2018 +0000

    Translated using Weblate (Danish)

    Currently translated at 85.4% (275 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/

commit c1a64d2c0b
Author: jan madsen <jsm@janz.dk>
Date:   Mon Oct 8 10:53:55 2018 +0000

    Translated using Weblate (Danish)

    Currently translated at 34.1% (110 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/

commit 31bbdba548
Author: jan madsen <jsm@janz.dk>
Date:   Mon Oct 8 10:36:54 2018 +0000

    Translated using Weblate (Danish)

    Currently translated at 19.8% (64 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2018-10-09 00:18:17 +02:00
f819840aff Merge branch 'origin/master' into Weblate 2018-10-09 00:01:42 +02:00
46bf281644 Enabled Danish localization 2018-10-09 00:01:18 +02:00
49470f22b2 Merge branch 'origin/master' into Weblate 2018-10-08 23:56:36 +02:00
078b272828 Squashed commit of the following:
commit ed03e31949
Merge: ce41409 605b09c
Author: Hosted Weblate <hosted@weblate.org>
Date:   Mon Oct 8 23:53:56 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 605b09c195
Author: Allan Nordhøy <epost@anotheragency.no>
Date:   Mon Oct 8 20:26:04 2018 +0000

    Translated using Weblate (Norwegian Bokmål)

    Currently translated at 92.2% (299 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb/

commit 0898953674
Merge: fd0401a 869fdf5
Author: Hosted Weblate <hosted@weblate.org>
Date:   Mon Oct 8 22:24:40 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 869fdf5982
Merge: 7fe5189 aa32415
Author: Hosted Weblate <hosted@weblate.org>
Date:   Mon Oct 8 22:09:51 2018 +0200

    Merge branch 'origin/master' into Weblate

commit aa32415adb
Author: jan madsen <jsm@janz.dk>
Date:   Mon Oct 8 12:01:51 2018 +0000

    Translated using Weblate (Danish)

    Currently translated at 85.4% (275 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/

commit c1a64d2c0b
Author: jan madsen <jsm@janz.dk>
Date:   Mon Oct 8 10:53:55 2018 +0000

    Translated using Weblate (Danish)

    Currently translated at 34.1% (110 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/

commit 31bbdba548
Author: jan madsen <jsm@janz.dk>
Date:   Mon Oct 8 10:36:54 2018 +0000

    Translated using Weblate (Danish)

    Currently translated at 19.8% (64 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2018-10-08 23:56:23 +02:00
ed03e31949 Merge branch 'origin/master' into Weblate 2018-10-08 23:53:56 +02:00
605b09c195 Translated using Weblate (Norwegian Bokmål)
Currently translated at 92.2% (299 of 324 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb/
2018-10-08 23:53:55 +02:00
ce41409713 Fixed english translation file (plurals only) 2018-10-08 23:53:24 +02:00
0898953674 Merge branch 'origin/master' into Weblate 2018-10-08 22:24:40 +02:00
fd0401a4a6 Yet another incomplete localization source fix 2018-10-08 22:24:05 +02:00
869fdf5982 Merge branch 'origin/master' into Weblate 2018-10-08 22:09:51 +02:00
7fe518966c Made the "About GPXSee" string better localizable. 2018-10-08 22:08:59 +02:00
e568806366 Never change a winning team! 2018-10-08 22:07:36 +02:00
aa32415adb Translated using Weblate (Danish)
Currently translated at 85.4% (275 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2018-10-08 21:29:35 +02:00
c1a64d2c0b Translated using Weblate (Danish)
Currently translated at 34.1% (110 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2018-10-08 13:40:14 +02:00
31bbdba548 Translated using Weblate (Danish)
Currently translated at 19.8% (64 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2018-10-08 12:53:39 +02:00
0e4a5abc2b Version++ 2018-10-07 22:48:02 +02:00
7a2f6b96a9 The correct language code for Norwegian-Bokmal is "nb", not "no" 2018-10-07 22:27:50 +02:00
24c03fc15b Code cleanup 2018-10-07 17:30:48 +02:00
f9af06267a Fixed HTTP2 settings handling 2018-10-07 14:22:13 +02:00
2f9751672e Code cleanup 2018-10-07 13:07:04 +02:00
140e975524 Better weblate link 2018-10-06 23:20:55 +02:00
e6a39b5146 Fixed QT4 build 2018-10-06 23:14:46 +02:00
937251fbdc Some more cosmetics 2018-10-06 21:31:12 +02:00
6e92557806 Code cleanup 2018-10-06 21:15:06 +02:00
a3625ac89d Squashed commit of the following:
commit 96de0be220ba1f05eb39693da1d0134f16fc4df7
Merge: a7e02bd c8411eb
Author: Hosted Weblate <hosted@weblate.org>
Date:   Fri Oct 5 07:11:07 2018 +0200

    Merge branch 'origin/master' into Weblate

commit c8411eb1bfc372cab3d5c213a3ee16312a38fb69
Merge: ed4e201 c581271
Author: Hosted Weblate <hosted@weblate.org>
Date:   Thu Oct 4 23:02:49 2018 +0200

    Merge branch 'origin/master' into Weblate

commit c58127179085143b6e74970f002f55156f11a92c
Merge: 06901d8 ffec7d8
Author: Hosted Weblate <hosted@weblate.org>
Date:   Thu Oct 4 01:37:35 2018 +0200

    Merge branch 'origin/master' into Weblate

commit ffec7d8f25c4d0af9dbfc57914d5d1ac55e2d8f0
Merge: 698f14c aa5fde7
Author: Hosted Weblate <hosted@weblate.org>
Date:   Tue Oct 2 22:22:22 2018 +0200

    Merge branch 'origin/master' into Weblate

commit aa5fde7bedf6930cf8790f55cfc9667438084edc
Merge: f880641 4c539a1
Author: Hosted Weblate <hosted@weblate.org>
Date:   Tue Oct 2 22:19:54 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 4c539a1e5d98e9ed83060773be187636eb6e91ce
Merge: 52e8eb1 2b8deb9
Author: Hosted Weblate <hosted@weblate.org>
Date:   Tue Oct 2 22:05:00 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 2b8deb974ccbde60f9f6eae63838450a122cefca
Author: Allan Nordhøy <epost@anotheragency.no>
Date:   Tue Oct 2 20:02:35 2018 +0000

    Translated using Weblate (Norwegian Bokmål)

    Currently translated at 92.5% (298 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/

commit f7d03c73ace7a8bde5dc7255abfe88f7aac5c84e
Merge: 0483d39 383ab1f
Author: Hosted Weblate <hosted@weblate.org>
Date:   Tue Oct 2 22:02:34 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 383ab1fa834e0d0e124e0d5ccd78f3c47ca42026
Author: Allan Nordhøy <epost@anotheragency.no>
Date:   Tue Oct 2 20:00:54 2018 +0000

    Translated using Weblate (Norwegian Bokmål)

    Currently translated at 90.9% (293 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/

commit 0b833eae60340905bf1ef541bc90ad38233b5d77
Merge: 5aa2138 e2df88b
Author: Hosted Weblate <hosted@weblate.org>
Date:   Tue Oct 2 21:57:00 2018 +0200

    Merge branch 'origin/master' into Weblate

commit e2df88b716a0679b336a56a8453640f66655977b
Author: Allan Nordhøy <epost@anotheragency.no>
Date:   Tue Oct 2 09:49:57 2018 +0000

    Translated using Weblate (Norwegian Bokmål)

    Currently translated at 89.7% (289 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/

commit 6ba37af419a6398819d0570950981a75ba3252bd
Author: Åke Engelbrektson <eson@svenskasprakfiler.se>
Date:   Sun Sep 30 10:23:13 2018 +0000

    Translated using Weblate (Swedish)

    Currently translated at 100.0% (324 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/

commit e5fa1d82f67654db0e37364fb2b25c37529ec79f
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Sun Sep 30 13:34:23 2018 +0000

    Translated using Weblate (Finnish)

    Currently translated at 98.1% (318 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/

commit a6bdd375192c945507b12aaac130aca9078bf545
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Sun Sep 30 13:33:39 2018 +0000

    Translated using Weblate (Russian)

    Currently translated at 100.0% (324 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/

commit 1db745c700dc4e7803d0ba295ea94cf199fdca43
Merge: 254deae 8443cd9
Author: Hosted Weblate <hosted@weblate.org>
Date:   Sun Sep 30 12:16:52 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 8443cd91f9cc2dbb511d74c9b47f1c530f27d4e1
Merge: 076a091 cdba9e7
Author: Hosted Weblate <hosted@weblate.org>
Date:   Sun Sep 30 11:35:56 2018 +0200

    Merge branch 'origin/master' into Weblate

commit cdba9e779444269e15ac9ff13c9ae59ed5b0c7a2
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Tue Sep 25 20:43:37 2018 +0000

    Translated using Weblate (Russian)

    Currently translated at 100.0% (323 of 323 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-10-06 19:39:30 +02:00
a7e02bdc8b Some more cosmetic optimizations 2018-10-05 07:10:49 +02:00
ed4e201b08 Cosmetics 2018-10-04 23:02:43 +02:00
06901d8d7a Fixed -Wold-style-cast warnings 2018-10-04 01:37:07 +02:00
698f14c835 Fixed XML syntax 2018-10-02 22:22:00 +02:00
f8806417d4 Metadata update 2018-10-02 22:19:46 +02:00
52e8eb1f6e Version++ 2018-10-02 22:04:51 +02:00
0483d393ac Enabled Norwegian localization 2018-10-02 22:02:07 +02:00
5aa21380cb Squashed commit of the following:
commit e2df88b716a0679b336a56a8453640f66655977b
Author: Allan Nordhøy <epost@anotheragency.no>
Date:   Tue Oct 2 09:49:57 2018 +0000

    Translated using Weblate (Norwegian Bokmål)

    Currently translated at 89.7% (289 of 322 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/

commit 6ba37af419a6398819d0570950981a75ba3252bd
Author: Åke Engelbrektson <eson@svenskasprakfiler.se>
Date:   Sun Sep 30 10:23:13 2018 +0000

    Translated using Weblate (Swedish)

    Currently translated at 100.0% (324 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/

commit e5fa1d82f67654db0e37364fb2b25c37529ec79f
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Sun Sep 30 13:34:23 2018 +0000

    Translated using Weblate (Finnish)

    Currently translated at 98.1% (318 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/

commit a6bdd375192c945507b12aaac130aca9078bf545
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Sun Sep 30 13:33:39 2018 +0000

    Translated using Weblate (Russian)

    Currently translated at 100.0% (324 of 324 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/

commit 1db745c700dc4e7803d0ba295ea94cf199fdca43
Merge: 254deae 8443cd9
Author: Hosted Weblate <hosted@weblate.org>
Date:   Sun Sep 30 12:16:52 2018 +0200

    Merge branch 'origin/master' into Weblate

commit 8443cd91f9cc2dbb511d74c9b47f1c530f27d4e1
Merge: 076a091 cdba9e7
Author: Hosted Weblate <hosted@weblate.org>
Date:   Sun Sep 30 11:35:56 2018 +0200

    Merge branch 'origin/master' into Weblate

commit cdba9e779444269e15ac9ff13c9ae59ed5b0c7a2
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Tue Sep 25 20:43:37 2018 +0000

    Translated using Weblate (Russian)

    Currently translated at 100.0% (323 of 323 strings)

    Translation: GPXSee/Translations
    Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-10-02 21:56:43 +02:00
254deae04a Code cleanup 2018-09-30 12:16:41 +02:00
076a091a5b Translations unification 2018-09-30 11:35:33 +02:00
bb7787b001 Refactoring 2018-09-25 21:07:44 +02:00
bc6d48d1fe Some more code cleanup 2018-09-25 01:49:08 +02:00
9bae94f30d qWarning() mesage formating cleanup 2018-09-24 23:07:11 +02:00
351fc0309a Code cleanup 2018-09-24 22:49:10 +02:00
d8116c7f5d Properly fixed the zoom 0 display issue
(without breaking non-default map bounds)
2018-09-23 21:07:16 +02:00
083dd39bef Fixed broken merge 2018-09-23 12:20:04 +02:00
bd64ca4f57 Merge branch 'origin/master' into Weblate 2018-09-23 12:00:15 +02:00
b382a5e674 Translated using Weblate (Russian)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-23 11:57:20 +02:00
20687a1df7 Translated using Weblate (Finnish)
Currently translated at 98.1% (317 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-09-23 11:57:20 +02:00
bb82750e9b Translated using Weblate (German)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-09-23 11:57:20 +02:00
51e6058960 Translated using Weblate (German)
Currently translated at 99.6% (322 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-09-23 11:57:20 +02:00
db3f111815 Translated using Weblate (Swedish)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/
2018-09-23 11:57:20 +02:00
219311577f Translated using Weblate (German)
Currently translated at 99.3% (321 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-09-23 11:57:20 +02:00
26d4770f47 Translated using Weblate (Czech)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/cs/
2018-09-23 11:57:20 +02:00
db0d9ceffb Translated using Weblate (Russian)
Currently translated at 99.3% (320 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-23 11:57:20 +02:00
fc9b01480c Translated using Weblate (Russian)
Currently translated at 99.0% (319 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-23 11:56:41 +02:00
cd8f415615 Translated using Weblate (Russian)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-23 11:35:22 +02:00
824393879b Translated using Weblate (Finnish)
Currently translated at 98.1% (317 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-09-23 11:35:21 +02:00
f79f555d6f Translated using Weblate (German)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-09-23 11:35:02 +02:00
13e9a50d59 Translated using Weblate (German)
Currently translated at 99.6% (322 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-09-23 11:23:05 +02:00
f1667e70b5 Translated using Weblate (Swedish)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/
2018-09-23 09:23:04 +02:00
1ce347230b Translated using Weblate (German)
Currently translated at 99.3% (321 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-09-23 09:23:04 +02:00
d4f3e293df Translated using Weblate (Czech)
Currently translated at 100.0% (323 of 323 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/cs/
2018-09-23 09:23:03 +02:00
7492b74aed Merge branch 'origin/master' into Weblate 2018-09-22 23:31:47 +02:00
71dbb176bb Translation sources update 2018-09-22 23:30:54 +02:00
301107add1 Merge branch 'origin/master' into Weblate 2018-09-22 23:13:58 +02:00
60ae4c0268 Translations update 2018-09-22 23:12:22 +02:00
bd76e508ae Merge branch 'origin/master' into Weblate 2018-09-22 14:17:48 +02:00
e9f7642cde Code cleanup 2018-09-22 14:17:24 +02:00
5c73cb55cb Merge branch 'origin/master' into Weblate 2018-09-22 13:33:21 +02:00
c39298000d Added TMS maps support 2018-09-22 13:32:54 +02:00
e17d7d4a8f Merge branch 'origin/master' into Weblate 2018-09-22 12:43:45 +02:00
65b74b146d Added support for local (file:) URLs 2018-09-22 12:42:49 +02:00
b937b9f2cb Merge branch 'origin/master' into Weblate 2018-09-22 10:26:29 +02:00
d7fe0fa9bf Fixed broken automatic loading of MBTiles maps 2018-09-22 10:25:43 +02:00
9657104f50 Merge branch 'origin/master' into Weblate 2018-09-21 23:25:07 +02:00
5a692c71a8 Added support for tiles with a different size than 256px 2018-09-21 23:18:05 +02:00
e8ede272ae Merge branch 'origin/master' into Weblate 2018-09-21 01:59:41 +02:00
39a8a144dd Addedmissing SQL libs to the Windows installer 2018-09-21 01:58:58 +02:00
02700a485d Merge branch 'origin/master' into Weblate 2018-09-21 00:20:17 +02:00
99ea19e35a Use the map name from the metadata table if available 2018-09-21 00:19:30 +02:00
a6bb0f1520 Merge branch 'origin/master' into Weblate 2018-09-20 08:51:13 +02:00
0a74684713 Improved map validity checks 2018-09-20 08:50:52 +02:00
332a4d9393 Merge branch 'origin/master' into Weblate 2018-09-20 08:00:21 +02:00
db98f381b5 Added initial MBTiles support 2018-09-20 07:59:47 +02:00
31a600638f Translated using Weblate (Norwegian Bokmål)
Currently translated at 13.9% (45 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/nb_NO/
2018-09-20 05:29:31 +02:00
2ff18bc373 Merge branch 'origin/master' into Weblate 2018-09-19 01:06:37 +02:00
c2e301f4e8 Added Norwegian translation file 2018-09-19 01:05:49 +02:00
a25303fe98 Merge branch 'origin/master' into Weblate 2018-09-17 20:12:05 +02:00
2bee8656a4 Properly split the paths exactly at the date line 2018-09-17 20:11:23 +02:00
4a31f6f76d Merge branch 'origin/master' into Weblate 2018-09-16 19:40:06 +02:00
eaef588443 Moved maps info to a separate section 2018-09-16 19:40:02 +02:00
87a808265e Merge branch 'origin/master' into Weblate 2018-09-16 19:34:21 +02:00
a39cef2abd Fixed typo 2018-09-16 19:34:18 +02:00
960827e92b Merge branch 'origin/master' into Weblate 2018-09-16 19:32:42 +02:00
7de1b84f77 Extended build info 2018-09-16 19:32:40 +02:00
4b1fa13429 Merge branch 'origin/master' into Weblate 2018-09-16 17:51:14 +02:00
f10857eddc Added english translation file
(Language selection is broken without it on Mac when the user's languages
list contains more than one language)
2018-09-16 17:49:47 +02:00
781fc22113 Merge branch 'origin/master' into Weblate 2018-09-16 17:41:00 +02:00
9ced0fd3a7 Do not process the Danish translations until they are done 2018-09-16 17:40:22 +02:00
3e71d1b785 Merge branch 'origin/master' into Weblate 2018-09-16 17:13:31 +02:00
491bf5614b Lupdate formating 2018-09-16 17:12:49 +02:00
fc873719e1 Merge branch 'origin/master' into Weblate 2018-09-16 17:12:05 +02:00
99c3edddfd Added Danish translation stub 2018-09-16 17:11:35 +02:00
fde8ad620b Merge branch 'origin/master' into Weblate 2018-09-16 13:19:35 +02:00
7855c69729 Fixed WMS/WMTS URLs composing 2018-09-16 12:05:11 +02:00
8749be9103 Merge branch 'origin/master' into Weblate 2018-09-15 13:40:38 +02:00
7432459c93 Improved dateline crossing handling 2018-09-15 13:40:21 +02:00
6f9f49a435 Merge branch 'origin/master' into Weblate 2018-09-15 10:43:17 +02:00
eda5046518 Show the path marker on the great circle segment line 2018-09-15 10:41:00 +02:00
b867ce9a7f Code cleanup 2018-09-15 08:40:37 +02:00
cfdb12c4ae Merge branch 'origin/master' into Weblate 2018-09-15 08:40:35 +02:00
9436f98023 Merge branch 'origin/master' into Weblate 2018-09-15 00:23:12 +02:00
c89137204e Use the GreatCircle for all segments longer than 1 arc minute 2018-09-15 00:22:27 +02:00
905f80b1ce Merge branch 'origin/master' into Weblate 2018-09-14 00:09:53 +02:00
e707cc30ad Weblate import 2018-09-14 00:09:50 +02:00
4ef1fa77f8 Merge branch 'origin/master' into Weblate 2018-09-13 01:45:21 +02:00
df104b16c6 Yet another optimization 2018-09-13 01:45:17 +02:00
8f9049a8d4 Code cleanup/optimization 2018-09-13 01:15:43 +02:00
d483cd35cd Merge branch 'origin/master' into Weblate 2018-09-13 01:15:41 +02:00
c2b09df118 Merge branch 'origin/master' into Weblate 2018-09-13 00:48:49 +02:00
9957e1834e Now drawing path segments > 1 arc minute as great circle curves instead of rhumb lines 2018-09-13 00:43:28 +02:00
7e537d819a Merge branch 'origin/master' into Weblate 2018-09-12 20:13:37 +02:00
8d1be76043 Fixed Garmin CSV reader coordinates order (correct is lon, lat) 2018-09-12 20:13:09 +02:00
b68567f000 Merge branch 'origin/master' into Weblate 2018-09-12 19:58:17 +02:00
09a5f57109 Fixed POI selection when the POI radius is not >> trackpoint distance
Fixes #153
2018-09-12 19:55:32 +02:00
ca8ff6c7ee Translated using Weblate (Finnish)
Currently translated at 98.1% (316 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-09-11 11:42:40 +02:00
e9c15ef956 Translated using Weblate (Finnish)
Currently translated at 97.8% (315 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-09-11 09:15:20 +02:00
e39f0881ab Translated using Weblate (Russian)
Currently translated at 100.0% (322 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-11 08:55:41 +02:00
6f05d38d31 Translated using Weblate (Russian)
Currently translated at 99.3% (320 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-11 08:26:55 +02:00
9cb91a35ef Translated using Weblate (Russian)
Currently translated at 99.0% (319 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-11 08:21:48 +02:00
bb0073d7e7 Translated using Weblate (Swedish)
Currently translated at 100.0% (322 of 322 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/
2018-09-11 08:21:47 +02:00
3291ea86ef Localization update 2018-09-11 01:01:09 +02:00
97d646bb19 Merge branch 'origin/master' into Weblate 2018-09-11 01:01:05 +02:00
672df4255e Version++ 2018-09-11 00:36:11 +02:00
3fcf04daf7 Merge branch 'origin/master' into Weblate 2018-09-11 00:36:06 +02:00
3daab92b84 Merge branch 'origin/master' into Weblate 2018-09-11 00:34:31 +02:00
89f384feed Made the HiDPI display mode (of non-HiDPI maps) configurable 2018-09-11 00:33:20 +02:00
fc555fd7d0 Merge branch 'origin/master' into Weblate 2018-09-10 21:23:03 +02:00
d58322b412 Map API cleanup 2018-09-10 21:22:57 +02:00
70222f4ae2 Fixed overlapping scale numbers 2018-09-10 21:22:01 +02:00
fe1aaa73a0 Fixed compile warning 2018-09-10 21:21:40 +02:00
57741f8c2d Translated using Weblate (Swedish)
Currently translated at 100.0% (316 of 316 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/
2018-09-09 19:10:29 +02:00
6eb3a4f7de Translated using Weblate (Russian)
Currently translated at 100.0% (316 of 316 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-09 19:10:29 +02:00
295a89b3cc Translated using Weblate (German)
Currently translated at 100.0% (316 of 316 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/de/
2018-09-09 19:10:29 +02:00
dc3fdc4c3b Translated using Weblate (Finnish)
Currently translated at 98.7% (312 of 316 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-09-09 19:10:29 +02:00
3867b723a9 Translated using Weblate (Swedish)
Currently translated at 100.0% (316 of 316 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/sv/
2018-09-09 19:10:29 +02:00
d7fc400d73 Translated using Weblate (Russian)
Currently translated at 100.0% (316 of 316 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/ru/
2018-09-09 19:10:29 +02:00
f8f6859e7d Translated using Weblate (Finnish)
Currently translated at 98.7% (312 of 316 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2018-09-09 19:10:29 +02:00
2501f834c8 Display numbers according to the locale settings
Closes #150
2018-09-09 18:46:43 +02:00
3f4b70ee48 Localization update 2018-09-09 15:34:34 +02:00
384d20b1a5 Changed 1/min to more convenient bpm/rpm
Closes #135
2018-09-09 15:27:44 +02:00
b4a06057f8 Fixed copy&paste error 2018-09-09 15:26:45 +02:00
9f14eb7e70 Added weblate info 2018-09-09 14:51:27 +02:00
dcf1c686e5 Added support for new IGC date header format
Fixes #152
2018-09-09 14:38:37 +02:00
a8d183639e Fixed broken zoom 0 handling
Fixes #151
2018-09-09 09:41:04 +02:00
d9e025a18c String handling optimization 2018-08-27 22:25:55 +02:00
0a9077545b Make huge images work under OpenGL (at least memory-ineficient) 2018-08-24 12:26:32 +02:00
bbc1d43290 Fixed QT4 build 2018-08-24 00:46:06 +02:00
524d72ce3c Merge branch 'master' of https://github.com/tumic0/GPXSee 2018-08-24 00:15:12 +02:00
9f74bbb27a Some more code cleanup 2018-08-24 00:14:40 +02:00
ce34d449c2 Translations update (#149) 2018-08-23 23:58:06 +02:00
21dbd3958d Removed obsolete method 2018-08-23 23:56:23 +02:00
92ac7c0c10 Removed obsolete define 2018-08-23 20:33:14 +02:00
1f71b3a3b2 Code/API cleanup 2018-08-23 20:26:10 +02:00
27886ea96a Update gpxsee_sv.ts (#148)
new string translated
2018-08-23 09:10:55 +02:00
3176271955 Only create/copy the sub-images when OpenGL is used 2018-08-23 09:08:59 +02:00
d4b46a4bb6 Broken OpenGL image part drawing workaround 2018-08-22 00:14:07 +02:00
3b2d4dcd31 Update README.md 2018-08-21 22:40:38 +02:00
de196e8281 Splited the OfflineMap class to separate OziMap and GeoTIFF map classes 2018-08-21 20:01:47 +02:00
f376f7139b Report an error on HiDPI maps when HiDPI support is not enabled 2018-08-20 18:46:44 +02:00
9fe10f10b8 Fixed compiler warning 2018-08-19 10:44:12 +02:00
136 changed files with 10518 additions and 3766 deletions

View File

@ -1,4 +1,4 @@
version: 5.17.{build}
version: 7.1.{build}
configuration: Release
platform: Any CPU
environment:
@ -34,6 +34,8 @@ build_script:
copy pkg\%NSI% installer
copy pkg\macros.nsh installer
xcopy pkg\csv installer\csv /i
xcopy pkg\maps installer\maps /i

View File

@ -3,23 +3,29 @@ GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX,
KML, FIT, IGC, NMEA, SLF, LOC and OziExplorer files.
## Features
* [User-definable online maps](https://github.com/tumic0/GPXSee-maps) (OSM/Google tiles, WMTS, WMS).
* Offline maps (OziExplorer maps, TrekBuddy maps/atlases, Garmin JNX maps, GeoTIFF images).
* User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS).
* Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases, Garmin JNX maps, GeoTIFF images).
* Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
* Support for multiple tracks in one view.
* Support for POI files.
* Print/export to PDF.
* Full-screen mode.
* HiDPI/Retina displays & maps support.
* Native GUI for Windows, Mac OS X and Linux.
* Opens GPX, TCX, FIT, KML, IGC, NMEA, SLF, LOC, OziExplorer (PLT, RTE, WPT) and Garmin CSV files.
![GPXSee - Linux](https://a.fsdn.com/con/app/proj/gpxsee/screenshots/linux2.png)
## Build
Build requirements:
* Qt 4.8 or QT 5.x (Qt >= 5.10.1 recommended for all features)
* C++03 compiler (tested: msvc2015, gcc >= 4.8, clang/Apple LLVM version 8.1.0)
Build steps:
```shell
lrelease gpxsee.pro
qmake gpxsee.pro
make
make # nmake on windows
```
## Download
@ -31,3 +37,9 @@ make
## Homepage
http://www.gpxsee.org
## Maps
[GPXSee maps repository](https://github.com/tumic0/GPXSee-maps)
## Translations
GPXSee uses [Weblate](https://hosted.weblate.org/projects/gpxsee/translations/) for translations.

View File

@ -1,9 +1,11 @@
TARGET = GPXSee
VERSION = 5.17
VERSION = 7.1
QT += core \
gui \
network
network \
sql \
concurrent
greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets
QT += printsupport
@ -12,14 +14,17 @@ lessThan(QT_MAJOR_VERSION, 5) {QT += opengl}
equals(QT_MAJOR_VERSION, 5) : lessThan(QT_MINOR_VERSION, 4) {QT += opengl}
INCLUDEPATH += ./src
HEADERS += src/config.h \
HEADERS += src/common/config.h \
src/common/staticassert.h \
src/common/coordinates.h \
src/common/range.h \
src/common/rectc.h \
src/common/wgs84.h \
src/common/str2int.h \
src/common/util.h \
src/common/rtree.h \
src/common/kv.h \
src/common/greatcircle.h \
src/common/programpaths.h \
src/GUI/app.h \
src/GUI/icons.h \
src/GUI/gui.h \
@ -69,10 +74,10 @@ HEADERS += src/config.h \
src/GUI/gearratiographitem.h \
src/GUI/oddspinbox.h \
src/GUI/settings.h \
src/GUI/nicenum.h \
src/GUI/cpuarch.h \
src/GUI/searchpointer.h \
src/GUI/mapview.h \
src/GUI/font.h \
src/map/projection.h \
src/map/ellipsoid.h \
src/map/datum.h \
@ -89,7 +94,7 @@ HEADERS += src/config.h \
src/map/downloader.h \
src/map/tile.h \
src/map/emptymap.h \
src/map/offlinemap.h \
src/map/ozimap.h \
src/map/tar.h \
src/map/ozf.h \
src/map/atlas.h \
@ -113,6 +118,15 @@ HEADERS += src/config.h \
src/map/crs.h \
src/map/coordinatesystem.h \
src/map/pointd.h \
src/map/rectd.h \
src/map/geocentric.h \
src/map/mercator.h \
src/map/jnxmap.h \
src/map/krovak.h \
src/map/geotiffmap.h \
src/map/image.h \
src/map/mbtilesmap.h \
src/map/osm.h \
src/data/graph.h \
src/data/poi.h \
src/data/waypoint.h \
@ -132,19 +146,15 @@ HEADERS += src/config.h \
src/data/igcparser.h \
src/data/nmeaparser.h \
src/data/oziparsers.h \
src/map/rectd.h \
src/map/geocentric.h \
src/map/mercator.h \
src/map/jnxmap.h \
src/map/krovak.h \
src/GUI/kv.h \
src/data/locparser.h \
src/data/slfparser.h
SOURCES += src/main.cpp \
src/common/coordinates.cpp \
src/common/rectc.cpp \
src/common/range.cpp \
src/common/str2int.cpp \
src/common/util.cpp \
src/common/greatcircle.cpp \
src/common/programpaths.cpp \
src/GUI/app.cpp \
src/GUI/gui.cpp \
src/GUI/axisitem.cpp \
@ -186,13 +196,12 @@ SOURCES += src/main.cpp \
src/GUI/cadencegraphitem.cpp \
src/GUI/powergraphitem.cpp \
src/GUI/gearratiographitem.cpp \
src/GUI/nicenum.cpp \
src/GUI/mapview.cpp \
src/map/maplist.cpp \
src/map/onlinemap.cpp \
src/map/downloader.cpp \
src/map/emptymap.cpp \
src/map/offlinemap.cpp \
src/map/ozimap.cpp \
src/map/tar.cpp \
src/map/atlas.cpp \
src/map/ozf.cpp \
@ -223,6 +232,15 @@ SOURCES += src/main.cpp \
src/map/wms.cpp \
src/map/crs.cpp \
src/map/coordinatesystem.cpp \
src/map/geocentric.cpp \
src/map/mercator.cpp \
src/map/jnxmap.cpp \
src/map/krovak.cpp \
src/map/map.cpp \
src/map/geotiffmap.cpp \
src/map/image.cpp \
src/map/mbtilesmap.cpp \
src/map/osm.cpp \
src/data/data.cpp \
src/data/poi.cpp \
src/data/track.cpp \
@ -236,34 +254,36 @@ SOURCES += src/main.cpp \
src/data/igcparser.cpp \
src/data/nmeaparser.cpp \
src/data/oziparsers.cpp \
src/map/geocentric.cpp \
src/map/mercator.cpp \
src/map/jnxmap.cpp \
src/map/krovak.cpp \
src/map/map.cpp \
src/data/locparser.cpp \
src/data/slfparser.cpp
RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts \
TRANSLATIONS = lang/gpxsee_en.ts \
lang/gpxsee_cs.ts \
lang/gpxsee_sv.ts \
lang/gpxsee_de.ts \
lang/gpxsee_ru.ts \
lang/gpxsee_fi.ts \
lang/gpxsee_fr.ts \
lang/gpxsee_pl.ts
lang/gpxsee_pl.ts \
lang/gpxsee_nb.ts \
lang/gpxsee_da.ts \
lang/gpxsee_tr.ts
macx {
ICON = icons/gpxsee.icns
QMAKE_INFO_PLIST = pkg/Info.plist
LOCALE.path = Contents/Resources/translations
LOCALE.files = lang/gpxsee_cs.qm \
LOCALE.files = lang/gpxsee_en.qm \
lang/gpxsee_cs.qm \
lang/gpxsee_de.qm \
lang/gpxsee_fi.qm \
lang/gpxsee_fr.qm \
lang/gpxsee_ru.qm \
lang/gpxsee_sv.qm \
lang/gpxsee_pl.qm
lang/gpxsee_pl.qm \
lang/gpxsee_nb.qm \
lang/gpxsee_da.qm \
lang/gpxsee_tr.qm
CSV.path = Contents/Resources
CSV.files = pkg/csv
MAPS.path = Contents/Resources
@ -299,3 +319,4 @@ win32 {
}
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
DEFINES *= QT_USE_QSTRINGBUILDER

View File

@ -40,5 +40,7 @@
<file>icons/document-print_32@2x.png</file>
<file>icons/view-filter.png</file>
<file>icons/view-filter@2x.png</file>
<file>icons/applications-internet_32.png</file>
<file>icons/applications-internet_32@2x.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

File diff suppressed because it is too large Load Diff

1749
lang/gpxsee_da.ts Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4
lang/gpxsee_en.ts Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
</TS>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1749
lang/gpxsee_nb.ts Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1748
lang/gpxsee_tr.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,21 +8,23 @@
<summary>GPS log file viewer and analyzer</summary>
<description>
<p>GPXSee is a GPS log file viewer and analyzer that supports GPX, TCX,
KML, FIT, IGC, NMEA and OziExplorer files.</p>
KML, FIT, IGC, NMEA, SLF, LOC and OziExplorer files.</p>
<p>Features:</p>
<ul>
<li>User-definable online maps (OSM/Google tiles, WMTS, WMS).</li>
<li>Offline maps (OziExplorer maps, TrekBuddy maps/atlases, GeoTIFF
images).</li>
<li>User-definable online maps (OpenStreetMap/Google tiles, WMTS,
WMS, TMS).</li>
<li>Offline maps (MBTiles, OziExplorer maps, TrekBuddy maps/atlases,
GeoTIFF images).</li>
<li>Elevation, speed, heart rate, cadence, power and temperature
graphs.</li>
<li>Support for multiple tracks in one view.</li>
<li>Support for POI files.</li>
<li>Print/export to PDF.</li>
<li>Full-screen mode.</li>
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, OziExplorer (PLT, WPT, RTE)
and Garmin CSV files.</li>
<li>HiDPI/Retina displays &amp; maps support.</li>
<li>Opens GPX, TCX, FIT, KML, IGC, NMEA, SLF, LOC, OziExplorer (PLT,
WPT, RTE) and Garmin CSV files.</li>
</ul>
</description>
@ -38,6 +40,10 @@
<categories>
<category>Graphics</category>
<category>Viewer</category>
<category>Maps</category>
<category>Geoscience</category>
<category>Geography</category>
<category>DataVisualization</category>
</categories>
<url type="homepage">http://www.gpxsee.org</url>
@ -58,5 +64,7 @@
<mimetype>application/vnd.oziexplorer.plt</mimetype>
<mimetype>application/vnd.oziexplorer.rte</mimetype>
<mimetype>application/vnd.oziexplorer.wpt</mimetype>
<mimetype>application/loc+xml</mimetype>
<mimetype>application/slf+xml</mimetype>
</mimetypes>
</component>

View File

@ -10,5 +10,5 @@ Exec=gpxsee %F
Icon=gpxsee
Terminal=false
Type=Application
Categories=Graphics;Viewer;Maps;Qt;
Categories=Graphics;Viewer;Education;Geography;Maps;Sports;Qt;
MimeType=application/gpx+xml;application/tcx+xml;application/vnd.ant.fit;application/vnd.google-earth.kml+xml;application/vnd.fai.igc;application/vnd.nmea.nmea;application/vnd.oziexplorer.plt;application/vnd.oziexplorer.rte;application/vnd.oziexplorer.wpt;application/loc+xml;application/slf+xml;

View File

@ -1,36 +1,13 @@
!include "MUI2.nsh"
!include "x64.nsh"
!include "WinVer.nsh"
; Macros
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend
!macro FILE_ASSOCIATION_REMOVE EXT
DeleteRegKey HKCR "GPXSee.${EXT}"
DeleteRegKey HKCR ".${EXT}"
!macroend
!macro LOCALIZATION LANG CODE
Section "${LANG}"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_${CODE}.qm translations\gpxsee_${CODE}.qm
!if /FileExists translations\qt_${CODE}.qm
File /oname=translations\qt_${CODE}.qm translations\qt_${CODE}.qm
!endif
SectionEnd
!macroend
!include "macros.nsh"
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "5.17"
!define VERSION "7.1"
; The file to write
OutFile "GPXSee-${VERSION}.exe"
@ -153,10 +130,13 @@ Section "QT framework" SEC_QT
File "Qt5Widgets.dll"
File "Qt5PrintSupport.dll"
File "Qt5Network.dll"
File "Qt5Sql.dll"
File "Qt5Concurrent.dll"
File /r "platforms"
File /r "imageformats"
File /r "printsupport"
File /r "styles"
File /r "sqldrivers"
SectionEnd
@ -201,12 +181,15 @@ SectionEnd
SectionGroup "Localization" SEC_LOCALIZATION
!insertmacro LOCALIZATION "Czech" "cs"
!insertmacro LOCALIZATION "Danish" "da"
!insertmacro LOCALIZATION "Finnish" "fi"
!insertmacro LOCALIZATION "French" "fr"
!insertmacro LOCALIZATION "German" "de"
!insertmacro LOCALIZATION "Norwegian" "nb"
!insertmacro LOCALIZATION "Polish" "pl"
!insertmacro LOCALIZATION "Russian" "ru"
!insertmacro LOCALIZATION "Swedish" "sv"
!insertmacro LOCALIZATION "Turkish" "tr"
SectionGroupEnd
;--------------------------------
@ -270,4 +253,4 @@ LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
!insertmacro MUI_FUNCTION_DESCRIPTION_END

View File

@ -1,36 +1,13 @@
!include "MUI2.nsh"
!include "x64.nsh"
!include "WinVer.nsh"
; Macros
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend
!macro FILE_ASSOCIATION_REMOVE EXT
DeleteRegKey HKCR "GPXSee.${EXT}"
DeleteRegKey HKCR ".${EXT}"
!macroend
!macro LOCALIZATION LANG CODE
Section "${LANG}"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_${CODE}.qm translations\gpxsee_${CODE}.qm
!if /FileExists translations\qt_${CODE}.qm
File /oname=translations\qt_${CODE}.qm translations\qt_${CODE}.qm
!endif
SectionEnd
!macroend
!include "macros.nsh"
; The name of the installer
Name "GPXSee"
; Program version
!define VERSION "5.17"
!define VERSION "7.1"
; The file to write
OutFile "GPXSee-${VERSION}_x64.exe"
@ -160,10 +137,13 @@ Section "QT framework" SEC_QT
File "Qt5Widgets.dll"
File "Qt5PrintSupport.dll"
File "Qt5Network.dll"
File "Qt5Sql.dll"
File "Qt5Concurrent.dll"
File /r "platforms"
File /r "imageformats"
File /r "printsupport"
File /r "styles"
File /r "sqldrivers"
SectionEnd
@ -203,12 +183,15 @@ SectionEnd
SectionGroup "Localization" SEC_LOCALIZATION
!insertmacro LOCALIZATION "Czech" "cs"
!insertmacro LOCALIZATION "Danish" "da"
!insertmacro LOCALIZATION "Finnish" "fi"
!insertmacro LOCALIZATION "French" "fr"
!insertmacro LOCALIZATION "German" "de"
!insertmacro LOCALIZATION "Norwegian" "nb"
!insertmacro LOCALIZATION "Polish" "pl"
!insertmacro LOCALIZATION "Russian" "ru"
!insertmacro LOCALIZATION "Swedish" "sv"
!insertmacro LOCALIZATION "Turkish" "tr"
SectionGroupEnd
;--------------------------------
@ -273,4 +256,4 @@ LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LOCALIZATION} $(DESC_LOCALIZATION)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
!insertmacro MUI_FUNCTION_DESCRIPTION_END

23
pkg/macros.nsh Normal file
View File

@ -0,0 +1,23 @@
; File association
!macro FILE_ASSOCIATION_ADD EXT DESC ICON
WriteRegStr HKCR ".${EXT}" "" "GPXSee.${EXT}"
WriteRegStr HKCR "GPXSee.${EXT}" "" "${DESC}"
WriteRegStr HKCR "GPXSee.${EXT}\DefaultIcon" "" "$INSTDIR\GPXSee.exe,${ICON}"
WriteRegStr HKCR "GPXSee.${EXT}\shell\open\command" "" "$\"$INSTDIR\GPXSee.exe$\" $\"%1$\""
!macroend
!macro FILE_ASSOCIATION_REMOVE EXT
DeleteRegKey HKCR "GPXSee.${EXT}"
DeleteRegKey HKCR ".${EXT}"
!macroend
; Translations
!macro LOCALIZATION LANG CODE
Section "${LANG}"
CreateDirectory "$INSTDIR\translations"
File /oname=translations\gpxsee_${CODE}.qm translations\gpxsee_${CODE}.qm
!if /FileExists translations\qt_${CODE}.qm
File /oname=translations\qt_${CODE}.qm translations\qt_${CODE}.qm
!endif
SectionEnd
!macroend

View File

@ -5,26 +5,37 @@
#include <QNetworkProxyFactory>
#include <QNetworkAccessManager>
#include <QLibraryInfo>
#include <QSettings>
#include "common/programpaths.h"
#include "common/config.h"
#include "map/downloader.h"
#include "map/ellipsoid.h"
#include "map/gcs.h"
#include "map/pcs.h"
#include "opengl.h"
#include "gui.h"
#include "config.h"
#include "settings.h"
#include "app.h"
App::App(int &argc, char **argv) : QApplication(argc, argv),
_argc(argc), _argv(argv)
{
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
setApplicationName(APP_NAME);
#else
setApplicationName(QString(APP_NAME).toLower());
#endif
setApplicationVersion(APP_VERSION);
QTranslator *gpxsee = new QTranslator(this);
gpxsee->load(QLocale::system(), "gpxsee", "_", TRANSLATIONS_DIR);
gpxsee->load(QLocale::system(), "gpxsee", "_",
ProgramPaths::translationsDir());
installTranslator(gpxsee);
QTranslator *qt = new QTranslator(this);
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
qt->load(QLocale::system(), "qt", "_", TRANSLATIONS_DIR);
qt->load(QLocale::system(), "qt", "_", ProgramPaths::translationsDir());
#else // Q_OS_WIN32 || Q_OS_MAC
qt->load(QLocale::system(), "qt", "_", QLibraryInfo::location(
QLibraryInfo::TranslationsPath));
@ -36,7 +47,21 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
#endif // Q_OS_MAC
QNetworkProxyFactory::setUseSystemConfiguration(true);
Downloader::setNetworkAccessManager(new QNetworkAccessManager(this));
QSettings settings(APP_NAME, APP_NAME);
settings.beginGroup(OPTIONS_SETTINGS_GROUP);
/* The QNetworkAccessManager must be a child of QApplication, otherwise it
triggers the following warning on exit (and may probably crash):
"QThreadStorage: Thread X exited after QThreadStorage Y destroyed" */
Downloader::setNetworkManager(new QNetworkAccessManager(this));
#ifdef ENABLE_HTTP2
Downloader::enableHTTP2(settings.value(ENABLE_HTTP2_SETTING,
ENABLE_HTTP2_DEFAULT).toBool());
#endif // ENABLE_HTTP2
Downloader::setTimeout(settings.value(CONNECTION_TIMEOUT_SETTING,
CONNECTION_TIMEOUT_DEFAULT).toInt());
settings.endGroup();
OPENGL_SET_SAMPLES(4);
loadDatums();
loadPCSs();
@ -49,14 +74,15 @@ App::~App()
delete _gui;
}
void App::run()
int App::run()
{
_gui->show();
for (int i = 1; i < _argc; i++)
_gui->openFile(QString::fromLocal8Bit(_argv[i]));
QStringList args(arguments());
for (int i = 1; i < args.count(); i++)
_gui->openFile(args.at(i));
exec();
return exec();
}
bool App::event(QEvent *event)
@ -71,41 +97,27 @@ bool App::event(QEvent *event)
void App::loadDatums()
{
QString ef, df;
QString ellipsoidsFile(ProgramPaths::ellipsoidsFile());
QString gcsFile(ProgramPaths::gcsFile());
if (QFile::exists(USER_ELLIPSOID_FILE))
ef = USER_ELLIPSOID_FILE;
else if (QFile::exists(GLOBAL_ELLIPSOID_FILE))
ef = GLOBAL_ELLIPSOID_FILE;
else
if (ellipsoidsFile.isNull())
qWarning("No ellipsoids file found.");
if (gcsFile.isNull())
qWarning("No GCS file found.");
if (QFile::exists(USER_GCS_FILE))
df = USER_GCS_FILE;
else if (QFile::exists(GLOBAL_GCS_FILE))
df = GLOBAL_GCS_FILE;
else
qWarning("No datums file found.");
if (!ef.isNull() && !df.isNull()) {
Ellipsoid::loadList(ef);
GCS::loadList(df);
if (!ellipsoidsFile.isNull() && !gcsFile.isNull()) {
Ellipsoid::loadList(ellipsoidsFile);
GCS::loadList(gcsFile);
} else
qWarning("Maps based on a datum different from WGS84 won't work.");
}
void App::loadPCSs()
{
QString file;
QString pcsFile(ProgramPaths::pcsFile());
if (QFile::exists(USER_PCS_FILE))
file = USER_PCS_FILE;
else if (QFile::exists(GLOBAL_PCS_FILE))
file = GLOBAL_PCS_FILE;
else {
if (pcsFile.isNull())
qWarning("No PCS file found.");
return;
}
PCS::loadList(file);
else
PCS::loadList(pcsFile);
}

View File

@ -12,7 +12,7 @@ class App : QApplication
public:
App(int &argc, char **argv);
~App();
void run();
int run();
protected:
bool event(QEvent *event);

View File

@ -1,7 +1,7 @@
#include <cmath>
#include <QPainter>
#include "config.h"
#include "nicenum.h"
#include "common/util.h"
#include "font.h"
#include "axisitem.h"
@ -36,7 +36,8 @@ Ticks::Ticks(double minValue, double maxValue, int maxCount)
}
AxisItem::AxisItem(Type type, QGraphicsItem *parent) : QGraphicsItem(parent)
AxisItem::AxisItem(Type type, QGraphicsItem *parent)
: QGraphicsItem(parent), _locale(QLocale::system())
{
_type = type;
_size = 0;
@ -56,7 +57,7 @@ void AxisItem::setRange(const RangeF &range)
for (int i = 0; i < ticks.count(); i++) {
Tick &t = _ticks[i];
t.value = ticks.val(i);
t.boundingBox = fm.tightBoundingRect(QString::number(t.value));
t.boundingBox = fm.tightBoundingRect(_locale.toString(t.value));
}
updateBoundingRect();
@ -126,7 +127,7 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
TICK/2, (_size/_range.size()) * (val - _range.min()), -TICK/2);
painter->drawText(((_size/_range.size()) * (val - _range.min()))
- (ts.width()/2), ts.height() + TICK/2 + PADDING,
QString::number(val));
_locale.toString(val));
}
painter->drawText(_size/2 - _labelBB.width()/2, _labelBB.height()
@ -145,7 +146,7 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
* (val - _range.min())));
painter->drawText(-(ts.width() + PADDING + TICK/2),
-((_size/_range.size()) * (val - _range.min())) + (ts.height()/2),
QString::number(val));
_locale.toString(val));
}
painter->rotate(-90);

View File

@ -3,6 +3,7 @@
#include <QGraphicsItem>
#include <QVector>
#include <QLocale>
#include "common/range.h"
class AxisItem : public QGraphicsItem
@ -39,6 +40,7 @@ private:
QVector<Tick> _ticks;
QRectF _boundingRect;
QFont _font;
QLocale _locale;
};
#endif // AXISITEM_H

View File

@ -1,3 +1,4 @@
#include <QLocale>
#include "data/data.h"
#include "cadencegraphitem.h"
#include "cadencegraph.h"
@ -7,7 +8,7 @@ CadenceGraph::CadenceGraph(QWidget *parent) : GraphTab(parent)
{
_showTracks = true;
GraphView::setYUnits(tr("1/min"));
GraphView::setYUnits(tr("rpm"));
setYLabel(tr("Cadence"));
setSliderPrecision(1);
@ -16,9 +17,11 @@ CadenceGraph::CadenceGraph(QWidget *parent) : GraphTab(parent)
void CadenceGraph::setInfo()
{
if (_showTracks) {
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale()
QLocale l(QLocale::system());
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale()
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
} else
clearInfo();

View File

@ -1,13 +1,20 @@
#include <QLocale>
#include "tooltip.h"
#include "cadencegraphitem.h"
CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
qreal sum = 0;
_max = graph.first().y();
for (int j = 1; j < graph.size(); j++)
sum += graph.at(j).y() * (graph.at(j).s() - graph.at(j-1).s());
for (int i = 1; i < graph.size(); i++) {
qreal y = graph.at(i).y();
sum += y * (graph.at(i).s() - graph.at(i-1).s());
if (y > _max)
_max = y;
}
_avg = sum/graph.last().s();
setToolTip(toolTip());
@ -16,11 +23,12 @@ CadenceGraphItem::CadenceGraphItem(const Graph &graph, GraphType type,
QString CadenceGraphItem::toolTip() const
{
ToolTip tt;
QLocale l(QLocale::system());
tt.insert(tr("Maximum"), QString::number(max(), 'f', 1)
+ UNIT_SPACE + tr("1/min"));
tt.insert(tr("Average"), QString::number(avg(), 'f', 1)
+ UNIT_SPACE + tr("1/min"));
tt.insert(tr("Maximum"), l.toString(max(), 'f', 1)
+ UNIT_SPACE + tr("rpm"));
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
+ UNIT_SPACE + tr("rpm"));
return tt.toString();
}

View File

@ -11,13 +11,13 @@ public:
CadenceGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent = 0);
qreal max() const {return -bounds().top();}
qreal max() const {return _max;}
qreal avg() const {return _avg;}
private:
QString toolTip() const;
qreal _avg;
qreal _avg, _max;
};
#endif // CADENCEGRAPHITEM_H

View File

@ -1,6 +1,6 @@
#include <cmath>
#include <QLocale>
#include "data/data.h"
#include "config.h"
#include "tooltip.h"
#include "elevationgraphitem.h"
#include "elevationgraph.h"
@ -54,13 +54,15 @@ void ElevationGraph::setInfo()
if (std::isnan(max()) || std::isnan(min()))
clearInfo();
else {
GraphView::addInfo(tr("Ascent"), QString::number(ascent() * yScale(),
QLocale l(QLocale::system());
GraphView::addInfo(tr("Ascent"), l.toString(ascent() * yScale(),
'f', 0) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Descent"), QString::number(descent() * yScale(),
GraphView::addInfo(tr("Descent"), l.toString(descent() * yScale(),
'f', 0) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale(), 'f',
0) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Minimum"), QString::number(min() * yScale(), 'f',
GraphView::addInfo(tr("Minimum"), l.toString(min() * yScale(), 'f',
0) + UNIT_SPACE + yUnits());
}
}

View File

@ -1,10 +1,13 @@
#include <QLocale>
#include "tooltip.h"
#include "elevationgraphitem.h"
ElevationGraphItem::ElevationGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
_ascent = _descent = 0;
_min = _max = graph.first().y();
for (int j = 1; j < graph.size(); j++) {
qreal cur = graph.at(j).y();
@ -14,6 +17,11 @@ ElevationGraphItem::ElevationGraphItem(const Graph &graph, GraphType type,
_ascent += cur - prev;
if (cur < prev)
_descent += prev - cur;
if (cur < _min)
_min = cur;
if (cur > _max)
_max = cur;
}
setToolTip(toolTip(Metric));
@ -24,14 +32,15 @@ QString ElevationGraphItem::toolTip(Units units) const
ToolTip tt;
qreal scale = (units == Metric) ? 1.0 : M2FT;
QString su = (units == Metric) ? tr("m") : tr("ft");
QLocale l(QLocale::system());
tt.insert(tr("Ascent"), QString::number(ascent() * scale, 'f', 0)
tt.insert(tr("Ascent"), l.toString(ascent() * scale, 'f', 0)
+ UNIT_SPACE + su);
tt.insert(tr("Descent"), QString::number(descent() * scale, 'f', 0)
tt.insert(tr("Descent"), l.toString(descent() * scale, 'f', 0)
+ UNIT_SPACE + su);
tt.insert(tr("Maximum"), QString::number(max() * scale, 'f', 0)
tt.insert(tr("Maximum"), l.toString(max() * scale, 'f', 0)
+ UNIT_SPACE + su);
tt.insert(tr("Minimum"), QString::number(min() * scale, 'f', 0)
tt.insert(tr("Minimum"), l.toString(min() * scale, 'f', 0)
+ UNIT_SPACE + su);
return tt.toString();

View File

@ -13,15 +13,15 @@ public:
qreal ascent() const {return _ascent;}
qreal descent() const {return _descent;}
qreal min() const {return -bounds().bottom();}
qreal max() const {return -bounds().top();}
qreal min() const {return _min;}
qreal max() const {return _max;}
void setUnits(Units units);
private:
QString toolTip(Units units) const;
qreal _ascent, _descent;
qreal _ascent, _descent, _min, _max;
};
#endif // ELEVATIONGRAPHITEM_H

View File

@ -22,7 +22,8 @@ ExportDialog::ExportDialog(Export *exp, QWidget *parent)
int index;
_fileSelect = new FileSelectWidget();
_fileSelect->setFilter(tr("PDF files (*.pdf);;All files (*)"));
_fileSelect->setFilter(tr("PDF files") + " (*.pdf);;" + tr("All files")
+ " (*)");
_fileSelect->setFile(_export->fileName);
_paperSize = new QComboBox();

7
src/GUI/font.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef FONT_H
#define FONT_H
#define FONT_FAMILY "Arial"
#define FONT_SIZE 12 // px
#endif // FONT_H

View File

@ -46,37 +46,41 @@ QString Format::timeSpan(qreal time, bool full)
QString Format::distance(qreal value, Units units)
{
QLocale l(QLocale::system());
if (units == Imperial) {
if (value < MIINM)
return QString::number(value * M2FT, 'f', 0) + UNIT_SPACE
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
+ qApp->translate("Format", "ft");
else
return QString::number(value * M2MI, 'f', 1) + UNIT_SPACE
return l.toString(value * M2MI, 'f', 1) + UNIT_SPACE
+ qApp->translate("Format", "mi");
} else if (units == Nautical) {
if (value < NMIINM)
return QString::number(value * M2FT, 'f', 0) + UNIT_SPACE
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
+ qApp->translate("Format", "ft");
else
return QString::number(value * M2NMI, 'f', 1) + UNIT_SPACE
return l.toString(value * M2NMI, 'f', 1) + UNIT_SPACE
+ qApp->translate("Format", "nmi");
} else {
if (value < KMINM)
return QString::number(value, 'f', 0) + UNIT_SPACE
return l.toString(value, 'f', 0) + UNIT_SPACE
+ qApp->translate("Format", "m");
else
return QString::number(value * M2KM, 'f', 1) + UNIT_SPACE
return l.toString(value * M2KM, 'f', 1) + UNIT_SPACE
+ qApp->translate("Format", "km");
}
}
QString Format::elevation(qreal value, Units units)
{
QLocale l(QLocale::system());
if (units == Metric)
return QString::number(qRound(value)) + UNIT_SPACE
return l.toString(qRound(value)) + UNIT_SPACE
+ qApp->translate("Format", "m");
else
return QString::number(qRound(value * M2FT)) + UNIT_SPACE
return l.toString(qRound(value * M2FT)) + UNIT_SPACE
+ qApp->translate("Format", "ft");
}
@ -95,7 +99,8 @@ QString Format::coordinates(const Coordinates &value, CoordinatesFormat type)
+ deg2DMS(qAbs(value.lon())) + xH;
break;
default:
return QString::number(qAbs(value.lat()), 'f', 5) + yH + ","
+ QChar(0x00A0) + QString::number(qAbs(value.lon()), 'f', 5) + xH;
QLocale l(QLocale::system());
return l.toString(qAbs(value.lat()), 'f', 5) + yH + ","
+ QChar(0x00A0) + l.toString(qAbs(value.lon()), 'f', 5) + xH;
}
}

View File

@ -1,3 +1,4 @@
#include <QLocale>
#include "data/data.h"
#include "gearratiographitem.h"
#include "gearratiograph.h"
@ -16,11 +17,13 @@ GearRatioGraph::GearRatioGraph(QWidget *parent) : GraphTab(parent)
void GearRatioGraph::setInfo()
{
if (_showTracks) {
GraphView::addInfo(tr("Most used"), QString::number(top() * yScale(),
QLocale l(QLocale::system());
GraphView::addInfo(tr("Most used"), l.toString(top() * yScale(),
'f', 2) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Minimum"), QString::number(min() * yScale(), 'f',
GraphView::addInfo(tr("Minimum"), l.toString(min() * yScale(), 'f',
2) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale(), 'f',
2) + UNIT_SPACE + yUnits());
} else
clearInfo();

View File

@ -1,16 +1,25 @@
#include <QMap>
#include <QLocale>
#include "tooltip.h"
#include "gearratiographitem.h"
GearRatioGraphItem::GearRatioGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent), _top(NAN)
{
qreal val = NAN;
_min = _max = graph.first().y();
for (int i = 1; i < graph.size(); i++) {
const GraphPoint &p = graph.at(i);
for (int j = 1; j < graph.size(); j++) {
const GraphPoint &p = graph.at(j);
qreal val = _map.value(p.y());
_map.insert(p.y(), val + (p.s() - graph.at(j-1).s()));
_map.insert(p.y(), val + (p.s() - graph.at(i-1).s()));
if (p.y() < _min)
_min = p.y();
if (p.y() > _max)
_max = p.y();
}
for (QMap<qreal, qreal>::const_iterator it = _map.constBegin();
@ -30,10 +39,11 @@ GearRatioGraphItem::GearRatioGraphItem(const Graph &graph, GraphType type,
QString GearRatioGraphItem::toolTip() const
{
ToolTip tt;
QLocale l(QLocale::system());
tt.insert(tr("Minimum"), QString::number(min(), 'f', 2));
tt.insert(tr("Maximum"), QString::number(max(), 'f', 2));
tt.insert(tr("Most used"), QString::number(top(), 'f', 2));
tt.insert(tr("Minimum"), l.toString(min(), 'f', 2));
tt.insert(tr("Maximum"), l.toString(max(), 'f', 2));
tt.insert(tr("Most used"), l.toString(top(), 'f', 2));
return tt.toString();
}

View File

@ -12,8 +12,8 @@ public:
GearRatioGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent = 0);
qreal min() const {return -bounds().bottom();}
qreal max() const {return -bounds().top();}
qreal min() const {return _min;}
qreal max() const {return _max;}
qreal top() const {return _top;}
const QMap<qreal, qreal> &map() const {return _map;}
@ -22,7 +22,7 @@ private:
QString toolTip() const;
QMap<qreal, qreal> _map;
qreal _top;
qreal _top, _min, _max;
};
#endif // GEARRATIOGRAPHITEM_H

View File

@ -5,9 +5,9 @@
#include <QPaintDevice>
#include <QGraphicsSimpleTextItem>
#include <QPalette>
#include <QLocale>
#include "data/graph.h"
#include "opengl.h"
#include "config.h"
#include "axisitem.h"
#include "slideritem.h"
#include "sliderinfoitem.h"
@ -413,8 +413,10 @@ void GraphView::updateSliderPosition()
void GraphView::updateSliderInfo()
{
QLocale l(QLocale::system());
qreal r, y;
if (_visible.count() > 1) {
r = 0;
y = 0;
@ -435,9 +437,9 @@ void GraphView::updateSliderInfo()
_sliderInfo->setSide(s);
_sliderInfo->setPos(QPointF(0, _slider->boundingRect().height() * r));
_sliderInfo->setText(_graphType == Time ? Format::timeSpan(_sliderPos,
bounds().width() > 3600) : QString::number(_sliderPos * _xScale, 'f', 1)
bounds().width() > 3600) : l.toString(_sliderPos * _xScale, 'f', 1)
+ UNIT_SPACE + _xUnits, (_visible.count() > 1) ? QString()
: QString::number(-y * _yScale + _yOffset, 'f', _precision) + UNIT_SPACE
: l.toString(-y * _yScale + _yOffset, 'f', _precision) + UNIT_SPACE
+ _yUnits);
}

View File

@ -1,4 +1,4 @@
#include "config.h"
#include "common/config.h"
#include <QApplication>
#include <QSplitter>
#include <QVBoxLayout>
@ -28,6 +28,7 @@
#include <QScreen>
#endif // ENABLE_HIDPI
#include <QStyle>
#include "common/programpaths.h"
#include "data/data.h"
#include "data/poi.h"
#include "map/maplist.h"
@ -108,14 +109,9 @@ GUI::GUI()
void GUI::loadMaps()
{
_ml = new MapList(this);
QString dir;
QString mapDir(ProgramPaths::mapDir());
if (QFile::exists(USER_MAP_DIR))
dir = USER_MAP_DIR;
else if (QFile::exists(GLOBAL_MAP_DIR))
dir = GLOBAL_MAP_DIR;
if (!dir.isNull() && !_ml->loadDir(dir))
if (!mapDir.isNull() && !_ml->loadDir(mapDir))
qWarning("%s", qPrintable(_ml->errorString()));
_map = new EmptyMap(this);
@ -124,14 +120,9 @@ void GUI::loadMaps()
void GUI::loadPOIs()
{
_poi = new POI(this);
QString dir;
QString poiDir(ProgramPaths::poiDir());
if (QFile::exists(USER_POI_DIR))
dir = USER_POI_DIR;
else if (QFile::exists(GLOBAL_POI_DIR))
dir = GLOBAL_POI_DIR;
if (!dir.isNull() && !_poi->loadDir(dir))
if (!poiDir.isNull() && !_poi->loadDir(poiDir))
qWarning("%s", qPrintable(_poi->errorString()));
}
@ -147,44 +138,47 @@ void GUI::createMapActions()
_mapsActionGroup = new QActionGroup(this);
_mapsActionGroup->setExclusive(true);
for (int i = 0; i < _ml->maps().count(); i++) {
QAction *a = new QAction(_ml->maps().at(i)->name(), this);
a->setMenuRole(QAction::NoRole);
a->setCheckable(true);
a->setActionGroup(_mapsActionGroup);
_mapsSignalMapper->setMapping(a, i);
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
_mapActions.append(a);
}
for (int i = 0; i < _ml->maps().count(); i++)
createMapAction(_ml->maps().at(i));
connect(_mapsSignalMapper, SIGNAL(mapped(int)), this,
SLOT(mapChanged(int)));
}
QAction *GUI::createMapAction(const Map *map)
{
QAction *a = new QAction(map->name(), this);
a->setMenuRole(QAction::NoRole);
a->setCheckable(true);
a->setActionGroup(_mapsActionGroup);
_mapActions.append(a);
_mapsSignalMapper->setMapping(a, _mapActions.size() - 1);
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
return a;
}
void GUI::createPOIFilesActions()
{
_poiFilesSignalMapper = new QSignalMapper(this);
for (int i = 0; i < _poi->files().count(); i++)
createPOIFileAction(i);
createPOIFileAction(_poi->files().at(i));
connect(_poiFilesSignalMapper, SIGNAL(mapped(int)), this,
SLOT(poiFileChecked(int)));
}
QAction *GUI::createPOIFileAction(int index)
QAction *GUI::createPOIFileAction(const QString &fileName)
{
QAction *a = new QAction(QFileInfo(_poi->files().at(index)).fileName(),
this);
QAction *a = new QAction(QFileInfo(fileName).fileName(), this);
a->setMenuRole(QAction::NoRole);
a->setCheckable(true);
_poiFilesSignalMapper->setMapping(a, index);
connect(a, SIGNAL(triggered()), _poiFilesSignalMapper, SLOT(map()));
_poiFilesActions.append(a);
_poiFilesSignalMapper->setMapping(a, _poiFilesActions.size() - 1);
connect(a, SIGNAL(triggered()), _poiFilesSignalMapper, SLOT(map()));
return a;
}
@ -641,14 +635,15 @@ void GUI::about()
QUrl homepage(APP_HOMEPAGE);
msgBox.setWindowTitle(tr("About GPXSee"));
msgBox.setText("<h2>" + QString(APP_NAME) + "</h2><p><p>" + tr("Version ")
+ APP_VERSION + " (" + CPU_ARCH + ", Qt " + QT_VERSION_STR + ")</p>");
msgBox.setText("<h2>" + QString(APP_NAME) + "</h2><p><p>" + tr("Version %1")
.arg(QString(APP_VERSION) + " (" + CPU_ARCH + ", Qt " + QT_VERSION_STR
+ ")") + "</p>");
msgBox.setInformativeText("<table width=\"300\"><tr><td>"
+ tr("GPXSee is distributed under the terms of the GNU General Public "
"License version 3. For more info about GPXSee visit the project "
"homepage at ") + "<a href=\"" + homepage.toString() + "\">"
+ homepage.toString(QUrl::RemoveScheme).mid(2)
+ "</a>.</td></tr></table>");
"homepage at %1.").arg("<a href=\"" + homepage.toString() + "\">"
+ homepage.toString(QUrl::RemoveScheme).mid(2) + "</a>")
+ "</td></tr></table>");
QIcon icon = msgBox.windowIcon();
QSize size = icon.actualSize(QSize(64, 64));
@ -698,19 +693,15 @@ void GUI::paths()
msgBox.setWindowTitle(tr("Paths"));
msgBox.setText("<h3>" + tr("Paths") + "</h3>");
msgBox.setInformativeText(
"<style>td {white-space: pre; padding-right: 1em;}</style><h4>"
+ tr("Global") + "</h4><table><tr><td>" + tr("Map directory:")
+ "</td><td><code>" + QDir::cleanPath(GLOBAL_MAP_DIR)
+ "</code></td></tr><tr><td>" + tr("POI directory:") + "</td><td><code>"
+ QDir::cleanPath(GLOBAL_POI_DIR) + "</code></td></tr><tr><td>"
"<style>td {white-space: pre; padding-right: 1em;}</style><table><tr><td>"
+ tr("Map directory:") + "</td><td><code>"
+ QDir::cleanPath(ProgramPaths::mapDir(true)) + "</code></td></tr><tr><td>"
+ tr("POI directory:") + "</td><td><code>"
+ QDir::cleanPath(ProgramPaths::poiDir(true)) + "</code></td></tr><tr><td>"
+ tr("GCS/PCS directory:") + "</td><td><code>"
+ QDir::cleanPath(GLOBAL_CSV_DIR) + "</code></td></tr></table>"
+ "<h4>" + tr("User-specific") + "</h4><table><tr><td>"
+ tr("Map directory:") + "</td><td><code>" + QDir::cleanPath(USER_MAP_DIR)
+ "</code></td></tr><tr><td>" + tr("POI directory:") + "</td><td><code>"
+ QDir::cleanPath(USER_POI_DIR) + "</code></td></tr><tr><td>"
+ tr("GCS/PCS directory:") + "</td><td><code>"
+ QDir::cleanPath(USER_CSV_DIR) + "</code></td></tr></table>"
+ QDir::cleanPath(ProgramPaths::csvDir(true)) + "</code></td></tr><tr><td>"
+ tr("Tile cache directory:") + "</td><td><code>"
+ QDir::cleanPath(ProgramPaths::tilesDir()) + "</code></td></tr></table>"
);
msgBox.exec();
@ -838,7 +829,15 @@ bool GUI::openPOIFile(const QString &fileName)
if (fileName.isEmpty() || _poi->files().contains(fileName))
return false;
if (!_poi->loadFile(fileName)) {
if (_poi->loadFile(fileName)) {
_mapView->showPOI(true);
_showPOIAction->setChecked(true);
QAction *action = createPOIFileAction(fileName);
action->setChecked(true);
_poiFilesMenu->addAction(action);
return true;
} else {
QString error = tr("Error loading POI file:") + "\n\n"
+ fileName + "\n\n" + _poi->errorString();
if (_poi->errorLine())
@ -846,14 +845,6 @@ bool GUI::openPOIFile(const QString &fileName)
QMessageBox::critical(this, APP_NAME, error);
return false;
} else {
_mapView->showPOI(true);
_showPOIAction->setChecked(true);
QAction *action = createPOIFileAction(_poi->files().indexOf(fileName));
action->setChecked(true);
_poiFilesMenu->addAction(action);
return true;
}
}
@ -931,6 +922,11 @@ void GUI::openOptions()
if (options.enableHTTP2 != _options.enableHTTP2)
Downloader::enableHTTP2(options.enableHTTP2);
#endif // ENABLE_HTTP2
#ifdef ENABLE_HIDPI
if (options.hidpiMap != _options.hidpiMap)
_mapView->setDevicePixelRatio(devicePixelRatioF(),
options.hidpiMap ? devicePixelRatioF() : 1.0);
#endif // ENABLE_HIDPI
if (reload)
reloadFile();
@ -971,6 +967,8 @@ void GUI::exportFile()
void GUI::statistics()
{
QLocale l(QLocale::system());
#ifdef Q_OS_WIN32
QString text = "<style>td {white-space: pre; padding-right: 4em;}"
"th {text-align: left; padding-top: 0.5em;}</style><table>";
@ -981,21 +979,21 @@ void GUI::statistics()
if (_showTracksAction->isChecked() && _trackCount > 1)
text.append("<tr><td>" + tr("Tracks") + ":</td><td>"
+ QString::number(_trackCount) + "</td></tr>");
+ l.toString(_trackCount) + "</td></tr>");
if (_showRoutesAction->isChecked() && _routeCount > 1)
text.append("<tr><td>" + tr("Routes") + ":</td><td>"
+ QString::number(_routeCount) + "</td></tr>");
+ l.toString(_routeCount) + "</td></tr>");
if (_showWaypointsAction->isChecked() && _waypointCount > 1)
text.append("<tr><td>" + tr("Waypoints") + ":</td><td>"
+ QString::number(_waypointCount) + "</td></tr>");
+ l.toString(_waypointCount) + "</td></tr>");
if (_dateRange.first.isValid()) {
if (_dateRange.first == _dateRange.second) {
QString format = QLocale::system().dateFormat(QLocale::LongFormat);
QString format = l.dateFormat(QLocale::LongFormat);
text.append("<tr><td>" + tr("Date") + ":</td><td>"
+ _dateRange.first.toString(format) + "</td></tr>");
} else {
QString format = QLocale::system().dateFormat(QLocale::ShortFormat);
QString format = l.dateFormat(QLocale::ShortFormat);
text.append("<tr><td>" + tr("Date") + ":</td><td>"
+ QString("%1 - %2").arg(_dateRange.first.toString(format),
_dateRange.second.toString(format)) + "</td></tr>");
@ -1037,6 +1035,7 @@ void GUI::statistics()
void GUI::plot(QPrinter *printer)
{
QLocale l(QLocale::system());
QPainter p(printer);
TrackInfo info;
qreal ih, gh, mh, ratio;
@ -1047,19 +1046,19 @@ void GUI::plot(QPrinter *printer)
if (_options.printItemCount) {
if (_showTracksAction->isChecked() && _trackCount > 1)
info.insert(tr("Tracks"), QString::number(_trackCount));
info.insert(tr("Tracks"), l.toString(_trackCount));
if (_showRoutesAction->isChecked() && _routeCount > 1)
info.insert(tr("Routes"), QString::number(_routeCount));
info.insert(tr("Routes"), l.toString(_routeCount));
if (_showWaypointsAction->isChecked() && _waypointCount > 1)
info.insert(tr("Waypoints"), QString::number(_waypointCount));
info.insert(tr("Waypoints"), l.toString(_waypointCount));
}
if (_dateRange.first.isValid() && _options.printDate) {
if (_dateRange.first == _dateRange.second) {
QString format = QLocale::system().dateFormat(QLocale::LongFormat);
QString format = l.dateFormat(QLocale::LongFormat);
info.insert(tr("Date"), _dateRange.first.toString(format));
} else {
QString format = QLocale::system().dateFormat(QLocale::ShortFormat);
QString format = l.dateFormat(QLocale::ShortFormat);
info.insert(tr("Date"), QString("%1 - %2")
.arg(_dateRange.first.toString(format),
_dateRange.second.toString(format)));
@ -1286,18 +1285,11 @@ bool GUI::loadMap(const QString &fileName)
return false;
if (_ml->loadFile(fileName)) {
QAction *a = new QAction(_ml->maps().last()->name(), this);
a->setMenuRole(QAction::NoRole);
a->setCheckable(true);
a->setActionGroup(_mapsActionGroup);
_mapsSignalMapper->setMapping(a, _ml->maps().size() - 1);
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
_mapActions.append(a);
QAction *a = createMapAction(_ml->maps().last());
_mapMenu->insertAction(_mapsEnd, a);
_showMapAction->setEnabled(true);
_clearMapCacheAction->setEnabled(true);
_mapActions.last()->trigger();
a->trigger();
return true;
} else {
QString error = tr("Error loading map:") + "\n\n"
@ -1610,7 +1602,7 @@ void GUI::dropEvent(QDropEvent *event)
void GUI::writeSettings()
{
QSettings settings(APP_NAME, APP_NAME);
QSettings settings(qApp->applicationName(), qApp->applicationName());
settings.clear();
settings.beginGroup(WINDOW_SETTINGS_GROUP);
@ -1795,13 +1787,17 @@ void GUI::writeSettings()
settings.setValue(SLIDER_COLOR_SETTING, _options.sliderColor);
if (_options.alwaysShowMap != ALWAYS_SHOW_MAP_DEFAULT)
settings.setValue(ALWAYS_SHOW_MAP_SETTING, _options.alwaysShowMap);
#ifdef ENABLE_HIDPI
if (_options.hidpiMap != HIDPI_MAP_DEFAULT)
settings.setValue(HIDPI_MAP_SETTING, _options.hidpiMap);
#endif // ENABLE_HIDPI
settings.endGroup();
}
void GUI::readSettings()
{
int value;
QSettings settings(APP_NAME, APP_NAME);
QSettings settings(qApp->applicationName(), qApp->applicationName());
settings.beginGroup(WINDOW_SETTINGS_GROUP);
resize(settings.value(WINDOW_SIZE_SETTING, WINDOW_SIZE_DEFAULT).toSize());
@ -2030,6 +2026,10 @@ void GUI::readSettings()
SLIDER_COLOR_DEFAULT).value<QColor>();
_options.alwaysShowMap = settings.value(ALWAYS_SHOW_MAP_SETTING,
ALWAYS_SHOW_MAP_DEFAULT).toBool();
#ifdef ENABLE_HIDPI
_options.hidpiMap = settings.value(HIDPI_MAP_SETTING, HIDPI_MAP_SETTING)
.toBool();
#endif // ENABLE_HIDPI
_mapView->setPalette(_options.palette);
_mapView->setMapOpacity(_options.mapOpacity);
@ -2046,6 +2046,10 @@ void GUI::readSettings()
_mapView->setMarkerColor(_options.sliderColor);
if (_options.useOpenGL)
_mapView->useOpenGL(true);
#ifdef ENABLE_HIDPI
_mapView->setDevicePixelRatio(devicePixelRatioF(),
_options.hidpiMap ? devicePixelRatioF() : 1.0);
#endif // ENABLE_HIDPI
for (int i = 0; i < _tabs.count(); i++) {
_tabs.at(i)->setPalette(_options.palette);
@ -2070,10 +2074,6 @@ void GUI::readSettings()
_poi->setRadius(_options.poiRadius);
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
Downloader::setTimeout(_options.connectionTimeout);
#ifdef ENABLE_HTTP2
Downloader::enableHTTP2(_options.enableHTTP2);
#endif // ENABLE_HTTP2
settings.endGroup();
}
@ -2131,7 +2131,8 @@ void GUI::show()
void GUI::screenChanged(QScreen *screen)
{
#ifdef ENABLE_HIDPI
_mapView->updateDevicePixelRatio();
_mapView->setDevicePixelRatio(devicePixelRatioF(),
_options.hidpiMap ? devicePixelRatioF() : 1.0);
disconnect(SIGNAL(logicalDotsPerInchChanged(qreal)), this,
SLOT(logicalDotsPerInchChanged(qreal)));
@ -2147,6 +2148,7 @@ void GUI::logicalDotsPerInchChanged(qreal dpi)
Q_UNUSED(dpi)
#ifdef ENABLE_HIDPI
_mapView->updateDevicePixelRatio();
_mapView->setDevicePixelRatio(devicePixelRatioF(),
_options.hidpiMap ? devicePixelRatioF() : 1.0);
#endif // ENBLE_HIDPI
}

View File

@ -96,7 +96,8 @@ private:
void closeFiles();
void plot(QPrinter *printer);
QAction *createPOIFileAction(int index);
QAction *createPOIFileAction(const QString &fileName);
QAction *createMapAction(const Map *map);
void createPOIFilesActions();
void createMapActions();
void createActions();

View File

@ -1,3 +1,4 @@
#include <QLocale>
#include "data/data.h"
#include "heartrategraphitem.h"
#include "heartrategraph.h"
@ -7,7 +8,7 @@ HeartRateGraph::HeartRateGraph(QWidget *parent) : GraphTab(parent)
{
_showTracks = true;
GraphView::setYUnits(tr("1/min"));
GraphView::setYUnits(tr("bpm"));
setYLabel(tr("Heart rate"));
setSliderPrecision(0);
@ -16,9 +17,11 @@ HeartRateGraph::HeartRateGraph(QWidget *parent) : GraphTab(parent)
void HeartRateGraph::setInfo()
{
if (_showTracks) {
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale(), 'f',
QLocale l(QLocale::system());
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale(), 'f',
0) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale(), 'f',
0) + UNIT_SPACE + yUnits());
} else
clearInfo();

View File

@ -1,13 +1,20 @@
#include <QLocale>
#include "tooltip.h"
#include "heartrategraphitem.h"
HeartRateGraphItem::HeartRateGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
qreal sum = 0;
_max = graph.first().y();
for (int j = 1; j < graph.size(); j++)
sum += graph.at(j).y() * (graph.at(j).s() - graph.at(j-1).s());
for (int i = 1; i < graph.size(); i++) {
qreal y = graph.at(i).y();
sum += y * (graph.at(i).s() - graph.at(i-1).s());
if (y > _max)
_max = y;
}
_avg = sum/graph.last().s();
setToolTip(toolTip());
@ -16,11 +23,12 @@ HeartRateGraphItem::HeartRateGraphItem(const Graph &graph, GraphType type,
QString HeartRateGraphItem::toolTip() const
{
ToolTip tt;
QLocale l(QLocale::system());
tt.insert(tr("Maximum"), QString::number(max(), 'f', 0)
+ UNIT_SPACE + tr("1/min"));
tt.insert(tr("Average"), QString::number(avg(), 'f', 0)
+ UNIT_SPACE + tr("1/min"));
tt.insert(tr("Maximum"), l.toString(max(), 'f', 0)
+ UNIT_SPACE + tr("bpm"));
tt.insert(tr("Average"), l.toString(avg(), 'f', 0)
+ UNIT_SPACE + tr("bpm"));
return tt.toString();
}

View File

@ -11,13 +11,13 @@ public:
HeartRateGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent = 0);
qreal max() const {return -bounds().top();}
qreal max() const {return _max;}
qreal avg() const {return _avg;}
private:
QString toolTip() const;
qreal _avg;
qreal _avg, _max;
};
#endif // HEARTRATEGRAPHITEM_H

View File

@ -25,5 +25,6 @@
#define SYSTEM_ICON ":/icons/preferences-system.png"
#define PRINT_EXPORT_ICON ":/icons/document-print_32.png"
#define DATA_ICON ":/icons/view-filter.png"
#define MAPS_ICON ":/icons/applications-internet_32.png"
#endif /* ICONS_H */

View File

@ -1,6 +1,6 @@
#include <QFont>
#include <QPainter>
#include "config.h"
#include "font.h"
#include "infoitem.h"
#define PADDING 10

View File

@ -3,7 +3,7 @@
#include <QGraphicsItem>
#include <QList>
#include "kv.h"
#include "common/kv.h"
class InfoItem : public QGraphicsItem
{

View File

@ -18,9 +18,10 @@
#define MAX_DIGITAL_ZOOM 2
#define MIN_DIGITAL_ZOOM -3
#define MARGIN 10.0
#define MARGIN 10
#define SCALE_OFFSET 7
MapView::MapView(Map *map, POI *poi, QWidget *parent)
: QGraphicsView(parent)
{
@ -41,10 +42,6 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
_scene->addItem(_mapScale);
_map = map;
#ifdef ENABLE_HIDPI
_ratio = devicePixelRatioF();
_map->setDevicePixelRatio(_ratio);
#endif // ENABLE_HIDPI
_map->load();
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
@ -75,6 +72,11 @@ MapView::MapView(Map *map, POI *poi, QWidget *parent)
_poiSize = 8;
_poiColor = Qt::black;
#ifdef ENABLE_HIDPI
_deviceRatio = 1.0;
_mapRatio = 1.0;
#endif // ENABLE_HIDPI
_opengl = false;
_plot = false;
_digitalZoom = 0;
@ -268,10 +270,10 @@ void MapView::setMap(Map *map)
disconnect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
_map = map;
#ifdef ENABLE_HIDPI
_map->setDevicePixelRatio(_ratio);
#endif // ENABLE_HIDPI
_map->load();
#ifdef ENABLE_HIDPI
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
#endif // ENABLE_HIDPI
connect(_map, SIGNAL(loaded()), this, SLOT(reloadMap()));
digitalZoom(0);
@ -438,10 +440,10 @@ void MapView::zoom(int zoom, const QPoint &pos)
digitalZoom(zoom);
} else {
Coordinates c = _map->xy2ll(mapToScene(pos));
qreal os = _map->zoom();
qreal ns = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
int oz = _map->zoom();
int nz = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
if (ns != os) {
if (nz != oz) {
rescale();
centerOn(_map->ll2xy(c) - (pos - viewport()->rect().center()));
} else {
@ -505,7 +507,7 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
setUpdatesEnabled(false);
_plot = true;
#ifdef ENABLE_HIDPI
_map->setDevicePixelRatio(1.0);
_map->setDevicePixelRatio(_deviceRatio, 1.0);
#endif // ENABLE_HIDPI
// Compute sizes & ratios
@ -566,7 +568,7 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
// Exit plot mode
#ifdef ENABLE_HIDPI
_map->setDevicePixelRatio(_ratio);
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
#endif // ENABLE_HIDPI
_plot = false;
setUpdatesEnabled(true);
@ -765,9 +767,17 @@ void MapView::drawBackground(QPainter *painter, const QRectF &rect)
if (_showMap) {
QRectF ir = rect.intersected(_map->bounds());
Map::Flags flags = Map::NoFlags;
if (_opacity < 1.0)
painter->setOpacity(_opacity);
_map->draw(painter, ir, _plot);
if (_plot)
flags = Map::Block;
else if (_opengl)
flags = Map::OpenGL;
_map->draw(painter, ir, flags);
}
}
@ -808,6 +818,8 @@ void MapView::scrollContentsBy(int dx, int dy)
void MapView::useOpenGL(bool use)
{
_opengl = use;
if (use)
setViewport(new OPENGL_WIDGET);
else
@ -834,23 +846,21 @@ void MapView::reloadMap()
_scene->invalidate();
}
void MapView::updateDevicePixelRatio()
void MapView::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
{
#ifdef ENABLE_HIDPI
if (_ratio == devicePixelRatioF())
if (_deviceRatio == deviceRatio && _mapRatio == mapRatio)
return;
_ratio = devicePixelRatioF();
_deviceRatio = deviceRatio;
_mapRatio = mapRatio;
QPixmapCache::clear();
QRectF vr(mapToScene(viewport()->rect()).boundingRect()
.intersected(_map->bounds()));
RectC cr(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
_map->setDevicePixelRatio(_ratio);
digitalZoom(0);
_map->zoomFit(viewport()->rect().size(), cr);
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
_scene->setSceneRect(_map->bounds());
for (int i = 0; i < _tracks.size(); i++)
@ -870,5 +880,8 @@ void MapView::updateDevicePixelRatio()
centerOn(nc);
reloadMap();
#else // ENABLE_HIDPI
Q_UNUSED(deviceRatio);
Q_UNUSED(mapRatio);
#endif // ENABLE_HIDPI
}

View File

@ -6,12 +6,12 @@
#include <QHash>
#include <QList>
#include "common/rectc.h"
#include "common/config.h"
#include "data/waypoint.h"
#include "searchpointer.h"
#include "units.h"
#include "format.h"
#include "palette.h"
#include "config.h"
class Data;
class POI;
@ -69,7 +69,7 @@ public slots:
void showRouteWaypoints(bool show);
void clearMapCache();
void setCoordinatesFormat(CoordinatesFormat format);
void updateDevicePixelRatio();
void setDevicePixelRatio(qreal deviceRatio, qreal mapRatio);
private slots:
void updatePOI();
@ -140,8 +140,10 @@ private:
bool _plot;
#ifdef ENABLE_HIDPI
qreal _ratio;
qreal _deviceRatio;
qreal _mapRatio;
#endif // ENABLE_HIDPI
bool _opengl;
};
#endif // MAPVIEW_H

View File

@ -1,6 +0,0 @@
#ifndef MISC_H
#define MISC_H
double niceNum(double x, int round);
#endif // MISC_H

View File

@ -34,26 +34,61 @@ static QFrame *line()
}
#endif
QWidget *OptionsDialog::createGeneralPage()
QWidget *OptionsDialog::createMapPage()
{
_alwaysShowMap = new QCheckBox(tr("Always show the map"));
_alwaysShowMap->setChecked(_options->alwaysShowMap);
_alwaysShowMap->setToolTip("<p>" +
tr("Show the map even when no files are loaded.") + "</p>");
#ifdef ENABLE_HIDPI
_hidpi = new QRadioButton(tr("High-resolution"));
_lodpi = new QRadioButton(tr("Standard"));
if (_options->hidpiMap)
_hidpi->setChecked(true);
else
_lodpi->setChecked(true);
QLabel *lhi = new QLabel(tr("Non-HiDPI maps are loaded as HiDPI maps. "
"The map is sharp but map objects are small/hard to read."));
QLabel *llo = new QLabel(tr("Non-HiDPI maps are loaded such as they are. "
"Map objects have the expected size but the map is blurry."));
QFont f = lhi->font();
f.setPointSize(f.pointSize() - 1);
lhi->setWordWrap(true);
llo->setWordWrap(true);
lhi->setFont(f);
llo->setFont(f);
#endif // ENABLE_HIDPI
QFormLayout *showMapLayout = new QFormLayout();
showMapLayout->addWidget(_alwaysShowMap);
QWidget *generalTab = new QWidget();
QVBoxLayout *generalTabLayout = new QVBoxLayout();
generalTabLayout->addLayout(showMapLayout);
generalTabLayout->addStretch();
generalTab->setLayout(generalTabLayout);
QWidget *mapTab = new QWidget();
QVBoxLayout *mapTabLayout = new QVBoxLayout();
mapTabLayout->addLayout(showMapLayout);
mapTabLayout->addStretch();
mapTab->setLayout(mapTabLayout);
QTabWidget *generalPage = new QTabWidget();
generalPage->addTab(generalTab, tr("General"));
#ifdef ENABLE_HIDPI
QVBoxLayout *hidpiTabLayout = new QVBoxLayout();
hidpiTabLayout->addWidget(_lodpi);
hidpiTabLayout->addWidget(llo);
hidpiTabLayout->addSpacing(10);
hidpiTabLayout->addWidget(_hidpi);
hidpiTabLayout->addWidget(lhi);
hidpiTabLayout->addStretch();
return generalPage;
QWidget *hidpiTab = new QWidget();
hidpiTab->setLayout(hidpiTabLayout);
#endif // ENABLE_HIDPI
QTabWidget *mapPage = new QTabWidget();
mapPage->addTab(mapTab, tr("General"));
#ifdef ENABLE_HIDPI
mapPage->addTab(hidpiTab, tr("HiDPI display mode"));
#endif // ENABLE_HIDPI
return mapPage;
}
QWidget *OptionsDialog::createAppearancePage()
@ -483,8 +518,8 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
: QDialog(parent), _options(options)
{
QStackedWidget *pages = new QStackedWidget();
pages->addWidget(createGeneralPage());
pages->addWidget(createAppearancePage());
pages->addWidget(createMapPage());
pages->addWidget(createDataPage());
pages->addWidget(createPOIPage());
pages->addWidget(createExportPage());
@ -492,9 +527,9 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
QListWidget *menu = new QListWidget();
menu->setIconSize(QSize(MENU_ICON_SIZE, MENU_ICON_SIZE));
new QListWidgetItem(QIcon(APP_ICON), tr("General"), menu);
new QListWidgetItem(QIcon(APPEARANCE_ICON), tr("Appearance"),
menu);
new QListWidgetItem(QIcon(MAPS_ICON), tr("Maps"), menu);
new QListWidgetItem(QIcon(DATA_ICON), tr("Data"), menu);
new QListWidgetItem(QIcon(POI_ICON), tr("POI"), menu);
new QListWidgetItem(QIcon(PRINT_EXPORT_ICON), tr("Print & Export"),
@ -532,8 +567,6 @@ OptionsDialog::OptionsDialog(Options *options, QWidget *parent)
void OptionsDialog::accept()
{
_options->alwaysShowMap = _alwaysShowMap->isChecked();
_options->palette.setColor(_baseColor->color());
_options->palette.setShift(_colorOffset->value());
_options->mapOpacity = _mapOpacity->value();
@ -553,6 +586,11 @@ void OptionsDialog::accept()
_options->sliderColor = _sliderColor->color();
_options->graphAntiAliasing = _graphAA->isChecked();
_options->alwaysShowMap = _alwaysShowMap->isChecked();
#ifdef ENABLE_HIDPI
_options->hidpiMap = _hidpi->isChecked();
#endif // ENABLE_HIDPI
_options->elevationFilter = _elevationFilter->value();
_options->speedFilter = _speedFilter->value();
_options->heartRateFilter = _heartRateFilter->value();

View File

@ -2,10 +2,9 @@
#define OPTIONSDIALOG_H
#include <QDialog>
#include "common/config.h"
#include "palette.h"
#include "units.h"
#include "config.h"
class ColorBox;
class StyleComboBox;
@ -18,8 +17,6 @@ class QRadioButton;
class PercentSlider;
struct Options {
// General
bool alwaysShowMap;
// Appearance
Palette palette;
int trackWidth;
@ -36,6 +33,11 @@ struct Options {
bool graphAntiAliasing;
int mapOpacity;
QColor backgroundColor;
// Map
bool alwaysShowMap;
#ifdef ENABLE_HIDPI
bool hidpiMap;
#endif // ENABLE_HIDPI
// Data
int elevationFilter;
int speedFilter;
@ -79,7 +81,7 @@ public slots:
void accept();
private:
QWidget *createGeneralPage();
QWidget *createMapPage();
QWidget *createAppearancePage();
QWidget *createDataPage();
QWidget *createPOIPage();
@ -88,8 +90,6 @@ private:
Options *_options;
// General
QCheckBox *_alwaysShowMap;
// Appearance
ColorBox *_baseColor;
QDoubleSpinBox *_colorOffset;
@ -107,6 +107,12 @@ private:
QSpinBox *_graphWidth;
ColorBox *_sliderColor;
QCheckBox *_graphAA;
// Map
QCheckBox *_alwaysShowMap;
#ifdef ENABLE_HIDPI
QRadioButton *_hidpi;
QRadioButton *_lodpi;
#endif // ENABLE_HIDPI
// Data
OddSpinBox *_elevationFilter;
OddSpinBox *_speedFilter;

View File

@ -1,13 +1,18 @@
#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"
#define GEOGRAPHICAL_MILE 1855.3248
static unsigned segments(qreal distance)
{
return ceil(distance / GEOGRAPHICAL_MILE);
}
PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
: QGraphicsObject(parent)
{
@ -21,7 +26,7 @@ PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
QBrush brush(Qt::SolidPattern);
_pen = QPen(brush, _width);
updatePainterPath(map);
updatePainterPath();
updateShape();
_marker = new MarkerItem(this);
@ -39,13 +44,54 @@ void PathItem::updateShape()
_shape = s.createStroke(_painterPath);
}
void PathItem::updatePainterPath(Map *map)
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) {
QLineF l(QPointF(c1.lon(), c1.lat()), QPointF(c2.lon() + 360,
c2.lat()));
QLineF dl(QPointF(180, -90), QPointF(180, 90));
l.intersect(dl, &p);
_painterPath.lineTo(_map->ll2xy(Coordinates(180, p.y())));
_painterPath.moveTo(_map->ll2xy(Coordinates(-180, p.y())));
} else {
QLineF l(QPointF(c1.lon(), c1.lat()), QPointF(c2.lon() - 360,
c2.lat()));
QLineF dl(QPointF(-180, -90), QPointF(-180, 90));
l.intersect(dl, &p);
_painterPath.lineTo(_map->ll2xy(Coordinates(-180, p.y())));
_painterPath.moveTo(_map->ll2xy(Coordinates(180, p.y())));
}
_painterPath.lineTo(_map->ll2xy(c2));
} else
_painterPath.lineTo(_map->ll2xy(c2));
}
void PathItem::updatePainterPath()
{
_painterPath = QPainterPath();
_painterPath.moveTo(map->ll2xy(_path.first().coordinates()));
for (int i = 1; i < _path.size(); i++)
_painterPath.lineTo(map->ll2xy(_path.at(i).coordinates()));
_painterPath.moveTo(_map->ll2xy(_path.first().coordinates()));
for (int i = 1; i < _path.size(); i++) {
const PathPoint &p1 = _path.at(i-1);
const PathPoint &p2 = _path.at(i);
unsigned n = segments(p2.distance() - p1.distance());
if (n > 1) {
GreatCircle gc(p1.coordinates(), p2.coordinates());
Coordinates last = p1.coordinates();
for (unsigned j = 1; j <= n; j++) {
Coordinates c(gc.pointAt(j/(double)n));
addSegment(last, c);
last = c;
}
} else
addSegment(p1.coordinates(), p2.coordinates());
}
}
void PathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
@ -70,7 +116,7 @@ void PathItem::setMap(Map *map)
_map = map;
updatePainterPath(map);
updatePainterPath();
updateShape();
_marker->setPos(position(_markerDistance));
@ -141,19 +187,40 @@ QPointF PathItem::position(qreal x) const
return _map->ll2xy(_path.at(mid).coordinates());
}
QLineF l;
Coordinates c1, c2;
qreal p1, p2;
if (_path.at(mid).distance() < x) {
l = QLineF(_map->ll2xy(_path.at(mid).coordinates()),
_map->ll2xy(_path.at(mid+1).coordinates()));
c1 = _path.at(mid).coordinates(); c2 = _path.at(mid+1).coordinates();
p1 = _path.at(mid).distance(); p2 = _path.at(mid+1).distance();
} else {
l = QLineF(_map->ll2xy(_path.at(mid-1).coordinates()),
_map->ll2xy(_path.at(mid).coordinates()));
c1 = _path.at(mid-1).coordinates(); c2 = _path.at(mid).coordinates();
p1 = _path.at(mid-1).distance(); p2 = _path.at(mid).distance();
}
return l.pointAt((x - p1) / (p2 - p1));
unsigned n = segments(p2 - p1);
if (n > 1) {
GreatCircle gc(c1, c2);
// Great circle point
double f = (x - p1) / (p2 - p1);
QPointF p(_map->ll2xy(gc.pointAt(f)));
// Segment line of the great circle path
double f1 = floor(n * f) / n;
double f2 = ceil(n * f) / n;
QLineF l(_map->ll2xy(gc.pointAt(f1)), _map->ll2xy(gc.pointAt(f2)));
// Project the great circle point to the segment line
QLineF u = l.unitVector();
double lambda = (u.dx() * (p.x() - l.p1().x())) + (u.dy() * (p.y()
- l.p1().y()));
return QPointF((u.dx() * lambda) + l.p1().x(), (u.dy() * lambda)
+ l.p1().y());
} else {
QLineF l(_map->ll2xy(c1), _map->ll2xy(c2));
return l.pointAt((x - p1) / (p2 - p1));
}
}
void PathItem::moveMarker(qreal distance)

View File

@ -43,8 +43,10 @@ protected:
private:
QPointF position(qreal distance) const;
void updatePainterPath(Map *map);
void updatePainterPath();
void updateShape();
void addSegment(const Coordinates &c1, const Coordinates &c2);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);

View File

@ -1,13 +1,14 @@
#include <QSlider>
#include <QLabel>
#include <QHBoxLayout>
#include <QLocale>
#include "units.h"
#include "percentslider.h"
static QString format(int value)
{
return QString::number(value) + UNIT_SPACE + QString("%");
return QLocale::system().toString(value) + UNIT_SPACE + QString("%");
}
PercentSlider::PercentSlider(QWidget *parent) : QWidget(parent)

View File

@ -1,3 +1,4 @@
#include <QLocale>
#include "data/data.h"
#include "powergraphitem.h"
#include "powergraph.h"
@ -16,9 +17,11 @@ PowerGraph::PowerGraph(QWidget *parent) : GraphTab(parent)
void PowerGraph::setInfo()
{
if (_showTracks) {
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale()
QLocale l(QLocale::system());
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale()
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
} else
clearInfo();

View File

@ -1,13 +1,20 @@
#include <QLocale>
#include "tooltip.h"
#include "powergraphitem.h"
PowerGraphItem::PowerGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
qreal sum = 0;
_max = graph.first().y();
for (int j = 1; j < graph.size(); j++)
sum += graph.at(j).y() * (graph.at(j).s() - graph.at(j-1).s());
for (int i = 1; i < graph.size(); i++) {
qreal y = graph.at(i).y();
sum += y * (graph.at(i).s() - graph.at(i-1).s());
if (y > _max)
_max = y;
}
_avg = sum/graph.last().s();
setToolTip(toolTip());
@ -16,11 +23,12 @@ PowerGraphItem::PowerGraphItem(const Graph &graph, GraphType type,
QString PowerGraphItem::toolTip() const
{
ToolTip tt;
QLocale l(QLocale::system());
tt.insert(tr("Maximum"), QString::number(max(), 'f', 1)
+ UNIT_SPACE + tr("1/min"));
tt.insert(tr("Average"), QString::number(avg(), 'f', 1)
+ UNIT_SPACE + tr("1/min"));
tt.insert(tr("Maximum"), l.toString(max(), 'f', 1)
+ UNIT_SPACE + tr("W"));
tt.insert(tr("Average"), l.toString(avg(), 'f', 1)
+ UNIT_SPACE + tr("W"));
return tt.toString();
}

View File

@ -11,13 +11,13 @@ public:
PowerGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent = 0);
qreal max() const {return -bounds().top();}
qreal max() const {return _max;}
qreal avg() const {return _avg;}
private:
QString toolTip() const;
qreal _avg;
qreal _avg, _max;
};
#endif // POWERGRAPHITEM_H

View File

@ -1,12 +1,13 @@
#include <cmath>
#include <QApplication>
#include <QPainter>
#include "config.h"
#include "nicenum.h"
#include "common/util.h"
#include "font.h"
#include "scaleitem.h"
#define BORDER_WIDTH 1
#define SCALE_WIDTH 132
#define SCALE_WIDTH 135
#define SCALE_HEIGHT 5
#define SEGMENTS 3
#define PADDING 4

View File

@ -156,5 +156,7 @@
#define SLIDER_COLOR_DEFAULT QColor(Qt::red)
#define ALWAYS_SHOW_MAP_SETTING "alwaysShowMap"
#define ALWAYS_SHOW_MAP_DEFAULT true
#define HIDPI_MAP_SETTING "HiDPIMap"
#define HIDPI_MAP_DEFAULT true
#endif // SETTINGS_H

View File

@ -1,5 +1,5 @@
#include <QPainter>
#include "config.h"
#include "font.h"
#include "sliderinfoitem.h"

View File

@ -1,5 +1,5 @@
#include <QLocale>
#include "data/data.h"
#include "config.h"
#include "tooltip.h"
#include "format.h"
#include "speedgraphitem.h"
@ -21,13 +21,14 @@ SpeedGraph::SpeedGraph(QWidget *parent) : GraphTab(parent)
void SpeedGraph::setInfo()
{
if (_showTracks) {
QLocale l(QLocale::system());
QString pace = Format::timeSpan((3600.0 / (avg() * yScale())), false);
QString pu = (_units == Metric) ? tr("min/km") : (_units == Imperial) ?
tr("min/mi") : tr("min/nmi");
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale(), 'f',
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale(), 'f',
1) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale(), 'f',
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale(), 'f',
1) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Pace"), pace + UNIT_SPACE + pu);
} else

View File

@ -1,7 +1,9 @@
#include <QLocale>
#include "tooltip.h"
#include "format.h"
#include "speedgraphitem.h"
SpeedGraphItem::SpeedGraphItem(const Graph &graph, GraphType type,
qreal movingTime, QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
@ -11,6 +13,13 @@ SpeedGraphItem::SpeedGraphItem(const Graph &graph, GraphType type,
_avg = graph.last().s() / graph.last().t();
_mavg = graph.last().s() / movingTime;
_max = graph.first().y();
for (int i = 1; i < graph.size(); i++) {
qreal y = graph.at(i).y();
if (y > _max)
_max = y;
}
setToolTip(toolTip());
}
@ -25,10 +34,11 @@ QString SpeedGraphItem::toolTip() const
? avg() * scale : mavg() * scale)), false);
QString pu = (_units == Metric) ? tr("min/km") : (_units == Imperial) ?
tr("min/mi") : tr("min/nmi");
QLocale l(QLocale::system());
tt.insert(tr("Maximum"), QString::number(max() * scale, 'f', 1)
tt.insert(tr("Maximum"), l.toString(max() * scale, 'f', 1)
+ UNIT_SPACE + su);
tt.insert(tr("Average"), QString::number((_timeType == Total)
tt.insert(tr("Average"), l.toString((_timeType == Total)
? avg() * scale : mavg() * scale, 'f', 1) + UNIT_SPACE + su);
tt.insert(tr("Pace"), pace + UNIT_SPACE + pu);

View File

@ -12,7 +12,7 @@ public:
SpeedGraphItem(const Graph &graph, GraphType type, qreal movingTime,
QGraphicsItem *parent = 0);
qreal max() const {return -bounds().top();}
qreal max() const {return _max;}
qreal avg() const {return _avg;}
qreal mavg() const {return _mavg;}
@ -22,7 +22,7 @@ public:
private:
QString toolTip() const;
qreal _avg, _mavg;
qreal _avg, _mavg, _max;
Units _units;
TimeType _timeType;

View File

@ -1,3 +1,4 @@
#include <QLocale>
#include "data/data.h"
#include "temperaturegraphitem.h"
#include "temperaturegraph.h"
@ -16,11 +17,13 @@ TemperatureGraph::TemperatureGraph(QWidget *parent) : GraphTab(parent)
void TemperatureGraph::setInfo()
{
if (_showTracks) {
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale()
QLocale l(QLocale::system());
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Minimum"), QString::number(min() * yScale()
GraphView::addInfo(tr("Minimum"), l.toString(min() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale()
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
} else
clearInfo();

View File

@ -1,13 +1,24 @@
#include <QLocale>
#include "tooltip.h"
#include "temperaturegraphitem.h"
TemperatureGraphItem::TemperatureGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
qreal sum = 0;
_min = _max = graph.first().y();
for (int j = 1; j < graph.size(); j++) {
qreal y = graph.at(j).y();
for (int j = 1; j < graph.size(); j++)
sum += graph.at(j).y() * (graph.at(j).s() - graph.at(j-1).s());
if (y > _max)
_max = y;
if (y < _min)
_min = y;
}
_avg = sum/graph.last().s();
setToolTip(toolTip(Metric));
@ -20,12 +31,13 @@ QString TemperatureGraphItem::toolTip(Units units) const
qreal offset = (units == Metric) ? 0 : C2FO;
QString su = (units == Metric) ?
QChar(0x00B0) + tr("C") : QChar(0x00B0) + tr("F");
QLocale l(QLocale::system());
tt.insert(tr("Average"), QString::number(avg() * scale + offset, 'f', 1)
tt.insert(tr("Average"), l.toString(avg() * scale + offset, 'f', 1)
+ UNIT_SPACE + su);
tt.insert(tr("Maximum"), QString::number(max() * scale + offset, 'f', 1)
tt.insert(tr("Maximum"), l.toString(max() * scale + offset, 'f', 1)
+ UNIT_SPACE + su);
tt.insert(tr("Minimum"), QString::number(min() * scale + offset, 'f', 1)
tt.insert(tr("Minimum"), l.toString(min() * scale + offset, 'f', 1)
+ UNIT_SPACE + su);
return tt.toString();

View File

@ -11,8 +11,8 @@ public:
TemperatureGraphItem(const Graph &graph, GraphType type,
QGraphicsItem *parent = 0);
qreal max() const {return -bounds().top();}
qreal min() const {return -bounds().bottom();}
qreal max() const {return _max;}
qreal min() const {return _min;}
qreal avg() const {return _avg;}
void setUnits(Units units);
@ -20,7 +20,7 @@ public:
private:
QString toolTip(Units units) const;
qreal _avg;
qreal _avg, _min, _max;
};
#endif // TEMPERATUREGRAPHITEM_H

View File

@ -2,8 +2,7 @@
void ToolTip::insert(const QString &key, const QString &value)
{
QPair<QString, QString> entry(key, value);
_list.append(entry);
_list.append(KV(key, value));
}
QString ToolTip::toString()
@ -11,8 +10,8 @@ QString ToolTip::toString()
QString ret = "<table>";
for (int i = 0; i < _list.count(); i++)
ret += "<tr><td align=\"right\"><b>" + _list.at(i).first
+ ":&nbsp;</b></td><td>" + _list.at(i).second + "</td></tr>";
ret += "<tr><td align=\"right\"><b>" + _list.at(i).key()
+ ":&nbsp;</b></td><td>" + _list.at(i).value() + "</td></tr>";
ret += "</table>";

View File

@ -3,7 +3,7 @@
#include <QString>
#include <QList>
#include <QPair>
#include "common/kv.h"
class ToolTip
{
@ -12,7 +12,7 @@ public:
QString toString();
private:
QList<QPair<QString, QString> > _list;
QList<KV> _list;
};
#endif // TOOLTIP_H

View File

@ -1,6 +1,5 @@
#include <QPaintEngine>
#include <QPaintDevice>
#include "config.h"
#include "infoitem.h"
#include "trackinfo.h"

View File

@ -1,6 +1,6 @@
#include <QApplication>
#include <QPainter>
#include "config.h"
#include "font.h"
#include "tooltip.h"
#include "waypointitem.h"

17
src/common/config.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef CONFIG_H
#define CONFIG_H
#include <QtGlobal>
#define APP_NAME "GPXSee"
#define APP_HOMEPAGE "http://www.gpxsee.org"
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 1)
#define ENABLE_HTTP2
#endif // QT >= 5.10.1
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#define ENABLE_HIDPI
#endif // QT >= 5.6
#endif /* CONFIG_H */

View File

@ -32,6 +32,8 @@ private:
double _lat, _lon;
};
Q_DECLARE_TYPEINFO(Coordinates, Q_PRIMITIVE_TYPE);
inline bool operator==(const Coordinates &c1, const Coordinates &c2)
{return (c1.lat() == c2.lat() && c1.lon() == c2.lon());}
inline bool operator!=(const Coordinates &c1, const Coordinates &c2)

View File

@ -0,0 +1,34 @@
#include "greatcircle.h"
GreatCircle::GreatCircle(const Coordinates &c1, const Coordinates &c2)
{
double lat1 = deg2rad(c1.lat());
double lon1 = deg2rad(c1.lon());
double lat2 = deg2rad(c2.lat());
double lon2 = deg2rad(c2.lon());
double cosLat1 = cos(lat1);
double cosLat2 = cos(lat2);
_sinLat1 = sin(lat1);
_sinLat2 = sin(lat2);
_xA = cosLat1 * cos(lon1);
_xB = cosLat2 * cos(lon2);
_yA = cosLat1 * sin(lon1);
_yB = cosLat2 * sin(lon2);
_d = 2 * asin(sqrt(pow((sin((lat1 - lat2) / 2)), 2) + cosLat1 * cosLat2
* pow(sin((lon1 - lon2) / 2), 2)));
_sinD = sin(_d);
}
Coordinates GreatCircle::pointAt(double f) const
{
double A = sin((1.0 - f) * _d) / _sinD;
double B = sin(f * _d) / _sinD;
double x = A * _xA + B * _xB;
double y = A * _yA + B * _yB;
double z = A * _sinLat1 + B * _sinLat2;
return Coordinates(rad2deg(atan2(y, x)), rad2deg(atan2(z, sqrt(x*x + y*y))));
}

20
src/common/greatcircle.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef GREATCIRCLE_H
#define GREATCIRCLE_H
#include "coordinates.h"
class GreatCircle
{
public:
GreatCircle(const Coordinates &c1, const Coordinates &c2);
Coordinates pointAt(double f) const;
private:
double _xA, _xB, _yA, _yB;
double _d;
double _sinD;
double _sinLat1, _sinLat2;
};
#endif // GREATCIRCLE_H

174
src/common/programpaths.cpp Normal file
View File

@ -0,0 +1,174 @@
#include <QtGlobal>
#include <QDir>
#include "programpaths.h"
#define MAP_DIR "maps"
#define POI_DIR "POI"
#define CSV_DIR "csv"
#define TILES_DIR "tiles"
#define TRANSLATIONS_DIR "translations"
#define ELLIPSOID_FILE "ellipsoids.csv"
#define GCS_FILE "gcs.csv"
#define PCS_FILE "pcs.csv"
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
#include <QApplication>
#if defined(Q_OS_WIN32)
#define USER_DIR QDir::homePath() + QString("/AppData/Roaming/") \
+ qApp->applicationName()
#define GLOBAL_DIR QApplication::applicationDirPath()
#elif defined(Q_OS_MAC)
#define USER_DIR QDir::homePath() \
+ QString("/Library/Application Support/") \
+ qApp->applicationName()
#define GLOBAL_DIR QApplication::applicationDirPath() \
+ QString("/../Resources")
#else
#define USER_DIR QDir::homePath() + QString("/.local/share/") \
+ qApp->applicationName()
#define GLOBAL_DIR QString("/usr/share/") + qApp->applicationName()
#endif
static QString dir(const QString &dirName, bool writable = false)
{
QDir userDir(QDir(USER_DIR).filePath(dirName));
if (writable || userDir.exists())
return userDir.absolutePath();
else {
QDir globalDir(QDir(GLOBAL_DIR).filePath(dirName));
if (globalDir.exists())
return globalDir.absolutePath();
else
return QString();
}
}
static QString file(const QString &path, const QString &fileName)
{
if (path.isNull())
return QString();
QFileInfo fi(QDir(path).filePath(fileName));
return fi.exists() ? fi.absoluteFilePath() : QString();
}
QString ProgramPaths::mapDir(bool writable)
{
return dir(MAP_DIR, writable);
}
QString ProgramPaths::poiDir(bool writable)
{
return dir(POI_DIR, writable);
}
QString ProgramPaths::csvDir(bool writable)
{
return dir(CSV_DIR, writable);
}
QString ProgramPaths::tilesDir()
{
#if defined(Q_OS_WIN32)
return QDir::homePath() + QString("/AppData/Local/")
+ qApp->applicationName() + QString("/cache/") + QString(TILES_DIR);
#elif defined(Q_OS_MAC)
return QDir::homePath() + QString("/Library/Caches/")
+ qApp->applicationName() + QString("/" TILES_DIR);
#else
return QDir::homePath() + QString("/.cache/") + qApp->applicationName()
+ QString("/" TILES_DIR);
#endif
}
QString ProgramPaths::translationsDir()
{
return dir(TRANSLATIONS_DIR);
}
QString ProgramPaths::ellipsoidsFile()
{
return file(dir(CSV_DIR), ELLIPSOID_FILE);
}
QString ProgramPaths::gcsFile()
{
return file(dir(CSV_DIR), GCS_FILE);
}
QString ProgramPaths::pcsFile()
{
return file(dir(CSV_DIR), PCS_FILE);
}
#else // QT_VERSION < 5
#include <QStandardPaths>
QString ProgramPaths::mapDir(bool writable)
{
if (writable)
return QDir(QStandardPaths::writableLocation(
QStandardPaths::AppDataLocation)).filePath(MAP_DIR);
else
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
MAP_DIR, QStandardPaths::LocateDirectory);
}
QString ProgramPaths::poiDir(bool writable)
{
if (writable)
return QDir(QStandardPaths::writableLocation(
QStandardPaths::AppDataLocation)).filePath(POI_DIR);
else
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
POI_DIR, QStandardPaths::LocateDirectory);
}
QString ProgramPaths::csvDir(bool writable)
{
if (writable)
return QDir(QStandardPaths::writableLocation(
QStandardPaths::AppDataLocation)).filePath(CSV_DIR);
else
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
CSV_DIR, QStandardPaths::LocateDirectory);
}
QString ProgramPaths::tilesDir()
{
return QDir(QStandardPaths::writableLocation(
QStandardPaths::CacheLocation)).filePath(TILES_DIR);
}
QString ProgramPaths::translationsDir()
{
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
TRANSLATIONS_DIR, QStandardPaths::LocateDirectory);
}
QString ProgramPaths::ellipsoidsFile()
{
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
CSV_DIR "/" ELLIPSOID_FILE, QStandardPaths::LocateFile);
}
QString ProgramPaths::gcsFile()
{
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
CSV_DIR "/" GCS_FILE, QStandardPaths::LocateFile);
}
QString ProgramPaths::pcsFile()
{
return QStandardPaths::locate(QStandardPaths::AppDataLocation,
CSV_DIR "/" PCS_FILE, QStandardPaths::LocateFile);
}
#endif // QT_VERSION < 5

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

@ -0,0 +1,18 @@
#ifndef PROGRAMPATHS_H
#define PROGRAMPATHS_H
#include <QString>
namespace ProgramPaths
{
QString mapDir(bool writable = false);
QString poiDir(bool writable = false);
QString csvDir(bool writable = false);
QString tilesDir();
QString translationsDir();
QString ellipsoidsFile();
QString gcsFile();
QString pcsFile();
}
#endif // PROGRAMPATHS_H

View File

@ -8,7 +8,7 @@ class Range
{
public:
Range() {_min = 0; _max = 0;}
Range(int min, int max) {_min = min, _max = max;}
Range(int min, int max) : _min(min), _max(max) {}
int min() const {return _min;}
int max() const {return _max;}
@ -19,6 +19,8 @@ public:
void setMin(int min) {_min = min;}
void setMax(int max) {_max = max;}
bool contains(int val) const {return (val >= _min && val <= _max);}
private:
int _min, _max;
};
@ -27,7 +29,7 @@ class RangeF
{
public:
RangeF() {_min = 0; _max = 0;}
RangeF(qreal min, qreal max) {_min = min, _max = max;}
RangeF(qreal min, qreal max) : _min(min), _max(max) {}
RangeF operator&(const RangeF &r) const;
RangeF &operator&=(const RangeF &r) {*this = *this & r; return *this;}

View File

@ -23,6 +23,11 @@ public:
{return Coordinates((_tl.lon() + _br.lon()) / 2.0,
(_tl.lat() + _br.lat()) / 2.0);}
double top() const {return _tl.lat();}
double bottom() const {return _br.lat();}
double left() const {return _tl.lon();}
double right() const {return _br.lon();}
RectC operator|(const RectC &r) const;
RectC &operator|=(const RectC &r) {*this = *this | r; return *this;}
RectC operator&(const RectC &r) const;

View File

@ -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;
}

View File

@ -1,6 +0,0 @@
#ifndef MISC_H
#define MISC_H
int str2int(const char *str, int len);
#endif // MISC_H

View File

@ -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
View 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

View File

@ -1,58 +0,0 @@
#ifndef CONFIG_H
#define CONFIG_H
#include <QtGlobal>
#include <QDir>
#include <QApplication>
#include <QString>
#define APP_NAME "GPXSee"
#define APP_HOMEPAGE "http://www.gpxsee.org"
#define FONT_FAMILY "Arial"
#define FONT_SIZE 12 // px
#define MAP_DIR QString("maps")
#define POI_DIR QString("POI")
#define CSV_DIR QString("csv")
#define ELLIPSOID_FILE QString("ellipsoids.csv")
#define GCS_FILE QString("gcs.csv")
#define PCS_FILE QString("pcs.csv")
#if defined(Q_OS_WIN32)
#define USER_DIR QDir::homePath() + QString("/GPXSee")
#define GLOBAL_DIR QApplication::applicationDirPath()
#elif defined(Q_OS_MAC)
#define USER_DIR QDir::homePath() + QString("/.gpxsee")
#define GLOBAL_DIR QApplication::applicationDirPath() \
+ QString("/../Resources")
#else
#define USER_DIR QDir::homePath() + QString("/.gpxsee")
#define GLOBAL_DIR QString("/usr/share/gpxsee")
#endif
#define USER_CSV_DIR USER_DIR + QString("/") + CSV_DIR
#define USER_ELLIPSOID_FILE USER_CSV_DIR + QString("/") + ELLIPSOID_FILE
#define USER_GCS_FILE USER_CSV_DIR + QString("/") + GCS_FILE
#define USER_PCS_FILE USER_CSV_DIR + QString("/") + PCS_FILE
#define USER_MAP_DIR USER_DIR + QString("/") + MAP_DIR
#define USER_POI_DIR USER_DIR + QString("/") + POI_DIR
#define GLOBAL_CSV_DIR GLOBAL_DIR + QString("/") + CSV_DIR
#define GLOBAL_ELLIPSOID_FILE GLOBAL_CSV_DIR + QString("/") + ELLIPSOID_FILE
#define GLOBAL_GCS_FILE GLOBAL_CSV_DIR + QString("/") + GCS_FILE
#define GLOBAL_PCS_FILE GLOBAL_CSV_DIR + QString("/") + PCS_FILE
#define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR
#define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR
#define TILES_DIR USER_DIR + QString("/tiles")
#define TRANSLATIONS_DIR GLOBAL_DIR + QString("/translations")
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 1)
#define ENABLE_HTTP2
#endif // QT >= 5.10.1
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#define ENABLE_HIDPI
#endif // QT >= 5.6
#endif /* CONFIG_H */

View File

@ -18,16 +18,16 @@ bool CSVParser::parse(QFile *file, QList<TrackData> &tracks,
return false;
}
qreal lat = list[0].trimmed().toDouble(&res);
if (!res || (lat < -90.0 || lat > 90.0)) {
_errorString = "Invalid latitude";
return false;
}
qreal lon = list[1].trimmed().toDouble(&res);
qreal lon = list[0].trimmed().toDouble(&res);
if (!res || (lon < -180.0 || lon > 180.0)) {
_errorString = "Invalid longitude";
return false;
}
qreal lat = list[1].trimmed().toDouble(&res);
if (!res || (lat < -90.0 || lat > 90.0)) {
_errorString = "Invalid latitude";
return false;
}
Waypoint wp(Coordinates(lon, lat));
QByteArray ba = list[2].trimmed();

View File

@ -98,9 +98,9 @@ bool Data::loadFile(const QString &fileName)
file.reset();
}
qWarning("Error loading data file: %s:\n", qPrintable(fileName));
qWarning("Error loading data file: %s:", qPrintable(fileName));
for (it = _parsers.begin(); it != _parsers.end(); it++)
qWarning("%s: line %d: %s\n", qPrintable(it.key()),
qWarning("%s: line %d: %s", qPrintable(it.key()),
it.value()->errorLine(), qPrintable(it.value()->errorString()));
_errorLine = 0;

View File

@ -98,7 +98,7 @@ template<class T> bool FITParser::readValue(CTX &ctx, T &val)
return true;
}
bool FITParser::skipValue(CTX &ctx, size_t size)
bool FITParser::skipValue(CTX &ctx, quint8 size)
{
ctx.len -= size;
return ctx.file->seek(ctx.file->pos() + size);

View File

@ -20,7 +20,7 @@ private:
bool readData(QFile *file, char *data, size_t size);
template<class T> bool readValue(CTX &ctx, T &val);
bool skipValue(CTX &ctx, size_t size);
bool skipValue(CTX &ctx, quint8 size);
bool readField(CTX &ctx, Field *field, quint32 &val);
bool parseHeader(CTX &ctx);

View File

@ -54,7 +54,7 @@ Coordinates GPXParser::coordinates()
void GPXParser::rpExtension(TrackData *autoRoute)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "rpt")
if (_reader.name() == QLatin1String("rpt"))
autoRoute->append(Trackpoint(coordinates()));
_reader.skipCurrentElement();
}
@ -63,9 +63,9 @@ void GPXParser::rpExtension(TrackData *autoRoute)
void GPXParser::tpExtension(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "hr")
if (_reader.name() == QLatin1String("hr"))
trackpoint.setHeartRate(number());
else if (_reader.name() == "atemp")
else if (_reader.name() == QLatin1String("atemp"))
trackpoint.setTemperature(number());
else
_reader.skipCurrentElement();
@ -75,7 +75,7 @@ void GPXParser::tpExtension(Trackpoint &trackpoint)
void GPXParser::rteptExtensions(TrackData *autoRoute)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "RoutePointExtension")
if (_reader.name() == QLatin1String("RoutePointExtension"))
rpExtension(autoRoute);
else
_reader.skipCurrentElement();
@ -85,17 +85,18 @@ void GPXParser::rteptExtensions(TrackData *autoRoute)
void GPXParser::trkptExtensions(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "speed")
if (_reader.name() == QLatin1String("speed"))
trackpoint.setSpeed(number());
else if (_reader.name() == "hr" || _reader.name() == "heartrate")
else if (_reader.name() == QLatin1String("hr")
|| _reader.name() == QLatin1String("heartrate"))
trackpoint.setHeartRate(number());
else if (_reader.name() == "temp")
else if (_reader.name() == QLatin1String("temp"))
trackpoint.setTemperature(number());
else if (_reader.name() == "cadence")
else if (_reader.name() == QLatin1String("cadence"))
trackpoint.setCadence(number());
else if (_reader.name() == "power")
else if (_reader.name() == QLatin1String("power"))
trackpoint.setPower(number());
else if (_reader.name() == "TrackPointExtension")
else if (_reader.name() == QLatin1String("TrackPointExtension"))
tpExtension(trackpoint);
else
_reader.skipCurrentElement();
@ -107,13 +108,13 @@ void GPXParser::trackpointData(Trackpoint &trackpoint)
qreal gh = NAN;
while (_reader.readNextStartElement()) {
if (_reader.name() == "ele")
if (_reader.name() == QLatin1String("ele"))
trackpoint.setElevation(number());
else if (_reader.name() == "time")
else if (_reader.name() == QLatin1String("time"))
trackpoint.setTimestamp(time());
else if (_reader.name() == "geoidheight")
else if (_reader.name() == QLatin1String("geoidheight"))
gh = number();
else if (_reader.name() == "extensions")
else if (_reader.name() == QLatin1String("extensions"))
trkptExtensions(trackpoint);
else
_reader.skipCurrentElement();
@ -128,17 +129,17 @@ void GPXParser::waypointData(Waypoint &waypoint, TrackData *autoRoute)
qreal gh = NAN;
while (_reader.readNextStartElement()) {
if (_reader.name() == "name")
if (_reader.name() == QLatin1String("name"))
waypoint.setName(_reader.readElementText());
else if (_reader.name() == "desc")
else if (_reader.name() == QLatin1String("desc"))
waypoint.setDescription(_reader.readElementText());
else if (_reader.name() == "ele")
else if (_reader.name() == QLatin1String("ele"))
waypoint.setElevation(number());
else if (_reader.name() == "geoidheight")
else if (_reader.name() == QLatin1String("geoidheight"))
gh = number();
else if (_reader.name() == "time")
else if (_reader.name() == QLatin1String("time"))
waypoint.setTimestamp(time());
else if (autoRoute && _reader.name() == "extensions")
else if (autoRoute && _reader.name() == QLatin1String("extensions"))
rteptExtensions(autoRoute);
else
_reader.skipCurrentElement();
@ -151,7 +152,7 @@ void GPXParser::waypointData(Waypoint &waypoint, TrackData *autoRoute)
void GPXParser::trackpoints(TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "trkpt") {
if (_reader.name() == QLatin1String("trkpt")) {
track.append(Trackpoint(coordinates()));
trackpointData(track.last());
} else
@ -164,12 +165,12 @@ void GPXParser::routepoints(RouteData &route, QList<TrackData> &tracks)
TrackData autoRoute;
while (_reader.readNextStartElement()) {
if (_reader.name() == "rtept") {
if (_reader.name() == QLatin1String("rtept")) {
route.append(Waypoint(coordinates()));
waypointData(route.last(), &autoRoute);
} else if (_reader.name() == "name")
} else if (_reader.name() == QLatin1String("name"))
route.setName(_reader.readElementText());
else if (_reader.name() == "desc")
else if (_reader.name() == QLatin1String("desc"))
route.setDescription(_reader.readElementText());
else
_reader.skipCurrentElement();
@ -185,11 +186,11 @@ void GPXParser::routepoints(RouteData &route, QList<TrackData> &tracks)
void GPXParser::track(TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "trkseg")
if (_reader.name() == QLatin1String("trkseg"))
trackpoints(track);
else if (_reader.name() == "name")
else if (_reader.name() == QLatin1String("name"))
track.setName(_reader.readElementText());
else if (_reader.name() == "desc")
else if (_reader.name() == QLatin1String("desc"))
track.setDescription(_reader.readElementText());
else
_reader.skipCurrentElement();
@ -200,13 +201,13 @@ void GPXParser::gpx(QList<TrackData> &tracks, QList<RouteData> &routes,
QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "trk") {
if (_reader.name() == QLatin1String("trk")) {
tracks.append(TrackData());
track(tracks.back());
} else if (_reader.name() == "rte") {
} else if (_reader.name() == QLatin1String("rte")) {
routes.append(RouteData());
routepoints(routes.back(), tracks);
} else if (_reader.name() == "wpt") {
} else if (_reader.name() == QLatin1String("wpt")) {
waypoints.append(Waypoint(coordinates()));
waypointData(waypoints.last());
} else
@ -222,7 +223,7 @@ bool GPXParser::parse(QFile *file, QList<TrackData> &tracks,
_reader.setNamespaceProcessing(false);
if (_reader.readNextStartElement()) {
if (_reader.name() == "gpx")
if (_reader.name() == QLatin1String("gpx"))
gpx(tracks, routes, waypoints);
else
_reader.raiseError("Not a GPX file");

View File

@ -1,5 +1,5 @@
#include <cstring>
#include "common/str2int.h"
#include "common/util.h"
#include "igcparser.h"
@ -98,12 +98,14 @@ static bool readARecord(const char *line, qint64 len)
bool IGCParser::readHRecord(const char *line, int len)
{
if (len < 10 || ::strncmp(line, "HFDTE", 5))
if (len < 11 || ::strncmp(line, "HFDTE", 5))
return true;
int d = str2int(line + 5, 2);
int m = str2int(line + 7, 2);
int y = str2int(line + 9, 2);
int offset = (len < 16 || ::strncmp(line + 5, "DATE:", 5)) ? 5 : 10;
int d = str2int(line + offset, 2);
int m = str2int(line + offset + 2, 2);
int y = str2int(line + offset + 4, 2);
if (y < 0 || m < 0 || d < 0) {
_errorString = "Invalid date header format";

View File

@ -191,7 +191,7 @@ QDateTime KMLParser::timeStamp()
QDateTime ts;
while (_reader.readNextStartElement()) {
if (_reader.name() == "when")
if (_reader.name() == QLatin1String("when"))
ts = time();
else
_reader.skipCurrentElement();
@ -203,7 +203,7 @@ QDateTime KMLParser::timeStamp()
void KMLParser::lineString(TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "coordinates") {
if (_reader.name() == QLatin1String("coordinates")) {
if (!lineCoordinates(track))
_reader.raiseError("Invalid coordinates");
} else
@ -214,7 +214,7 @@ void KMLParser::lineString(TrackData &track)
void KMLParser::point(Waypoint &waypoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "coordinates") {
if (_reader.name() == QLatin1String("coordinates")) {
if (!pointCoordinates(waypoint))
_reader.raiseError("Invalid coordinates");
} else
@ -231,7 +231,7 @@ void KMLParser::heartRate(TrackData &track, int start)
const char error[] = "Heartrate data count mismatch";
while (_reader.readNextStartElement()) {
if (_reader.name() == "value") {
if (_reader.name() == QLatin1String("value")) {
if (i < track.size())
track[i++].setHeartRate(number());
else {
@ -252,7 +252,7 @@ void KMLParser::cadence(TrackData &track, int start)
const char error[] = "Cadence data count mismatch";
while (_reader.readNextStartElement()) {
if (_reader.name() == "value") {
if (_reader.name() == QLatin1String("value")) {
if (i < track.size())
track[i++].setCadence(number());
else {
@ -273,7 +273,7 @@ void KMLParser::speed(TrackData &track, int start)
const char error[] = "Speed data count mismatch";
while (_reader.readNextStartElement()) {
if (_reader.name() == "value") {
if (_reader.name() == QLatin1String("value")) {
if (i < track.size())
track[i++].setSpeed(number());
else {
@ -294,7 +294,7 @@ void KMLParser::temperature(TrackData &track, int start)
const char error[] = "Temperature data count mismatch";
while (_reader.readNextStartElement()) {
if (_reader.name() == "value") {
if (_reader.name() == QLatin1String("value")) {
if (i < track.size())
track[i++].setTemperature(number());
else {
@ -312,17 +312,17 @@ void KMLParser::temperature(TrackData &track, int start)
void KMLParser::schemaData(TrackData &track, int start)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "SimpleArrayData") {
if (_reader.name() == QLatin1String("SimpleArrayData")) {
QXmlStreamAttributes attr = _reader.attributes();
QStringRef name = attr.value("name");
if (name == "Heartrate")
if (name == QLatin1String("Heartrate"))
heartRate(track, start);
else if (name == "Cadence")
else if (name == QLatin1String("Cadence"))
cadence(track, start);
else if (name == "Speed")
else if (name == QLatin1String("Speed"))
speed(track, start);
else if (name == "Temperature")
else if (name == QLatin1String("Temperature"))
temperature(track, start);
else
_reader.skipCurrentElement();
@ -334,7 +334,7 @@ void KMLParser::schemaData(TrackData &track, int start)
void KMLParser::extendedData(TrackData &track, int start)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "SchemaData")
if (_reader.name() == QLatin1String("SchemaData"))
schemaData(track, start);
else
_reader.skipCurrentElement();
@ -348,10 +348,10 @@ void KMLParser::track(TrackData &track)
int i = first;
while (_reader.readNextStartElement()) {
if (_reader.name() == "when") {
if (_reader.name() == QLatin1String("when")) {
track.append(Trackpoint());
track.last().setTimestamp(time());
} else if (_reader.name() == "coord") {
} else if (_reader.name() == QLatin1String("coord")) {
if (i == track.size()) {
_reader.raiseError(error);
return;
@ -360,7 +360,7 @@ void KMLParser::track(TrackData &track)
return;
}
i++;
} else if (_reader.name() == "ExtendedData")
} else if (_reader.name() == QLatin1String("ExtendedData"))
extendedData(track, first);
else
_reader.skipCurrentElement();
@ -373,7 +373,7 @@ void KMLParser::track(TrackData &track)
void KMLParser::multiTrack(TrackData &t)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Track")
if (_reader.name() == QLatin1String("Track"))
track(t);
else
_reader.skipCurrentElement();
@ -385,14 +385,14 @@ void KMLParser::multiGeometry(QList<TrackData> &tracks,
const QDateTime timestamp)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Point") {
if (_reader.name() == QLatin1String("Point")) {
waypoints.append(Waypoint());
Waypoint &w = waypoints.last();
w.setName(name);
w.setDescription(desc);
w.setTimestamp(timestamp);
point(w);
} else if (_reader.name() == "LineString") {
} else if (_reader.name() == QLatin1String("LineString")) {
tracks.append(TrackData());
TrackData &t = tracks.last();
t.setName(name);
@ -409,35 +409,35 @@ void KMLParser::placemark(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
QDateTime timestamp;
while (_reader.readNextStartElement()) {
if (_reader.name() == "name")
if (_reader.name() == QLatin1String("name"))
name = _reader.readElementText();
else if (_reader.name() == "description")
else if (_reader.name() == QLatin1String("description"))
desc = _reader.readElementText();
else if (_reader.name() == "TimeStamp")
else if (_reader.name() == QLatin1String("TimeStamp"))
timestamp = timeStamp();
else if (_reader.name() == "MultiGeometry")
else if (_reader.name() == QLatin1String("MultiGeometry"))
multiGeometry(tracks, waypoints, name, desc, timestamp);
else if (_reader.name() == "Point") {
else if (_reader.name() == QLatin1String("Point")) {
waypoints.append(Waypoint());
Waypoint &w = waypoints.last();
w.setName(name);
w.setDescription(desc);
w.setTimestamp(timestamp);
point(w);
} else if (_reader.name() == "LineString"
|| _reader.name() == "LinearRing") {
} else if (_reader.name() == QLatin1String("LineString")
|| _reader.name() == QLatin1String("LinearRing")) {
tracks.append(TrackData());
TrackData &t = tracks.last();
t.setName(name);
t.setDescription(desc);
lineString(t);
} else if (_reader.name() == "Track") {
} else if (_reader.name() == QLatin1String("Track")) {
tracks.append(TrackData());
TrackData &t = tracks.last();
t.setName(name);
t.setDescription(desc);
track(t);
} else if (_reader.name() == "MultiTrack") {
} else if (_reader.name() == QLatin1String("MultiTrack")) {
tracks.append(TrackData());
TrackData &t = tracks.last();
t.setName(name);
@ -451,9 +451,9 @@ void KMLParser::placemark(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
void KMLParser::folder(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Placemark")
if (_reader.name() == QLatin1String("Placemark"))
placemark(tracks, waypoints);
else if (_reader.name() == "Folder")
else if (_reader.name() == QLatin1String("Folder"))
folder(tracks, waypoints);
else
_reader.skipCurrentElement();
@ -463,9 +463,9 @@ void KMLParser::folder(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
void KMLParser::document(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Placemark")
if (_reader.name() == QLatin1String("Placemark"))
placemark(tracks, waypoints);
else if (_reader.name() == "Folder")
else if (_reader.name() == QLatin1String("Folder"))
folder(tracks, waypoints);
else
_reader.skipCurrentElement();
@ -475,11 +475,11 @@ void KMLParser::document(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
void KMLParser::kml(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Document")
if (_reader.name() == QLatin1String("Document"))
document(tracks, waypoints);
else if (_reader.name() == "Placemark")
else if (_reader.name() == QLatin1String("Placemark"))
placemark(tracks, waypoints);
else if (_reader.name() == "Folder")
else if (_reader.name() == QLatin1String("Folder"))
folder(tracks, waypoints);
else
_reader.skipCurrentElement();
@ -495,7 +495,7 @@ bool KMLParser::parse(QFile *file, QList<TrackData> &tracks,
_reader.setDevice(file);
if (_reader.readNextStartElement()) {
if (_reader.name() == "kml")
if (_reader.name() == QLatin1String("kml"))
kml(tracks, waypoints);
else
_reader.raiseError("Not a KML file");

View File

@ -31,11 +31,11 @@ Coordinates LOCParser::coordinates()
void LOCParser::waypoint(Waypoint &waypoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "name") {
if (_reader.name() == QLatin1String("name")) {
const QXmlStreamAttributes &attr = _reader.attributes();
waypoint.setName(attr.value("id").toString());
waypoint.setDescription(_reader.readElementText());
} else if (_reader.name() == "coord") {
} else if (_reader.name() == QLatin1String("coord")) {
waypoint.setCoordinates(coordinates());
_reader.skipCurrentElement();
} else
@ -49,7 +49,7 @@ void LOCParser::waypoint(Waypoint &waypoint)
void LOCParser::loc(QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "waypoint") {
if (_reader.name() == QLatin1String("waypoint")) {
waypoints.append(Waypoint());
waypoint(waypoints.last());
} else
@ -67,7 +67,7 @@ bool LOCParser::parse(QFile *file, QList<TrackData> &tracks,
_reader.setDevice(file);
if (_reader.readNextStartElement()) {
if (_reader.name() == "loc")
if (_reader.name() == QLatin1String("loc"))
loc(waypoints);
else
_reader.raiseError("Not a LOC file");

View File

@ -1,5 +1,5 @@
#include <cstring>
#include "common/str2int.h"
#include "common/util.h"
#include "nmeaparser.h"

View File

@ -1,6 +1,7 @@
#include <QFile>
#include <QDir>
#include "common/rectc.h"
#include "common/greatcircle.h"
#include "data.h"
#include "poi.h"
@ -94,23 +95,45 @@ static bool cb(size_t data, void* context)
return true;
}
void POI::search(const RectC &rect, QSet<int> &set) const
{
qreal min[2], max[2];
min[0] = rect.topLeft().lon();
min[1] = rect.bottomRight().lat();
max[0] = rect.bottomRight().lon();
max[1] = rect.topLeft().lat();
_tree.Search(min, max, cb, &set);
}
QList<Waypoint> POI::points(const Path &path) const
{
QList<Waypoint> ret;
QSet<int> set;
qreal min[2], max[2];
QSet<int>::const_iterator it;
for (int i = 0; i < path.count(); i++) {
RectC br(path.at(i).coordinates(), _radius);
min[0] = br.topLeft().lon();
min[1] = br.bottomRight().lat();
max[0] = br.bottomRight().lon();
max[1] = br.topLeft().lat();
_tree.Search(min, max, cb, &set);
for (int i = 1; i < path.count(); i++) {
double ds = path.at(i).distance() - path.at(i-1).distance();
unsigned n = (unsigned)ceil(ds / _radius);
if (n > 1) {
GreatCircle gc(path.at(i-1).coordinates(), path.at(i).coordinates());
for (unsigned j = 0; j < n; j++) {
RectC br(gc.pointAt((double)j/n), _radius);
search(br, set);
}
} else {
RectC br(path.at(i-1).coordinates(), _radius);
search(br, set);
}
}
RectC br(path.last().coordinates(), _radius);
search(br, set);
for (it = set.constBegin(); it != set.constEnd(); ++it)
ret.append(_data.at(*it));

View File

@ -9,7 +9,6 @@
#include "waypoint.h"
#include "path.h"
class WaypointItem;
class POI : public QObject
{
@ -45,6 +44,7 @@ private:
};
bool loadFile(const QString &path, bool dir);
void search(const RectC &rect, QSet<int> &set) const;
POITree _tree;
QVector<Waypoint> _data;

View File

@ -3,7 +3,7 @@
void SLFParser::warning(const char *text) const
{
const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s\n", qPrintable(file->fileName()),
qWarning("%s:%lld: %s", qPrintable(file->fileName()),
_reader.lineNumber(), text);
}
@ -29,7 +29,7 @@ bool SLFParser::data(const QXmlStreamAttributes &attr, const char *name,
void SLFParser::entries(const QDateTime &date, TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Entry") {
if (_reader.name() == QLatin1String("Entry")) {
qreal val, lat, lon;
QXmlStreamAttributes attr(_reader.attributes());
@ -70,11 +70,11 @@ void SLFParser::entries(const QDateTime &date, TrackData &track)
void SLFParser::generalInformation(QDateTime &date, TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "name")
if (_reader.name() == QLatin1String("name"))
track.setName(_reader.readElementText());
else if (_reader.name() == "description")
else if (_reader.name() == QLatin1String("description"))
track.setDescription(_reader.readElementText());
else if (_reader.name() == "startDate") {
else if (_reader.name() == QLatin1String("startDate")) {
QString ds(_reader.readElementText());
QLocale locale(QLocale::English);
date = locale.toDateTime(ds.mid(0, ds.indexOf("GMT"))
@ -89,9 +89,9 @@ void SLFParser::activity(TrackData &track)
QDateTime date;
while (_reader.readNextStartElement()) {
if (_reader.name() == "Entries")
if (_reader.name() == QLatin1String("Entries"))
entries(date, track);
else if (_reader.name() == "GeneralInformation")
else if (_reader.name() == QLatin1String("GeneralInformation"))
generalInformation(date, track);
else
_reader.skipCurrentElement();
@ -108,7 +108,7 @@ bool SLFParser::parse(QFile *file, QList<TrackData> &tracks,
_reader.setDevice(file);
if (_reader.readNextStartElement()) {
if (_reader.name() == "Activity") {
if (_reader.name() == QLatin1String("Activity")) {
tracks.append(TrackData());
activity(tracks.last());
} else

View File

@ -4,7 +4,7 @@
void TCXParser::warning(const char *text) const
{
const QFile *file = static_cast<QFile *>(_reader.device());
qWarning("%s:%lld: %s\n", qPrintable(file->fileName()),
qWarning("%s:%lld: %s", qPrintable(file->fileName()),
_reader.lineNumber(), text);
}
@ -37,13 +37,13 @@ Coordinates TCXParser::position()
bool res;
while (_reader.readNextStartElement()) {
if (_reader.name() == "LatitudeDegrees") {
if (_reader.name() == QLatin1String("LatitudeDegrees")) {
val = _reader.readElementText().toDouble(&res);
if (!res || (val < -90.0 || val > 90.0))
_reader.raiseError("Invalid LatitudeDegrees");
else
pos.setLat(val);
} else if (_reader.name() == "LongitudeDegrees") {
} else if (_reader.name() == QLatin1String("LongitudeDegrees")) {
val = _reader.readElementText().toDouble(&res);
if (!res || (val < -180.0 || val > 180.0))
_reader.raiseError("Invalid LongitudeDegrees");
@ -59,7 +59,7 @@ Coordinates TCXParser::position()
void TCXParser::heartRateBpm(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Value")
if (_reader.name() == QLatin1String("Value"))
trackpoint.setHeartRate(number());
else
_reader.skipCurrentElement();
@ -69,9 +69,9 @@ void TCXParser::heartRateBpm(Trackpoint &trackpoint)
void TCXParser::extensions(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "RunCadence")
if (_reader.name() == QLatin1String("RunCadence"))
trackpoint.setCadence(number());
else if (_reader.name() == "Watts")
else if (_reader.name() == QLatin1String("Watts"))
trackpoint.setPower(number());
else
_reader.skipCurrentElement();
@ -81,17 +81,17 @@ void TCXParser::extensions(Trackpoint &trackpoint)
void TCXParser::trackpointData(Trackpoint &trackpoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Position")
if (_reader.name() == QLatin1String("Position"))
trackpoint.setCoordinates(position());
else if (_reader.name() == "AltitudeMeters")
else if (_reader.name() == QLatin1String("AltitudeMeters"))
trackpoint.setElevation(number());
else if (_reader.name() == "Time")
else if (_reader.name() == QLatin1String("Time"))
trackpoint.setTimestamp(time());
else if (_reader.name() == "HeartRateBpm")
else if (_reader.name() == QLatin1String("HeartRateBpm"))
heartRateBpm(trackpoint);
else if (_reader.name() == "Cadence")
else if (_reader.name() == QLatin1String("Cadence"))
trackpoint.setCadence(number());
else if (_reader.name() == "Extensions")
else if (_reader.name() == QLatin1String("Extensions"))
extensions(trackpoint);
else
_reader.skipCurrentElement();
@ -101,15 +101,15 @@ void TCXParser::trackpointData(Trackpoint &trackpoint)
void TCXParser::waypointData(Waypoint &waypoint)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Position")
if (_reader.name() == QLatin1String("Position"))
waypoint.setCoordinates(position());
else if (_reader.name() == "Name")
else if (_reader.name() == QLatin1String("Name"))
waypoint.setName(_reader.readElementText());
else if (_reader.name() == "Notes")
else if (_reader.name() == QLatin1String("Notes"))
waypoint.setDescription(_reader.readElementText());
else if (_reader.name() == "AltitudeMeters")
else if (_reader.name() == QLatin1String("AltitudeMeters"))
waypoint.setElevation(number());
else if (_reader.name() == "Time")
else if (_reader.name() == QLatin1String("Time"))
waypoint.setTimestamp(time());
else
_reader.skipCurrentElement();
@ -119,7 +119,7 @@ void TCXParser::waypointData(Waypoint &waypoint)
void TCXParser::trackpoints(TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Trackpoint") {
if (_reader.name() == QLatin1String("Trackpoint")) {
Trackpoint t;
trackpointData(t);
if (t.coordinates().isValid())
@ -134,7 +134,7 @@ void TCXParser::trackpoints(TrackData &track)
void TCXParser::lap(TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Track")
if (_reader.name() == QLatin1String("Track"))
trackpoints(track);
else
_reader.skipCurrentElement();
@ -144,13 +144,13 @@ void TCXParser::lap(TrackData &track)
void TCXParser::course(QList<Waypoint> &waypoints, TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Track")
if (_reader.name() == QLatin1String("Track"))
trackpoints(track);
else if (_reader.name() == "Name")
else if (_reader.name() == QLatin1String("Name"))
track.setName(_reader.readElementText());
else if (_reader.name() == "Notes")
else if (_reader.name() == QLatin1String("Notes"))
track.setDescription(_reader.readElementText());
else if (_reader.name() == "CoursePoint") {
else if (_reader.name() == QLatin1String("CoursePoint")) {
Waypoint w;
waypointData(w);
if (w.coordinates().isValid())
@ -165,8 +165,10 @@ void TCXParser::course(QList<Waypoint> &waypoints, TrackData &track)
void TCXParser::activity(TrackData &track)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Lap")
if (_reader.name() == QLatin1String("Lap"))
lap(track);
else if (_reader.name() == QLatin1String("Notes"))
track.setDescription(_reader.readElementText());
else
_reader.skipCurrentElement();
}
@ -175,7 +177,7 @@ void TCXParser::activity(TrackData &track)
void TCXParser::courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Course") {
if (_reader.name() == QLatin1String("Course")) {
tracks.append(TrackData());
course(waypoints, tracks.back());
} else
@ -186,7 +188,7 @@ void TCXParser::courses(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
void TCXParser::sport(QList<TrackData> &tracks)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Activity") {
if (_reader.name() == QLatin1String("Activity")) {
tracks.append(TrackData());
activity(tracks.back());
} else
@ -197,7 +199,8 @@ void TCXParser::sport(QList<TrackData> &tracks)
void TCXParser::multiSportSession(QList<TrackData> &tracks)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "FirstSport" || _reader.name() == "NextSport")
if (_reader.name() == QLatin1String("FirstSport")
|| _reader.name() == QLatin1String("NextSport"))
sport(tracks);
else
_reader.skipCurrentElement();
@ -207,10 +210,10 @@ void TCXParser::multiSportSession(QList<TrackData> &tracks)
void TCXParser::activities(QList<TrackData> &tracks)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Activity") {
if (_reader.name() == QLatin1String("Activity")) {
tracks.append(TrackData());
activity(tracks.back());
} else if (_reader.name() == "MultiSportSession")
} else if (_reader.name() == QLatin1String("MultiSportSession"))
multiSportSession(tracks);
else
_reader.skipCurrentElement();
@ -220,9 +223,9 @@ void TCXParser::activities(QList<TrackData> &tracks)
void TCXParser::tcx(QList<TrackData> &tracks, QList<Waypoint> &waypoints)
{
while (_reader.readNextStartElement()) {
if (_reader.name() == "Courses")
if (_reader.name() == QLatin1String("Courses"))
courses(tracks, waypoints);
else if (_reader.name() == "Activities")
else if (_reader.name() == QLatin1String("Activities"))
activities(tracks);
else
_reader.skipCurrentElement();
@ -238,7 +241,7 @@ bool TCXParser::parse(QFile *file, QList<TrackData> &tracks,
_reader.setDevice(file);
if (_reader.readNextStartElement()) {
if (_reader.name() == "TrainingCenterDatabase")
if (_reader.name() == QLatin1String("TrainingCenterDatabase"))
tcx(tracks, waypoints);
else
_reader.raiseError("Not a TCX file");

View File

@ -1,5 +1,5 @@
#include "common/config.h"
#include "GUI/app.h"
#include "config.h"
int main(int argc, char *argv[])
{
@ -9,7 +9,5 @@ int main(int argc, char *argv[])
#endif // ENABLE_HIDPI
App app(argc, argv);
app.run();
return 0;
return app.run();
}

View File

@ -1,5 +1,5 @@
#include "common/coordinates.h"
#include "common/str2int.h"
#include "common/util.h"
#include "angularunits.h"
static double sDMS2deg(double val)

Some files were not shown because too many files have changed in this diff Show More