1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-04 06:49:16 +02:00

Compare commits

...

23 Commits
6.0 ... 6.1

Author SHA1 Message Date
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
48 changed files with 781 additions and 752 deletions

View File

@ -1,4 +1,4 @@
version: 6.0.{build} version: 6.1.{build}
configuration: Release configuration: Release
platform: Any CPU platform: Any CPU
environment: environment:

View File

@ -3,8 +3,8 @@ GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX,
KML, FIT, IGC, NMEA, SLF, LOC and OziExplorer files. KML, FIT, IGC, NMEA, SLF, LOC and OziExplorer files.
## Features ## Features
* User-definable online maps (OSM/Google tiles, WMTS, WMS). * User-definable online maps (OpenStreetMap/Google tiles, WMTS, WMS, TMS).
* Offline maps (OziExplorer maps, TrekBuddy maps/atlases, Garmin JNX maps, GeoTIFF images). * 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. * Elevation, speed, heart rate, cadence, power, temperature and gear ratio/shifts graphs.
* Support for multiple tracks in one view. * Support for multiple tracks in one view.
* Support for POI files. * Support for POI files.
@ -42,4 +42,4 @@ http://www.gpxsee.org
[GPXSee maps repository](https://github.com/tumic0/GPXSee-maps) [GPXSee maps repository](https://github.com/tumic0/GPXSee-maps)
## Translations ## Translations
GPXSee uses [Weblate](https://hosted.weblate.org/projects/gpxsee) for translations. GPXSee uses [Weblate](https://hosted.weblate.org/projects/gpxsee/translations/) for translations.

View File

@ -1,5 +1,5 @@
TARGET = GPXSee TARGET = GPXSee
VERSION = 6.0 VERSION = 6.1
QT += core \ QT += core \
gui \ gui \
@ -21,6 +21,7 @@ HEADERS += src/config.h \
src/common/wgs84.h \ src/common/wgs84.h \
src/common/str2int.h \ src/common/str2int.h \
src/common/rtree.h \ src/common/rtree.h \
src/common/kv.h \
src/GUI/app.h \ src/GUI/app.h \
src/GUI/icons.h \ src/GUI/icons.h \
src/GUI/gui.h \ src/GUI/gui.h \
@ -138,7 +139,6 @@ HEADERS += src/config.h \
src/map/mercator.h \ src/map/mercator.h \
src/map/jnxmap.h \ src/map/jnxmap.h \
src/map/krovak.h \ src/map/krovak.h \
src/GUI/kv.h \
src/data/locparser.h \ src/data/locparser.h \
src/data/slfparser.h \ src/data/slfparser.h \
src/map/geotiffmap.h \ src/map/geotiffmap.h \
@ -263,7 +263,8 @@ TRANSLATIONS = lang/gpxsee_en.ts \
lang/gpxsee_ru.ts \ lang/gpxsee_ru.ts \
lang/gpxsee_fi.ts \ lang/gpxsee_fi.ts \
lang/gpxsee_fr.ts \ lang/gpxsee_fr.ts \
lang/gpxsee_pl.ts lang/gpxsee_pl.ts \
lang/gpxsee_no.ts
macx { macx {
ICON = icons/gpxsee.icns ICON = icons/gpxsee.icns
@ -276,7 +277,8 @@ macx {
lang/gpxsee_fr.qm \ lang/gpxsee_fr.qm \
lang/gpxsee_ru.qm \ lang/gpxsee_ru.qm \
lang/gpxsee_sv.qm \ lang/gpxsee_sv.qm \
lang/gpxsee_pl.qm lang/gpxsee_pl.qm \
lang/gpxsee_no.qm
CSV.path = Contents/Resources CSV.path = Contents/Resources
CSV.files = pkg/csv CSV.files = pkg/csv
MAPS.path = Contents/Resources MAPS.path = Contents/Resources

View File

@ -182,94 +182,99 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="134"/> <location filename="../src/GUI/exportdialog.cpp" line="135"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>Exportovat do PDF</translation> <translation>Exportovat do PDF</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/> <location filename="../src/GUI/exportdialog.cpp" line="52"/>
<source>PDF files (*.pdf);;All files (*)</source>
<translation>Soubory PDF (*.pdf);;Všechny soubory (*)</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="51"/>
<source>Portrait</source> <source>Portrait</source>
<translation>Na výšku</translation> <translation>Na výšku</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="52"/> <location filename="../src/GUI/exportdialog.cpp" line="53"/>
<source>Landscape</source> <source>Landscape</source>
<translation>Na šířku</translation> <translation>Na šířku</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="96"/> <location filename="../src/GUI/exportdialog.cpp" line="97"/>
<source>Page size:</source> <source>Page size:</source>
<translation>Velikost stránky:</translation> <translation>Velikost stránky:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="98"/> <location filename="../src/GUI/exportdialog.cpp" line="99"/>
<source>Orientation:</source> <source>Orientation:</source>
<translation>Orientace:</translation> <translation>Orientace:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="93"/> <location filename="../src/GUI/exportdialog.cpp" line="94"/>
<source>Page Setup</source> <source>Page Setup</source>
<translation>Nastavení stránky</translation> <translation>Nastavení stránky</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>PDF files</source>
<translation>Soubory PDF</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>All files</source>
<translation>Všechny soubory</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>in</source> <source>in</source>
<translation>in</translation> <translation>in</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>mm</source> <source>mm</source>
<translation>mm</translation> <translation>mm</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="97"/> <location filename="../src/GUI/exportdialog.cpp" line="98"/>
<source>Resolution:</source> <source>Resolution:</source>
<translation>Rozlišení:</translation> <translation>Rozlišení:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="99"/> <location filename="../src/GUI/exportdialog.cpp" line="100"/>
<source>Margins:</source> <source>Margins:</source>
<translation>Okraje:</translation> <translation>Okraje:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="105"/> <location filename="../src/GUI/exportdialog.cpp" line="106"/>
<source>File:</source> <source>File:</source>
<translation>Soubor:</translation> <translation>Soubor:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="112"/> <location filename="../src/GUI/exportdialog.cpp" line="113"/>
<source>Output file</source> <source>Output file</source>
<translation>Výstupní soubor</translation> <translation>Výstupní soubor</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="119"/> <location filename="../src/GUI/exportdialog.cpp" line="120"/>
<source>Export</source> <source>Export</source>
<translation>Exportovat</translation> <translation>Exportovat</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>Error</source> <source>Error</source>
<translation>Chyba</translation> <translation>Chyba</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Nebyl zvolen žádný výstupní soubor.</translation> <translation>Nebyl zvolen žádný výstupní soubor.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>%1 je adresář.</translation> <translation>%1 je adresář.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 nelze zapsat.</translation> <translation>%1 nelze zapsat.</translation>
</message> </message>

View File

@ -182,94 +182,99 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="134"/> <location filename="../src/GUI/exportdialog.cpp" line="135"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>PDF Export</translation> <translation>PDF Export</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/> <location filename="../src/GUI/exportdialog.cpp" line="52"/>
<source>PDF files (*.pdf);;All files (*)</source>
<translation>PDF-Dateien (*.pdf);;Alle Dateien (*)</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="51"/>
<source>Portrait</source> <source>Portrait</source>
<translation>Hochformat</translation> <translation>Hochformat</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="52"/> <location filename="../src/GUI/exportdialog.cpp" line="53"/>
<source>Landscape</source> <source>Landscape</source>
<translation>Querformat</translation> <translation>Querformat</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="96"/> <location filename="../src/GUI/exportdialog.cpp" line="97"/>
<source>Page size:</source> <source>Page size:</source>
<translation>Seitengröße:</translation> <translation>Seitengröße:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="98"/> <location filename="../src/GUI/exportdialog.cpp" line="99"/>
<source>Orientation:</source> <source>Orientation:</source>
<translation>Orientierung:</translation> <translation>Orientierung:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="93"/> <location filename="../src/GUI/exportdialog.cpp" line="94"/>
<source>Page Setup</source> <source>Page Setup</source>
<translation>Seiten Setup</translation> <translation>Seiten Setup</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>PDF files</source>
<translation>PDF-Dateien</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>All files</source>
<translation>Alle Dateien</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>in</source> <source>in</source>
<translation>in</translation> <translation>in</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>mm</source> <source>mm</source>
<translation>mm</translation> <translation>mm</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="97"/> <location filename="../src/GUI/exportdialog.cpp" line="98"/>
<source>Resolution:</source> <source>Resolution:</source>
<translation>Druckauflösung:</translation> <translation>Druckauflösung:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="99"/> <location filename="../src/GUI/exportdialog.cpp" line="100"/>
<source>Margins:</source> <source>Margins:</source>
<translation>Ränder:</translation> <translation>Ränder:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="105"/> <location filename="../src/GUI/exportdialog.cpp" line="106"/>
<source>File:</source> <source>File:</source>
<translation>Ausgabedatei:</translation> <translation>Ausgabedatei:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="112"/> <location filename="../src/GUI/exportdialog.cpp" line="113"/>
<source>Output file</source> <source>Output file</source>
<translation>Ausgabedatei</translation> <translation>Ausgabedatei</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="119"/> <location filename="../src/GUI/exportdialog.cpp" line="120"/>
<source>Export</source> <source>Export</source>
<translation>Export</translation> <translation>Export</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>Error</source> <source>Error</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Keine Ausgabedatei ausgewählt.</translation> <translation>Keine Ausgabedatei ausgewählt.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>%1 ist ein Verzeichniss.</translation> <translation>%1 ist ein Verzeichniss.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 ist nich schreibbar.</translation> <translation>%1 ist nich schreibbar.</translation>
</message> </message>

View File

@ -182,94 +182,99 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="134"/> <location filename="../src/GUI/exportdialog.cpp" line="135"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>Vie PDF:ksi</translation> <translation>Vie PDF:ksi</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/> <location filename="../src/GUI/exportdialog.cpp" line="52"/>
<source>PDF files (*.pdf);;All files (*)</source>
<translation>PDF-tiedostot (*.pdf);;Kaikki tiedostot (*)</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="51"/>
<source>Portrait</source> <source>Portrait</source>
<translation>Pystysuunta</translation> <translation>Pystysuunta</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="52"/> <location filename="../src/GUI/exportdialog.cpp" line="53"/>
<source>Landscape</source> <source>Landscape</source>
<translation>Vaakasuunta</translation> <translation>Vaakasuunta</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="96"/> <location filename="../src/GUI/exportdialog.cpp" line="97"/>
<source>Page size:</source> <source>Page size:</source>
<translation>Sivukoko:</translation> <translation>Sivukoko:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="98"/> <location filename="../src/GUI/exportdialog.cpp" line="99"/>
<source>Orientation:</source> <source>Orientation:</source>
<translation>Suunta:</translation> <translation>Suunta:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="93"/> <location filename="../src/GUI/exportdialog.cpp" line="94"/>
<source>Page Setup</source> <source>Page Setup</source>
<translation>Sivuasetukset</translation> <translation>Sivuasetukset</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>PDF files</source>
<translation>PDF-tiedostot</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>All files</source>
<translation>Kaikki tiedostot</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>in</source> <source>in</source>
<translation>in</translation> <translation>in</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>mm</source> <source>mm</source>
<translation>mm</translation> <translation>mm</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="97"/> <location filename="../src/GUI/exportdialog.cpp" line="98"/>
<source>Resolution:</source> <source>Resolution:</source>
<translation>Resoluutio:</translation> <translation>Resoluutio:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="99"/> <location filename="../src/GUI/exportdialog.cpp" line="100"/>
<source>Margins:</source> <source>Margins:</source>
<translation>Reunukset:</translation> <translation>Reunukset:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="105"/> <location filename="../src/GUI/exportdialog.cpp" line="106"/>
<source>File:</source> <source>File:</source>
<translation>Tiedosto:</translation> <translation>Tiedosto:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="112"/> <location filename="../src/GUI/exportdialog.cpp" line="113"/>
<source>Output file</source> <source>Output file</source>
<translation>Tulostustiedosto</translation> <translation>Tulostustiedosto</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="119"/> <location filename="../src/GUI/exportdialog.cpp" line="120"/>
<source>Export</source> <source>Export</source>
<translation>Vie</translation> <translation>Vie</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>Error</source> <source>Error</source>
<translation>Virhe</translation> <translation>Virhe</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Ei tulostustiedostoa valittu.</translation> <translation>Ei tulostustiedostoa valittu.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>%1 on hakemisto.</translation> <translation>%1 on hakemisto.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 ei voi kirjoittaa.</translation> <translation>%1 ei voi kirjoittaa.</translation>
</message> </message>

View File

@ -182,94 +182,99 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="134"/> <location filename="../src/GUI/exportdialog.cpp" line="135"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>Exporter au format PDF</translation> <translation>Exporter au format PDF</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/> <location filename="../src/GUI/exportdialog.cpp" line="52"/>
<source>PDF files (*.pdf);;All files (*)</source>
<translation>Fichiers PDF (*.pdf);;Tous les fichiers (*)</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="51"/>
<source>Portrait</source> <source>Portrait</source>
<translation>Portrait</translation> <translation>Portrait</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="52"/> <location filename="../src/GUI/exportdialog.cpp" line="53"/>
<source>Landscape</source> <source>Landscape</source>
<translation>Paysage</translation> <translation>Paysage</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="96"/> <location filename="../src/GUI/exportdialog.cpp" line="97"/>
<source>Page size:</source> <source>Page size:</source>
<translation>Format de papier :</translation> <translation>Format de papier :</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="98"/> <location filename="../src/GUI/exportdialog.cpp" line="99"/>
<source>Orientation:</source> <source>Orientation:</source>
<translation>Orientation :</translation> <translation>Orientation :</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="93"/> <location filename="../src/GUI/exportdialog.cpp" line="94"/>
<source>Page Setup</source> <source>Page Setup</source>
<translation>Style de page</translation> <translation>Style de page</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>PDF files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>All files</source>
<translation type="unfinished">Tous les fichiers</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>in</source> <source>in</source>
<translation>po</translation> <translation>po</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>mm</source> <source>mm</source>
<translation>mm</translation> <translation>mm</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="97"/> <location filename="../src/GUI/exportdialog.cpp" line="98"/>
<source>Resolution:</source> <source>Resolution:</source>
<translation>Résolution :</translation> <translation>Résolution :</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="99"/> <location filename="../src/GUI/exportdialog.cpp" line="100"/>
<source>Margins:</source> <source>Margins:</source>
<translation>Marges :</translation> <translation>Marges :</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="105"/> <location filename="../src/GUI/exportdialog.cpp" line="106"/>
<source>File:</source> <source>File:</source>
<translation>Fichier :</translation> <translation>Fichier :</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="112"/> <location filename="../src/GUI/exportdialog.cpp" line="113"/>
<source>Output file</source> <source>Output file</source>
<translation>Fichier exporté</translation> <translation>Fichier exporté</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="119"/> <location filename="../src/GUI/exportdialog.cpp" line="120"/>
<source>Export</source> <source>Export</source>
<translation>Exporter</translation> <translation>Exporter</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>Error</source> <source>Error</source>
<translation>Erreur</translation> <translation>Erreur</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Auncun fichier sélectionné.</translation> <translation>Auncun fichier sélectionné.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>%1 est un dossier.</translation> <translation>%1 est un dossier.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 n&apos;est pas inscriptible.</translation> <translation>%1 n&apos;est pas inscriptible.</translation>
</message> </message>

File diff suppressed because it is too large Load Diff

View File

@ -182,94 +182,99 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="134"/> <location filename="../src/GUI/exportdialog.cpp" line="135"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>Eksportuj do PDF</translation> <translation>Eksportuj do PDF</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/> <location filename="../src/GUI/exportdialog.cpp" line="52"/>
<source>PDF files (*.pdf);;All files (*)</source>
<translation>Pliki PDF (*.pdf);;Wszystkie pliki (*)</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="51"/>
<source>Portrait</source> <source>Portrait</source>
<translation>Pionowo</translation> <translation>Pionowo</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="52"/> <location filename="../src/GUI/exportdialog.cpp" line="53"/>
<source>Landscape</source> <source>Landscape</source>
<translation>Poziomo</translation> <translation>Poziomo</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="96"/> <location filename="../src/GUI/exportdialog.cpp" line="97"/>
<source>Page size:</source> <source>Page size:</source>
<translation>Rozmiar strony:</translation> <translation>Rozmiar strony:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="98"/> <location filename="../src/GUI/exportdialog.cpp" line="99"/>
<source>Orientation:</source> <source>Orientation:</source>
<translation>Orientacja:</translation> <translation>Orientacja:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="93"/> <location filename="../src/GUI/exportdialog.cpp" line="94"/>
<source>Page Setup</source> <source>Page Setup</source>
<translation>Ustawienia strony</translation> <translation>Ustawienia strony</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>PDF files</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>All files</source>
<translation type="unfinished">Wszystkie pliki</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>in</source> <source>in</source>
<translation>in</translation> <translation>in</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>mm</source> <source>mm</source>
<translation>mm</translation> <translation>mm</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="97"/> <location filename="../src/GUI/exportdialog.cpp" line="98"/>
<source>Resolution:</source> <source>Resolution:</source>
<translation>Rozdzielczość:</translation> <translation>Rozdzielczość:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="99"/> <location filename="../src/GUI/exportdialog.cpp" line="100"/>
<source>Margins:</source> <source>Margins:</source>
<translation>Marginesy:</translation> <translation>Marginesy:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="105"/> <location filename="../src/GUI/exportdialog.cpp" line="106"/>
<source>File:</source> <source>File:</source>
<translation>Plik:</translation> <translation>Plik:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="112"/> <location filename="../src/GUI/exportdialog.cpp" line="113"/>
<source>Output file</source> <source>Output file</source>
<translation>Plik docelowy</translation> <translation>Plik docelowy</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="119"/> <location filename="../src/GUI/exportdialog.cpp" line="120"/>
<source>Export</source> <source>Export</source>
<translation>Eksportuj</translation> <translation>Eksportuj</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>Error</source> <source>Error</source>
<translation>Błąd</translation> <translation>Błąd</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Nie wybrano pliku docelowego.</translation> <translation>Nie wybrano pliku docelowego.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>%1 jest katalogiem.</translation> <translation>%1 jest katalogiem.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 nie jest zapisywalny.</translation> <translation>%1 nie jest zapisywalny.</translation>
</message> </message>

View File

@ -182,94 +182,99 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="134"/> <location filename="../src/GUI/exportdialog.cpp" line="135"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>Экспорт в PDF</translation> <translation>Экспорт в PDF</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/> <location filename="../src/GUI/exportdialog.cpp" line="52"/>
<source>PDF files (*.pdf);;All files (*)</source>
<translation>PDF файлы (*.pdf);;Все файлы (*)</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="51"/>
<source>Portrait</source> <source>Portrait</source>
<translation>Портретная</translation> <translation>Портретная</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="52"/> <location filename="../src/GUI/exportdialog.cpp" line="53"/>
<source>Landscape</source> <source>Landscape</source>
<translation>Ландшафтная</translation> <translation>Ландшафтная</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="96"/> <location filename="../src/GUI/exportdialog.cpp" line="97"/>
<source>Page size:</source> <source>Page size:</source>
<translation>Размер страницы:</translation> <translation>Размер страницы:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="98"/> <location filename="../src/GUI/exportdialog.cpp" line="99"/>
<source>Orientation:</source> <source>Orientation:</source>
<translation>Ориентация:</translation> <translation>Ориентация:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="93"/> <location filename="../src/GUI/exportdialog.cpp" line="94"/>
<source>Page Setup</source> <source>Page Setup</source>
<translation>Параметры страницы</translation> <translation>Параметры страницы</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>PDF files</source>
<translation>PDF файлы</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>All files</source>
<translation>Все файлы</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>in</source> <source>in</source>
<translation>in</translation> <translation>in</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>mm</source> <source>mm</source>
<translation>мм</translation> <translation>мм</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="97"/> <location filename="../src/GUI/exportdialog.cpp" line="98"/>
<source>Resolution:</source> <source>Resolution:</source>
<translation>Разрешение:</translation> <translation>Разрешение:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="99"/> <location filename="../src/GUI/exportdialog.cpp" line="100"/>
<source>Margins:</source> <source>Margins:</source>
<translation>Поля:</translation> <translation>Поля:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="105"/> <location filename="../src/GUI/exportdialog.cpp" line="106"/>
<source>File:</source> <source>File:</source>
<translation>Файл:</translation> <translation>Файл:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="112"/> <location filename="../src/GUI/exportdialog.cpp" line="113"/>
<source>Output file</source> <source>Output file</source>
<translation>Файл вывода</translation> <translation>Файл вывода</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="119"/> <location filename="../src/GUI/exportdialog.cpp" line="120"/>
<source>Export</source> <source>Export</source>
<translation>Экспорт</translation> <translation>Экспорт</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>Error</source> <source>Error</source>
<translation>Ошибка</translation> <translation>Ошибка</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Не выбран файл вывода.</translation> <translation>Не выбран файл вывода.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>Файл %1 - это директория.</translation> <translation>Файл %1 - это директория.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 не доступен для записи.</translation> <translation>%1 не доступен для записи.</translation>
</message> </message>
@ -395,7 +400,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="223"/> <location filename="../src/GUI/gui.cpp" line="223"/>
<source>Open...</source> <source>Open...</source>
<translation>Открыть...</translation> <translation>Открыть</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="212"/> <location filename="../src/GUI/gui.cpp" line="212"/>
@ -407,17 +412,17 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="254"/> <location filename="../src/GUI/gui.cpp" line="254"/>
<source>Statistics...</source> <source>Statistics...</source>
<translation>Статистика...</translation> <translation>Статистика</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="262"/> <location filename="../src/GUI/gui.cpp" line="262"/>
<source>Load POI file...</source> <source>Load POI file...</source>
<translation>Загрузить файл с точками POI...</translation> <translation>Загрузить файл с точками POI</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="298"/> <location filename="../src/GUI/gui.cpp" line="298"/>
<source>Load map...</source> <source>Load map...</source>
<translation>Загрузить карту...</translation> <translation>Загрузить карту</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="307"/> <location filename="../src/GUI/gui.cpp" line="307"/>
@ -516,7 +521,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="453"/> <location filename="../src/GUI/gui.cpp" line="453"/>
<source>Options...</source> <source>Options...</source>
<translation>Параметры...</translation> <translation>Параметры</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="459"/> <location filename="../src/GUI/gui.cpp" line="459"/>
@ -723,12 +728,12 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="228"/> <location filename="../src/GUI/gui.cpp" line="228"/>
<source>Print...</source> <source>Print...</source>
<translation>Печать...</translation> <translation>Печать</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="235"/> <location filename="../src/GUI/gui.cpp" line="235"/>
<source>Export to PDF...</source> <source>Export to PDF...</source>
<translation>Экспорт в PDF...</translation> <translation>Экспорт в PDF</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="996"/> <location filename="../src/GUI/gui.cpp" line="996"/>

View File

@ -182,94 +182,99 @@
<context> <context>
<name>ExportDialog</name> <name>ExportDialog</name>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="134"/> <location filename="../src/GUI/exportdialog.cpp" line="135"/>
<source>Export to PDF</source> <source>Export to PDF</source>
<translation>Exportera till PDF</translation> <translation>Exportera till PDF</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/> <location filename="../src/GUI/exportdialog.cpp" line="52"/>
<source>PDF files (*.pdf);;All files (*)</source>
<translation>PDF-filer (*.pdf);;Alla filer (*)</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="51"/>
<source>Portrait</source> <source>Portrait</source>
<translation>Stående</translation> <translation>Stående</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="52"/> <location filename="../src/GUI/exportdialog.cpp" line="53"/>
<source>Landscape</source> <source>Landscape</source>
<translation>Liggande</translation> <translation>Liggande</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="96"/> <location filename="../src/GUI/exportdialog.cpp" line="97"/>
<source>Page size:</source> <source>Page size:</source>
<translation>Sidstorlek:</translation> <translation>Sidstorlek:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="98"/> <location filename="../src/GUI/exportdialog.cpp" line="99"/>
<source>Orientation:</source> <source>Orientation:</source>
<translation>Orientering:</translation> <translation>Orientering:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="93"/> <location filename="../src/GUI/exportdialog.cpp" line="94"/>
<source>Page Setup</source> <source>Page Setup</source>
<translation>Sidinställning</translation> <translation>Sidinställning</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>PDF files</source>
<translation>PDF-filer</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="25"/>
<source>All files</source>
<translation>Alla filer</translation>
</message>
<message>
<location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>in</source> <source>in</source>
<translation>i</translation> <translation>i</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="65"/> <location filename="../src/GUI/exportdialog.cpp" line="66"/>
<source>mm</source> <source>mm</source>
<translation>mm</translation> <translation>mm</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="97"/> <location filename="../src/GUI/exportdialog.cpp" line="98"/>
<source>Resolution:</source> <source>Resolution:</source>
<translation>Upplösning:</translation> <translation>Upplösning:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="99"/> <location filename="../src/GUI/exportdialog.cpp" line="100"/>
<source>Margins:</source> <source>Margins:</source>
<translation>Marginaler:</translation> <translation>Marginaler:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="105"/> <location filename="../src/GUI/exportdialog.cpp" line="106"/>
<source>File:</source> <source>File:</source>
<translation>Fil:</translation> <translation>Fil:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="112"/> <location filename="../src/GUI/exportdialog.cpp" line="113"/>
<source>Output file</source> <source>Output file</source>
<translation>Utdatafil</translation> <translation>Utdatafil</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="119"/> <location filename="../src/GUI/exportdialog.cpp" line="120"/>
<source>Export</source> <source>Export</source>
<translation>Exportera</translation> <translation>Exportera</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>Error</source> <source>Error</source>
<translation>Fel</translation> <translation>Fel</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="141"/> <location filename="../src/GUI/exportdialog.cpp" line="142"/>
<source>No output file selected.</source> <source>No output file selected.</source>
<translation>Ingen utdatafil vald.</translation> <translation>Ingen utdatafil vald.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="151"/> <location filename="../src/GUI/exportdialog.cpp" line="152"/>
<source>%1 is a directory.</source> <source>%1 is a directory.</source>
<translation>%1 är en mapp.</translation> <translation>%1 är en mapp.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/exportdialog.cpp" line="156"/> <location filename="../src/GUI/exportdialog.cpp" line="157"/>
<source>%1 is not writable.</source> <source>%1 is not writable.</source>
<translation>%1 är skrivskyddad.</translation> <translation>%1 är skrivskyddad.</translation>
</message> </message>

View File

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

View File

@ -30,7 +30,7 @@
; The name of the installer ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "6.0" !define VERSION "6.1"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}.exe" OutFile "GPXSee-${VERSION}.exe"
@ -206,6 +206,7 @@ SectionGroup "Localization" SEC_LOCALIZATION
!insertmacro LOCALIZATION "Finnish" "fi" !insertmacro LOCALIZATION "Finnish" "fi"
!insertmacro LOCALIZATION "French" "fr" !insertmacro LOCALIZATION "French" "fr"
!insertmacro LOCALIZATION "German" "de" !insertmacro LOCALIZATION "German" "de"
!insertmacro LOCALIZATION "Norwegian" "no"
!insertmacro LOCALIZATION "Polish" "pl" !insertmacro LOCALIZATION "Polish" "pl"
!insertmacro LOCALIZATION "Russian" "ru" !insertmacro LOCALIZATION "Russian" "ru"
!insertmacro LOCALIZATION "Swedish" "sv" !insertmacro LOCALIZATION "Swedish" "sv"

View File

@ -30,7 +30,7 @@
; The name of the installer ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "6.0" !define VERSION "6.1"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}_x64.exe" OutFile "GPXSee-${VERSION}_x64.exe"
@ -208,6 +208,7 @@ SectionGroup "Localization" SEC_LOCALIZATION
!insertmacro LOCALIZATION "Finnish" "fi" !insertmacro LOCALIZATION "Finnish" "fi"
!insertmacro LOCALIZATION "French" "fr" !insertmacro LOCALIZATION "French" "fr"
!insertmacro LOCALIZATION "German" "de" !insertmacro LOCALIZATION "German" "de"
!insertmacro LOCALIZATION "Norwegian" "no"
!insertmacro LOCALIZATION "Polish" "pl" !insertmacro LOCALIZATION "Polish" "pl"
!insertmacro LOCALIZATION "Russian" "ru" !insertmacro LOCALIZATION "Russian" "ru"
!insertmacro LOCALIZATION "Swedish" "sv" !insertmacro LOCALIZATION "Swedish" "sv"

View File

@ -5,6 +5,7 @@
#include <QNetworkProxyFactory> #include <QNetworkProxyFactory>
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QLibraryInfo> #include <QLibraryInfo>
#include <QSettings>
#include "map/downloader.h" #include "map/downloader.h"
#include "map/ellipsoid.h" #include "map/ellipsoid.h"
#include "map/gcs.h" #include "map/gcs.h"
@ -12,6 +13,7 @@
#include "opengl.h" #include "opengl.h"
#include "gui.h" #include "gui.h"
#include "config.h" #include "config.h"
#include "settings.h"
#include "app.h" #include "app.h"
@ -36,7 +38,16 @@ App::App(int &argc, char **argv) : QApplication(argc, argv),
#endif // Q_OS_MAC #endif // Q_OS_MAC
QNetworkProxyFactory::setUseSystemConfiguration(true); QNetworkProxyFactory::setUseSystemConfiguration(true);
Downloader::setNetworkAccessManager(new QNetworkAccessManager(this)); QSettings settings(APP_NAME, APP_NAME);
settings.beginGroup(OPTIONS_SETTINGS_GROUP);
#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); OPENGL_SET_SAMPLES(4);
loadDatums(); loadDatums();
loadPCSs(); loadPCSs();

View File

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

View File

@ -147,44 +147,47 @@ void GUI::createMapActions()
_mapsActionGroup = new QActionGroup(this); _mapsActionGroup = new QActionGroup(this);
_mapsActionGroup->setExclusive(true); _mapsActionGroup->setExclusive(true);
for (int i = 0; i < _ml->maps().count(); i++) { for (int i = 0; i < _ml->maps().count(); i++)
QAction *a = new QAction(_ml->maps().at(i)->name(), this); createMapAction(_ml->maps().at(i));
a->setMenuRole(QAction::NoRole);
a->setCheckable(true);
a->setActionGroup(_mapsActionGroup);
_mapsSignalMapper->setMapping(a, i);
connect(a, SIGNAL(triggered()), _mapsSignalMapper, SLOT(map()));
_mapActions.append(a);
}
connect(_mapsSignalMapper, SIGNAL(mapped(int)), this, connect(_mapsSignalMapper, SIGNAL(mapped(int)), this,
SLOT(mapChanged(int))); 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() void GUI::createPOIFilesActions()
{ {
_poiFilesSignalMapper = new QSignalMapper(this); _poiFilesSignalMapper = new QSignalMapper(this);
for (int i = 0; i < _poi->files().count(); i++) for (int i = 0; i < _poi->files().count(); i++)
createPOIFileAction(i); createPOIFileAction(_poi->files().at(i));
connect(_poiFilesSignalMapper, SIGNAL(mapped(int)), this, connect(_poiFilesSignalMapper, SIGNAL(mapped(int)), this,
SLOT(poiFileChecked(int))); SLOT(poiFileChecked(int)));
} }
QAction *GUI::createPOIFileAction(int index) QAction *GUI::createPOIFileAction(const QString &fileName)
{ {
QAction *a = new QAction(QFileInfo(_poi->files().at(index)).fileName(), QAction *a = new QAction(QFileInfo(fileName).fileName(), this);
this);
a->setMenuRole(QAction::NoRole); a->setMenuRole(QAction::NoRole);
a->setCheckable(true); a->setCheckable(true);
_poiFilesSignalMapper->setMapping(a, index);
connect(a, SIGNAL(triggered()), _poiFilesSignalMapper, SLOT(map()));
_poiFilesActions.append(a); _poiFilesActions.append(a);
_poiFilesSignalMapper->setMapping(a, _poiFilesActions.size() - 1);
connect(a, SIGNAL(triggered()), _poiFilesSignalMapper, SLOT(map()));
return a; return a;
} }
@ -838,7 +841,15 @@ bool GUI::openPOIFile(const QString &fileName)
if (fileName.isEmpty() || _poi->files().contains(fileName)) if (fileName.isEmpty() || _poi->files().contains(fileName))
return false; 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" QString error = tr("Error loading POI file:") + "\n\n"
+ fileName + "\n\n" + _poi->errorString(); + fileName + "\n\n" + _poi->errorString();
if (_poi->errorLine()) if (_poi->errorLine())
@ -846,14 +857,6 @@ bool GUI::openPOIFile(const QString &fileName)
QMessageBox::critical(this, APP_NAME, error); QMessageBox::critical(this, APP_NAME, error);
return false; return false;
} else {
_mapView->showPOI(true);
_showPOIAction->setChecked(true);
QAction *action = createPOIFileAction(_poi->files().indexOf(fileName));
action->setChecked(true);
_poiFilesMenu->addAction(action);
return true;
} }
} }
@ -1294,18 +1297,11 @@ bool GUI::loadMap(const QString &fileName)
return false; return false;
if (_ml->loadFile(fileName)) { if (_ml->loadFile(fileName)) {
QAction *a = new QAction(_ml->maps().last()->name(), this); QAction *a = createMapAction(_ml->maps().last());
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);
_mapMenu->insertAction(_mapsEnd, a); _mapMenu->insertAction(_mapsEnd, a);
_showMapAction->setEnabled(true); _showMapAction->setEnabled(true);
_clearMapCacheAction->setEnabled(true); _clearMapCacheAction->setEnabled(true);
_mapActions.last()->trigger(); a->trigger();
return true; return true;
} else { } else {
QString error = tr("Error loading map:") + "\n\n" QString error = tr("Error loading map:") + "\n\n"
@ -2089,10 +2085,6 @@ void GUI::readSettings()
_poi->setRadius(_options.poiRadius); _poi->setRadius(_options.poiRadius);
QPixmapCache::setCacheLimit(_options.pixmapCache * 1024); QPixmapCache::setCacheLimit(_options.pixmapCache * 1024);
Downloader::setTimeout(_options.connectionTimeout);
#ifdef ENABLE_HTTP2
Downloader::enableHTTP2(_options.enableHTTP2);
#endif // ENABLE_HTTP2
settings.endGroup(); settings.endGroup();
} }

View File

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

View File

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

View File

@ -18,7 +18,7 @@
#define MAX_DIGITAL_ZOOM 2 #define MAX_DIGITAL_ZOOM 2
#define MIN_DIGITAL_ZOOM -3 #define MIN_DIGITAL_ZOOM -3
#define MARGIN 10.0 #define MARGIN 10
#define SCALE_OFFSET 7 #define SCALE_OFFSET 7
MapView::MapView(Map *map, POI *poi, QWidget *parent) MapView::MapView(Map *map, POI *poi, QWidget *parent)

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@ class Range
{ {
public: public:
Range() {_min = 0; _max = 0;} 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 min() const {return _min;}
int max() const {return _max;} int max() const {return _max;}
@ -29,7 +29,7 @@ class RangeF
{ {
public: public:
RangeF() {_min = 0; _max = 0;} 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) const;
RangeF &operator&=(const RangeF &r) {*this = *this & r; return *this;} RangeF &operator&=(const RangeF &r) {*this = *this & r; return *this;}

View File

@ -98,9 +98,9 @@ bool Data::loadFile(const QString &fileName)
file.reset(); 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++) 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())); it.value()->errorLine(), qPrintable(it.value()->errorString()));
_errorLine = 0; _errorLine = 0;

View File

@ -9,7 +9,6 @@
#include "waypoint.h" #include "waypoint.h"
#include "path.h" #include "path.h"
class WaypointItem;
class POI : public QObject class POI : public QObject
{ {

View File

@ -3,7 +3,7 @@
void SLFParser::warning(const char *text) const void SLFParser::warning(const char *text) const
{ {
const QFile *file = static_cast<QFile *>(_reader.device()); 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); _reader.lineNumber(), text);
} }

View File

@ -4,7 +4,7 @@
void TCXParser::warning(const char *text) const void TCXParser::warning(const char *text) const
{ {
const QFile *file = static_cast<QFile *>(_reader.device()); 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); _reader.lineNumber(), text);
} }

View File

@ -20,8 +20,10 @@
#define ATTR_REDIRECT QNetworkRequest::RedirectionTargetAttribute #define ATTR_REDIRECT QNetworkRequest::RedirectionTargetAttribute
#define ATTR_FILE QNetworkRequest::User #define ATTR_FILE QNetworkRequest::User
#define ATTR_ORIGIN (QNetworkRequest::Attribute)(QNetworkRequest::User + 1) #define ATTR_ORIGIN \
#define ATTR_LEVEL (QNetworkRequest::Attribute)(QNetworkRequest::User + 2) static_cast<QNetworkRequest::Attribute>(QNetworkRequest::User + 1)
#define ATTR_LEVEL \
static_cast<QNetworkRequest::Attribute>(QNetworkRequest::User + 2)
#define MAX_REDIRECT_LEVEL 5 #define MAX_REDIRECT_LEVEL 5
#define RETRIES 3 #define RETRIES 3
@ -78,19 +80,25 @@ private:
}; };
QNetworkAccessManager *Downloader::_manager = 0;
int Downloader::_timeout = 30; int Downloader::_timeout = 30;
#ifdef ENABLE_HTTP2 #ifdef ENABLE_HTTP2
bool Downloader::_http2 = true; bool Downloader::_http2 = true;
#endif // ENABLE_HTTP2 #endif // ENABLE_HTTP2
QNetworkAccessManager *Downloader::manager()
{
static QNetworkAccessManager manager;
return &manager;
}
bool Downloader::doDownload(const Download &dl, bool Downloader::doDownload(const Download &dl,
const QByteArray &authorization, const Redirect *redirect) const QByteArray &authorization, const Redirect *redirect)
{ {
QUrl url(dl.url()); const QUrl &url = dl.url();
if (!url.isValid() || !(url.scheme() == "http" || url.scheme() == "https")) { if (!url.isValid() || !(url.scheme() == QLatin1String("http")
qWarning("%s: Invalid URL\n", qPrintable(url.toString())); || url.scheme() == QLatin1String("https"))) {
qWarning("%s: Invalid URL", qPrintable(url.toString()));
if (redirect) if (redirect)
_errorDownloads.insert(redirect->origin(), RETRIES); _errorDownloads.insert(redirect->origin(), RETRIES);
return false; return false;
@ -115,7 +123,7 @@ bool Downloader::doDownload(const Download &dl,
QVariant(_http2)); QVariant(_http2));
#endif // ENABLE_HTTP2 #endif // ENABLE_HTTP2
QNetworkReply *reply = _manager->get(request); QNetworkReply *reply = manager()->get(request);
if (reply && reply->isRunning()) { if (reply && reply->isRunning()) {
_currentDownloads.insert(url); _currentDownloads.insert(url);
ReplyTimeout::setTimeout(reply, _timeout); ReplyTimeout::setTimeout(reply, _timeout);
@ -138,7 +146,7 @@ bool Downloader::saveToDisk(const QString &filename, QIODevice *data)
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::WriteOnly)) { if (!file.open(QIODevice::WriteOnly)) {
qWarning("Error writing file: %s: %s\n", qWarning("Error writing file: %s: %s",
qPrintable(filename), qPrintable(file.errorString())); qPrintable(filename), qPrintable(file.errorString()));
return false; return false;
} }
@ -159,34 +167,33 @@ void Downloader::insertError(const QUrl &url, QNetworkReply::NetworkError error)
void Downloader::downloadFinished(QNetworkReply *reply) void Downloader::downloadFinished(QNetworkReply *reply)
{ {
QUrl url = reply->request().url(); QUrl url(reply->request().url());
QNetworkReply::NetworkError error = reply->error(); QNetworkReply::NetworkError error = reply->error();
if (error) { if (error) {
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl(); QUrl origin(reply->request().attribute(ATTR_ORIGIN).toUrl());
if (origin.isEmpty()) { if (origin.isEmpty()) {
insertError(url, error); insertError(url, error);
qWarning("Error downloading file: %s: %s\n", qWarning("Error downloading file: %s: %s",
url.toEncoded().constData(), qPrintable(reply->errorString())); url.toEncoded().constData(), qPrintable(reply->errorString()));
} else { } else {
insertError(origin, error); insertError(origin, error);
qWarning("Error downloading file: %s -> %s: %s\n", qWarning("Error downloading file: %s -> %s: %s",
origin.toEncoded().constData(), url.toEncoded().constData(), origin.toEncoded().constData(), url.toEncoded().constData(),
qPrintable(reply->errorString())); qPrintable(reply->errorString()));
} }
} else { } else {
QUrl location = reply->attribute(ATTR_REDIRECT).toUrl(); QUrl location(reply->attribute(ATTR_REDIRECT).toUrl());
QString filename = reply->request().attribute(ATTR_FILE) QString filename(reply->request().attribute(ATTR_FILE).toString());
.toString();
if (!location.isEmpty()) { if (!location.isEmpty()) {
QUrl origin = reply->request().attribute(ATTR_ORIGIN).toUrl(); QUrl origin(reply->request().attribute(ATTR_ORIGIN).toUrl());
int level = reply->request().attribute(ATTR_LEVEL).toInt(); int level = reply->request().attribute(ATTR_LEVEL).toInt();
if (level >= MAX_REDIRECT_LEVEL) { if (level >= MAX_REDIRECT_LEVEL) {
_errorDownloads.insert(origin, RETRIES); _errorDownloads.insert(origin, RETRIES);
qWarning("Error downloading file: %s: " qWarning("Error downloading file: %s: "
"redirect level limit reached (redirect loop?)\n", "redirect level limit reached (redirect loop?)",
origin.toEncoded().constData()); origin.toEncoded().constData());
} else { } else {
QUrl redirectUrl; QUrl redirectUrl;
@ -225,3 +232,11 @@ bool Downloader::get(const QList<Download> &list,
return finishEmitted; return finishEmitted;
} }
#ifdef ENABLE_HTTP2
void Downloader::enableHTTP2(bool enable)
{
_http2 = enable;
manager()->clearConnectionCache();
}
#endif // ENABLE_HTTP2

View File

@ -15,8 +15,8 @@ class Download
public: public:
Download(const QUrl &url, const QString &file) : _url(url), _file(file) {} Download(const QUrl &url, const QString &file) : _url(url), _file(file) {}
const QUrl& url() const {return _url;} const QUrl &url() const {return _url;}
const QString& file() const {return _file;} const QString &file() const {return _file;}
private: private:
QUrl _url; QUrl _url;
@ -48,10 +48,8 @@ public:
static void setTimeout(int timeout) {_timeout = timeout;} static void setTimeout(int timeout) {_timeout = timeout;}
#ifdef ENABLE_HTTP2 #ifdef ENABLE_HTTP2
static void enableHTTP2(bool enable) {_http2 = enable;} static void enableHTTP2(bool enable);
#endif // ENABLE_HTTP2 #endif // ENABLE_HTTP2
static void setNetworkAccessManager(QNetworkAccessManager *manager)
{_manager = manager;}
signals: signals:
void finished(); void finished();
@ -69,6 +67,8 @@ private:
const Redirect *redirect = 0); const Redirect *redirect = 0);
bool saveToDisk(const QString &filename, QIODevice *data); bool saveToDisk(const QString &filename, QIODevice *data);
static QNetworkAccessManager *manager();
QSet<QUrl> _currentDownloads; QSet<QUrl> _currentDownloads;
QHash<QUrl, int> _errorDownloads; QHash<QUrl, int> _errorDownloads;
@ -76,7 +76,6 @@ private:
#ifdef ENABLE_HTTP2 #ifdef ENABLE_HTTP2
static bool _http2; static bool _http2;
#endif // ENABLE_HTTP2 #endif // ENABLE_HTTP2
static QNetworkAccessManager *_manager;
}; };
#endif // DOWNLOADER_H #endif // DOWNLOADER_H

View File

@ -1,41 +1,18 @@
#include <QtGlobal> #include <QtGlobal>
#include <QPainter> #include <QPainter>
#include "common/coordinates.h"
#include "common/rectc.h" #include "common/rectc.h"
#include "common/wgs84.h" #include "osm.h"
#include "emptymap.h" #include "emptymap.h"
#define ZOOM_MIN 0
#define ZOOM_MAX 19
#define TILE_SIZE 256 #define TILE_SIZE 256
static QPointF ll2m(const Coordinates &c)
{
return QPointF(c.lon(), rad2deg(log(tan(M_PI_4 + deg2rad(c.lat())/2.0))));
}
static Coordinates m2ll(const QPointF &p)
{
return Coordinates(p.x(), rad2deg(2.0 * atan(exp(deg2rad(p.y()))) - M_PI_2));
}
static qreal zoom2scale(int zoom)
{
return (360.0/(qreal)((1<<zoom) * TILE_SIZE));
}
static int scale2zoom(qreal scale)
{
return (int)log2(360.0/(scale * (qreal)TILE_SIZE));
}
static int limitZoom(int zoom) static int limitZoom(int zoom)
{ {
if (zoom < ZOOM_MIN) if (zoom < OSM::ZOOMS.min())
return ZOOM_MIN; return OSM::ZOOMS.min();
if (zoom > ZOOM_MAX) if (zoom > OSM::ZOOMS.max())
return ZOOM_MAX; return OSM::ZOOMS.max();
return zoom; return zoom;
} }
@ -43,23 +20,23 @@ static int limitZoom(int zoom)
EmptyMap::EmptyMap(QObject *parent) : Map(parent) EmptyMap::EmptyMap(QObject *parent) : Map(parent)
{ {
_zoom = ZOOM_MAX; _zoom = OSM::ZOOMS.max();
} }
QRectF EmptyMap::bounds() QRectF EmptyMap::bounds()
{ {
return QRectF(ll2xy(Coordinates(-180, 85)), ll2xy(Coordinates(180, -85))); return QRectF(ll2xy(OSM::BOUNDS.topLeft()), ll2xy(OSM::BOUNDS.bottomRight()));
} }
int EmptyMap::zoomFit(const QSize &size, const RectC &rect) int EmptyMap::zoomFit(const QSize &size, const RectC &rect)
{ {
if (!rect.isValid()) if (!rect.isValid())
_zoom = ZOOM_MAX; _zoom = OSM::ZOOMS.max();
else { else {
QRectF tbr(ll2m(rect.topLeft()), ll2m(rect.bottomRight())); QRectF tbr(OSM::ll2m(rect.topLeft()), OSM::ll2m(rect.bottomRight()));
QPointF sc(tbr.width() / size.width(), tbr.height() / size.height()); QPointF sc(tbr.width() / size.width(), tbr.height() / size.height());
_zoom = limitZoom(scale2zoom(qMax(sc.x(), -sc.y()))); _zoom = limitZoom(OSM::scale2zoom(qMax(sc.x(), -sc.y()), TILE_SIZE));
} }
return _zoom; return _zoom;
@ -67,21 +44,18 @@ int EmptyMap::zoomFit(const QSize &size, const RectC &rect)
qreal EmptyMap::resolution(const QRectF &rect) qreal EmptyMap::resolution(const QRectF &rect)
{ {
qreal scale = zoom2scale(_zoom); return OSM::resolution(rect.center(), _zoom, TILE_SIZE);
return (WGS84_RADIUS * 2.0 * M_PI * scale / 360.0
* cos(2.0 * atan(exp(deg2rad(-rect.center().y() * scale))) - M_PI/2));
} }
int EmptyMap::zoomIn() int EmptyMap::zoomIn()
{ {
_zoom = qMin(_zoom + 1, ZOOM_MAX); _zoom = qMin(_zoom + 1, OSM::ZOOMS.max());
return _zoom; return _zoom;
} }
int EmptyMap::zoomOut() int EmptyMap::zoomOut()
{ {
_zoom = qMax(_zoom - 1, ZOOM_MIN); _zoom = qMax(_zoom - 1, OSM::ZOOMS.min());
return _zoom; return _zoom;
} }
@ -94,13 +68,13 @@ void EmptyMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
QPointF EmptyMap::ll2xy(const Coordinates &c) QPointF EmptyMap::ll2xy(const Coordinates &c)
{ {
qreal scale = zoom2scale(_zoom); qreal scale = OSM::zoom2scale(_zoom, TILE_SIZE);
QPointF m = ll2m(c); QPointF m = OSM::ll2m(c);
return QPointF(m.x() / scale, m.y() / -scale); return QPointF(m.x() / scale, m.y() / -scale);
} }
Coordinates EmptyMap::xy2ll(const QPointF &p) Coordinates EmptyMap::xy2ll(const QPointF &p)
{ {
qreal scale = zoom2scale(_zoom); qreal scale = OSM::zoom2scale(_zoom, TILE_SIZE);
return m2ll(QPointF(p.x() * scale, -p.y() * scale)); return OSM::m2ll(QPointF(p.x() * scale, -p.y() * scale));
} }

View File

@ -8,7 +8,7 @@
#include "mapsource.h" #include "mapsource.h"
MapSource::Config::Config() : type(OSM), zooms(osm::zooms), bounds(osm::bounds), MapSource::Config::Config() : type(OSM), zooms(OSM::ZOOMS), bounds(OSM::BOUNDS),
format("image/png"), rest(false), tileRatio(1.0) {} format("image/png"), rest(false), tileRatio(1.0) {}
@ -31,21 +31,21 @@ Range MapSource::zooms(QXmlStreamReader &reader)
if (attr.hasAttribute("min")) { if (attr.hasAttribute("min")) {
min = attr.value("min").toString().toInt(&res); min = attr.value("min").toString().toInt(&res);
if (!res || !osm::zooms.contains(min)) { if (!res || !OSM::ZOOMS.contains(min)) {
reader.raiseError("Invalid minimal zoom level"); reader.raiseError("Invalid minimal zoom level");
return Range(); return Range();
} }
} else } else
min = osm::zooms.min(); min = OSM::ZOOMS.min();
if (attr.hasAttribute("max")) { if (attr.hasAttribute("max")) {
max = attr.value("max").toString().toInt(&res); max = attr.value("max").toString().toInt(&res);
if (!res || !osm::zooms.contains(max)) { if (!res || !OSM::ZOOMS.contains(max)) {
reader.raiseError("Invalid maximal zoom level"); reader.raiseError("Invalid maximal zoom level");
return Range(); return Range();
} }
} else } else
max = osm::zooms.max(); max = OSM::ZOOMS.max();
if (min > max) { if (min > max) {
reader.raiseError("Invalid maximal/minimal zoom level combination"); reader.raiseError("Invalid maximal/minimal zoom level combination");
@ -63,41 +63,41 @@ RectC MapSource::bounds(QXmlStreamReader &reader)
if (attr.hasAttribute("top")) { if (attr.hasAttribute("top")) {
top = attr.value("top").toString().toDouble(&res); top = attr.value("top").toString().toDouble(&res);
if (!res || (top < osm::bounds.bottom() || top > osm::bounds.top())) { if (!res || (top < OSM::BOUNDS.bottom() || top > OSM::BOUNDS.top())) {
reader.raiseError("Invalid bounds top value"); reader.raiseError("Invalid bounds top value");
return RectC(); return RectC();
} }
} else } else
top = osm::bounds.top(); top = OSM::BOUNDS.top();
if (attr.hasAttribute("bottom")) { if (attr.hasAttribute("bottom")) {
bottom = attr.value("bottom").toString().toDouble(&res); bottom = attr.value("bottom").toString().toDouble(&res);
if (!res || (bottom < osm::bounds.bottom() if (!res || (bottom < OSM::BOUNDS.bottom()
|| bottom > osm::bounds.top())) { || bottom > OSM::BOUNDS.top())) {
reader.raiseError("Invalid bounds bottom value"); reader.raiseError("Invalid bounds bottom value");
return RectC(); return RectC();
} }
} else } else
bottom = osm::bounds.bottom(); bottom = OSM::BOUNDS.bottom();
if (attr.hasAttribute("left")) { if (attr.hasAttribute("left")) {
left = attr.value("left").toString().toDouble(&res); left = attr.value("left").toString().toDouble(&res);
if (!res || (left < osm::bounds.left() || left > osm::bounds.right())) { if (!res || (left < OSM::BOUNDS.left() || left > OSM::BOUNDS.right())) {
reader.raiseError("Invalid bounds left value"); reader.raiseError("Invalid bounds left value");
return RectC(); return RectC();
} }
} else } else
left = osm::bounds.left(); left = OSM::BOUNDS.left();
if (attr.hasAttribute("right")) { if (attr.hasAttribute("right")) {
right = attr.value("right").toString().toDouble(&res); right = attr.value("right").toString().toDouble(&res);
if (!res || (right < osm::bounds.left() if (!res || (right < OSM::BOUNDS.left()
|| right > osm::bounds.right())) { || right > OSM::BOUNDS.right())) {
reader.raiseError("Invalid bounds right value"); reader.raiseError("Invalid bounds right value");
return RectC(); return RectC();
} }
} else } else
right = osm::bounds.right(); right = OSM::BOUNDS.right();
if (bottom >= top) { if (bottom >= top) {
reader.raiseError("Invalid bottom/top bounds combination"); reader.raiseError("Invalid bottom/top bounds combination");
@ -156,8 +156,8 @@ void MapSource::map(QXmlStreamReader &reader, Config &config)
if (!attr.hasAttribute("id")) if (!attr.hasAttribute("id"))
reader.raiseError("Missing dimension id"); reader.raiseError("Missing dimension id");
else else
config.dimensions.append(QPair<QString, QString>( config.dimensions.append(KV(attr.value("id").toString(),
attr.value("id").toString(), reader.readElementText())); reader.readElementText()));
} else if (reader.name() == "crs") { } else if (reader.name() == "crs") {
config.coordinateSystem = coordinateSystem(reader); config.coordinateSystem = coordinateSystem(reader);
config.crs = reader.readElementText(); config.crs = reader.readElementText();

View File

@ -4,6 +4,7 @@
#include <QList> #include <QList>
#include "common/range.h" #include "common/range.h"
#include "common/rectc.h" #include "common/rectc.h"
#include "common/kv.h"
#include "downloader.h" #include "downloader.h"
#include "coordinatesystem.h" #include "coordinatesystem.h"
@ -36,7 +37,7 @@ private:
QString crs; QString crs;
CoordinateSystem coordinateSystem; CoordinateSystem coordinateSystem;
bool rest; bool rest;
QList<QPair<QString, QString> > dimensions; QList<KV> dimensions;
Authorization authorization; Authorization authorization;
qreal tileRatio; qreal tileRatio;

View File

@ -5,7 +5,6 @@
#include <QPainter> #include <QPainter>
#include <QPixmapCache> #include <QPixmapCache>
#include "common/rectc.h" #include "common/rectc.h"
#include "common/wgs84.h"
#include "osm.h" #include "osm.h"
#include "config.h" #include "config.h"
#include "mbtilesmap.h" #include "mbtilesmap.h"
@ -74,11 +73,11 @@ MBTilesMap::MBTilesMap(const QString &fileName, QObject *parent)
qMax(0, query.value(2).toInt())) + 1, _zooms.min()); qMax(0, query.value(2).toInt())) + 1, _zooms.min());
double maxY = index2mercator(qMin((1<<_zooms.min()) - 1, double maxY = index2mercator(qMin((1<<_zooms.min()) - 1,
qMax(0, query.value(3).toInt())) + 1, _zooms.min()); qMax(0, query.value(3).toInt())) + 1, _zooms.min());
Coordinates tl(osm::m2ll(QPointF(minX, maxY))); Coordinates tl(OSM::m2ll(QPointF(minX, maxY)));
Coordinates br(osm::m2ll(QPointF(maxX, minY))); Coordinates br(OSM::m2ll(QPointF(maxX, minY)));
// Workaround of broken zoom levels 0 and 1 due to numerical instability // Workaround of broken zoom levels 0 and 1 due to numerical instability
tl.rlat() = qMin(tl.lat(), osm::bounds.top()); tl.rlat() = qMin(tl.lat(), OSM::BOUNDS.top());
br.rlat() = qMax(br.lat(), osm::bounds.bottom()); br.rlat() = qMax(br.lat(), OSM::BOUNDS.bottom());
_bounds = RectC(tl, br); _bounds = RectC(tl, br);
} }
@ -152,9 +151,9 @@ int MBTilesMap::zoomFit(const QSize &size, const RectC &rect)
if (!rect.isValid()) if (!rect.isValid())
_zoom = _zooms.max(); _zoom = _zooms.max();
else { else {
QRectF tbr(osm::ll2m(rect.topLeft()), osm::ll2m(rect.bottomRight())); QRectF tbr(OSM::ll2m(rect.topLeft()), OSM::ll2m(rect.bottomRight()));
QPointF sc(tbr.width() / size.width(), tbr.height() / size.height()); QPointF sc(tbr.width() / size.width(), tbr.height() / size.height());
_zoom = limitZoom(osm::scale2zoom(qMax(sc.x(), -sc.y()) _zoom = limitZoom(OSM::scale2zoom(qMax(sc.x(), -sc.y())
/ coordinatesRatio(), _tileSize)); / coordinatesRatio(), _tileSize));
} }
@ -163,10 +162,7 @@ int MBTilesMap::zoomFit(const QSize &size, const RectC &rect)
qreal MBTilesMap::resolution(const QRectF &rect) qreal MBTilesMap::resolution(const QRectF &rect)
{ {
qreal scale = osm::zoom2scale(_zoom, _tileSize); return OSM::resolution(rect.center(), _zoom, _tileSize);
return (WGS84_RADIUS * 2.0 * M_PI * scale / 360.0
* cos(2.0 * atan(exp(deg2rad(-rect.center().y() * scale))) - M_PI/2));
} }
int MBTilesMap::zoomIn() int MBTilesMap::zoomIn()
@ -215,11 +211,11 @@ QByteArray MBTilesMap::tileData(int zoom, const QPoint &tile) const
void MBTilesMap::draw(QPainter *painter, const QRectF &rect, Flags flags) void MBTilesMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
{ {
Q_UNUSED(flags); Q_UNUSED(flags);
qreal scale = osm::zoom2scale(_zoom, _tileSize); qreal scale = OSM::zoom2scale(_zoom, _tileSize);
QRectF b(bounds()); QRectF b(bounds());
QPoint tile = osm::mercator2tile(QPointF(rect.topLeft().x() * scale, QPoint tile = OSM::mercator2tile(QPointF(rect.topLeft().x() * scale,
-rect.topLeft().y() * scale) * coordinatesRatio(), _zoom); -rect.topLeft().y() * scale) * coordinatesRatio(), _zoom);
QPointF tl(floor(rect.left() / tileSize()) QPointF tl(floor(rect.left() / tileSize())
* tileSize(), floor(rect.top() / tileSize()) * tileSize()); * tileSize(), floor(rect.top() / tileSize()) * tileSize());
@ -251,14 +247,14 @@ void MBTilesMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
QPointF MBTilesMap::ll2xy(const Coordinates &c) QPointF MBTilesMap::ll2xy(const Coordinates &c)
{ {
qreal scale = osm::zoom2scale(_zoom, _tileSize); qreal scale = OSM::zoom2scale(_zoom, _tileSize);
QPointF m = osm::ll2m(c); QPointF m = OSM::ll2m(c);
return QPointF(m.x() / scale, m.y() / -scale) / coordinatesRatio(); return QPointF(m.x() / scale, m.y() / -scale) / coordinatesRatio();
} }
Coordinates MBTilesMap::xy2ll(const QPointF &p) Coordinates MBTilesMap::xy2ll(const QPointF &p)
{ {
qreal scale = osm::zoom2scale(_zoom, _tileSize); qreal scale = OSM::zoom2scale(_zoom, _tileSize);
return osm::m2ll(QPointF(p.x() * scale, -p.y() * scale) return OSM::m2ll(QPointF(p.x() * scale, -p.y() * scale)
* coordinatesRatio()); * coordinatesRatio());
} }

View File

@ -1,7 +1,6 @@
#include <QtCore>
#include <QPainter> #include <QPainter>
#include "common/coordinates.h"
#include "common/rectc.h" #include "common/rectc.h"
#include "common/wgs84.h"
#include "downloader.h" #include "downloader.h"
#include "osm.h" #include "osm.h"
#include "config.h" #include "config.h"
@ -15,22 +14,12 @@ OnlineMap::OnlineMap(const QString &name, const QString &url,
const Authorization &authorization, bool invertY, QObject *parent) const Authorization &authorization, bool invertY, QObject *parent)
: Map(parent), _name(name), _zooms(zooms), _bounds(bounds), : Map(parent), _name(name), _zooms(zooms), _bounds(bounds),
_zoom(_zooms.max()), _deviceRatio(1.0), _tileRatio(tileRatio), _zoom(_zooms.max()), _deviceRatio(1.0), _tileRatio(tileRatio),
_invertY(invertY), _valid(false) _invertY(invertY)
{ {
QString dir(TILES_DIR + "/" + _name); _tileLoader = new TileLoader(TILES_DIR + "/" + _name, this);
_tileLoader = new TileLoader(this);
_tileLoader->setUrl(url); _tileLoader->setUrl(url);
_tileLoader->setDir(dir);
_tileLoader->setAuthorization(authorization); _tileLoader->setAuthorization(authorization);
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded())); connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded()));
if (!QDir().mkpath(dir)) {
_errorString = "Error creating tiles dir";
return;
}
_valid = true;
} }
QRectF OnlineMap::bounds() QRectF OnlineMap::bounds()
@ -53,9 +42,9 @@ int OnlineMap::zoomFit(const QSize &size, const RectC &rect)
if (!rect.isValid()) if (!rect.isValid())
_zoom = _zooms.max(); _zoom = _zooms.max();
else { else {
QRectF tbr(osm::ll2m(rect.topLeft()), osm::ll2m(rect.bottomRight())); QRectF tbr(OSM::ll2m(rect.topLeft()), OSM::ll2m(rect.bottomRight()));
QPointF sc(tbr.width() / size.width(), tbr.height() / size.height()); QPointF sc(tbr.width() / size.width(), tbr.height() / size.height());
_zoom = limitZoom(osm::scale2zoom(qMax(sc.x(), -sc.y()) _zoom = limitZoom(OSM::scale2zoom(qMax(sc.x(), -sc.y())
/ coordinatesRatio(), TILE_SIZE)); / coordinatesRatio(), TILE_SIZE));
} }
@ -64,10 +53,7 @@ int OnlineMap::zoomFit(const QSize &size, const RectC &rect)
qreal OnlineMap::resolution(const QRectF &rect) qreal OnlineMap::resolution(const QRectF &rect)
{ {
qreal scale = osm::zoom2scale(_zoom, TILE_SIZE); return OSM::resolution(rect.center(), _zoom, TILE_SIZE);
return (WGS84_RADIUS * 2.0 * M_PI * scale / 360.0
* cos(2.0 * atan(exp(deg2rad(-rect.center().y() * scale))) - M_PI/2));
} }
int OnlineMap::zoomIn() int OnlineMap::zoomIn()
@ -99,21 +85,25 @@ qreal OnlineMap::tileSize() const
void OnlineMap::draw(QPainter *painter, const QRectF &rect, Flags flags) void OnlineMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
{ {
qreal scale = osm::zoom2scale(_zoom, TILE_SIZE); qreal scale = OSM::zoom2scale(_zoom, TILE_SIZE);
QRectF b(bounds()); QRectF b(bounds());
QPoint tile = osm::mercator2tile(QPointF(rect.topLeft().x() * scale, QPoint tile = OSM::mercator2tile(QPointF(rect.topLeft().x() * scale,
-rect.topLeft().y() * scale) * coordinatesRatio(), _zoom); -rect.topLeft().y() * scale) * coordinatesRatio(), _zoom);
QPointF tl(floor(rect.left() / tileSize()) QPointF tl(floor(rect.left() / tileSize())
* tileSize(), floor(rect.top() / tileSize()) * tileSize()); * tileSize(), floor(rect.top() / tileSize()) * tileSize());
QList<Tile> tiles;
QSizeF s(qMin(rect.right() - tl.x(), b.width()), QSizeF s(qMin(rect.right() - tl.x(), b.width()),
qMin(rect.bottom() - tl.y(), b.height())); qMin(rect.bottom() - tl.y(), b.height()));
for (int i = 0; i < ceil(s.width() / tileSize()); i++) int width = qCeil(s.width() / tileSize());
for (int j = 0; j < ceil(s.height() / tileSize()); j++) int height = qCeil(s.height() / tileSize());
tiles.append(Tile(QPoint(tile.x() + i,
_invertY ? (1<<_zoom) - (tile.y() + j) - 1 : tile.y() + j), _zoom)); QVector<Tile> tiles;
tiles.reserve(width * height);
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++)
tiles.append(Tile(QPoint(tile.x() + i, _invertY ? (1<<_zoom)
- (tile.y() + j) - 1 : tile.y() + j), _zoom));
if (flags & Map::Block) if (flags & Map::Block)
_tileLoader->loadTilesSync(tiles); _tileLoader->loadTilesSync(tiles);
@ -122,9 +112,10 @@ void OnlineMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
for (int i = 0; i < tiles.count(); i++) { for (int i = 0; i < tiles.count(); i++) {
Tile &t = tiles[i]; Tile &t = tiles[i];
QPointF tp(qMax(tl.x(), b.left()) + (t.xy().x() - tile.x()) * tileSize(), QPointF tp = _zoom ? QPointF(tl.x() + (t.xy().x() - tile.x())
qMax(tl.y(), b.top()) + ((_invertY ? (1<<_zoom) - t.xy().y() - 1 : * tileSize(), tl.y() + ((_invertY ? (1<<_zoom) - t.xy().y() - 1 :
t.xy().y()) - tile.y()) * tileSize()); t.xy().y()) - tile.y()) * tileSize()) : QPointF(-128, -128);
if (!t.pixmap().isNull()) { if (!t.pixmap().isNull()) {
#ifdef ENABLE_HIDPI #ifdef ENABLE_HIDPI
t.pixmap().setDevicePixelRatio(imageRatio()); t.pixmap().setDevicePixelRatio(imageRatio());
@ -136,14 +127,14 @@ void OnlineMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
QPointF OnlineMap::ll2xy(const Coordinates &c) QPointF OnlineMap::ll2xy(const Coordinates &c)
{ {
qreal scale = osm::zoom2scale(_zoom, TILE_SIZE); qreal scale = OSM::zoom2scale(_zoom, TILE_SIZE);
QPointF m = osm::ll2m(c); QPointF m = OSM::ll2m(c);
return QPointF(m.x() / scale, m.y() / -scale) / coordinatesRatio(); return QPointF(m.x() / scale, m.y() / -scale) / coordinatesRatio();
} }
Coordinates OnlineMap::xy2ll(const QPointF &p) Coordinates OnlineMap::xy2ll(const QPointF &p)
{ {
qreal scale = osm::zoom2scale(_zoom, TILE_SIZE); qreal scale = OSM::zoom2scale(_zoom, TILE_SIZE);
return osm::m2ll(QPointF(p.x() * scale, -p.y() * scale) return OSM::m2ll(QPointF(p.x() * scale, -p.y() * scale)
* coordinatesRatio()); * coordinatesRatio());
} }

View File

@ -34,9 +34,6 @@ public:
void setDevicePixelRatio(qreal ratio) {_deviceRatio = ratio;} void setDevicePixelRatio(qreal ratio) {_deviceRatio = ratio;}
void clearCache() {_tileLoader->clearCache();} void clearCache() {_tileLoader->clearCache();}
bool isValid() const {return _valid;}
QString errorString() const {return _errorString;}
private: private:
int limitZoom(int zoom) const; int limitZoom(int zoom) const;
qreal tileSize() const; qreal tileSize() const;
@ -50,9 +47,6 @@ private:
int _zoom; int _zoom;
qreal _deviceRatio, _tileRatio; qreal _deviceRatio, _tileRatio;
bool _invertY; bool _invertY;
bool _valid;
QString _errorString;
}; };
#endif // ONLINEMAP_H #endif // ONLINEMAP_H

View File

@ -1,29 +1,40 @@
#include <QtCore>
#include "common/wgs84.h"
#include "osm.h" #include "osm.h"
#define EPSILON 1e-6 #define EPSILON 1e-6
QPointF osm::ll2m(const Coordinates &c) QPointF OSM::ll2m(const Coordinates &c)
{ {
return QPointF(c.lon(), rad2deg(log(tan(M_PI_4 + deg2rad(c.lat())/2.0)))); return QPointF(c.lon(), rad2deg(log(tan(M_PI_4 + deg2rad(c.lat())/2.0))));
} }
Coordinates osm::m2ll(const QPointF &p) Coordinates OSM::m2ll(const QPointF &p)
{ {
return Coordinates(p.x(), rad2deg(2.0 * atan(exp(deg2rad(p.y()))) - M_PI_2)); return Coordinates(p.x(), rad2deg(2.0 * atan(exp(deg2rad(p.y()))) - M_PI_2));
} }
QPoint osm::mercator2tile(const QPointF &m, int z) QPoint OSM::mercator2tile(const QPointF &m, int zoom)
{ {
return QPoint((int)(floor((m.x() + 180.0) / 360.0 * (1<<z))), return QPoint(qFloor((m.x() + 180.0) / 360.0 * (1<<zoom)),
(int)(floor((1.0 - (m.y() / 180.0)) / 2.0 * (1<<z)))); qFloor((1.0 - (m.y() / 180.0)) / 2.0 * (1<<zoom)));
} }
qreal osm::zoom2scale(int zoom, int tileSize) qreal OSM::zoom2scale(int zoom, int tileSize)
{ {
return (360.0/(qreal)((1<<zoom) * tileSize)); return (360.0/(qreal)((1<<zoom) * tileSize));
} }
int osm::scale2zoom(qreal scale, int tileSize) int OSM::scale2zoom(qreal scale, int tileSize)
{ {
return (int)(log2(360.0/(scale * (qreal)tileSize)) + EPSILON); return (int)(log2(360.0/(scale * (qreal)tileSize)) + EPSILON);
} }
qreal OSM::resolution(const QPointF &p, int zoom, int tileSize)
{
qreal scale = zoom2scale(zoom, tileSize);
return (WGS84_RADIUS * 2.0 * M_PI * scale / 360.0
* cos(2.0 * atan(exp(deg2rad(-p.y() * scale))) - M_PI/2));
}

View File

@ -6,17 +6,18 @@
#include <common/rectc.h> #include <common/rectc.h>
#include <common/range.h> #include <common/range.h>
namespace osm namespace OSM
{ {
static const RectC bounds(Coordinates(-180, 85.0511), static const RectC BOUNDS(Coordinates(-180, 85.0511),
Coordinates(180, -85.0511)); Coordinates(180, -85.0511));
static const Range zooms(0, 19); static const Range ZOOMS(0, 19);
QPointF ll2m(const Coordinates &c); QPointF ll2m(const Coordinates &c);
Coordinates m2ll(const QPointF &p); Coordinates m2ll(const QPointF &p);
QPoint mercator2tile(const QPointF &m, int z); QPoint mercator2tile(const QPointF &m, int zoom);
qreal zoom2scale(int zoom, int tileSize); qreal zoom2scale(int zoom, int tileSize);
int scale2zoom(qreal scale, int tileSize); int scale2zoom(qreal scale, int tileSize);
qreal resolution(const QPointF &p, int zoom, int tileSize);
} }
#endif // OSM_H #endif // OSM_H

View File

@ -96,7 +96,7 @@ bool Tar::loadTmi(const QString &path)
QByteArray line = file.readLine(); QByteArray line = file.readLine();
int pos = line.indexOf(':'); int pos = line.indexOf(':');
if (line.size() < 10 || pos < 7 || !line.startsWith("block")) { if (line.size() < 10 || pos < 7 || !line.startsWith("block")) {
qWarning("%s:%d: syntax error\n", qPrintable(path), ln); qWarning("%s:%d: syntax error", qPrintable(path), ln);
_index.clear(); _index.clear();
return false; return false;
} }

View File

@ -10,6 +10,7 @@
class Tile class Tile
{ {
public: public:
Tile() {}
Tile(const QPoint &xy, const QVariant &zoom, const RectD &bbox = RectD()) Tile(const QPoint &xy, const QVariant &zoom, const RectD &bbox = RectD())
{_xy = xy; _zoom = zoom; _bbox = bbox;} {_xy = xy; _zoom = zoom; _bbox = bbox;}

View File

@ -7,20 +7,24 @@
static bool loadTileFile(Tile &tile, const QString &file) static bool loadTileFile(Tile &tile, const QString &file)
{ {
if (!tile.pixmap().load(file)) { if (!tile.pixmap().load(file)) {
qWarning("%s: error loading tile file\n", qPrintable(file)); qWarning("%s: error loading tile file", qPrintable(file));
return false; return false;
} }
return true; return true;
} }
TileLoader::TileLoader(QObject *parent) : QObject(parent) TileLoader::TileLoader(const QString &dir, QObject *parent)
: QObject(parent), _dir(dir)
{ {
if (!QDir().mkpath(_dir))
qWarning("%s: %s", qPrintable(_dir), "Error creating tiles directory");
_downloader = new Downloader(this); _downloader = new Downloader(this);
connect(_downloader, SIGNAL(finished()), this, SIGNAL(finished())); connect(_downloader, SIGNAL(finished()), this, SIGNAL(finished()));
} }
void TileLoader::loadTilesAsync(QList<Tile> &list) void TileLoader::loadTilesAsync(QVector<Tile> &list)
{ {
QList<Download> dl; QList<Download> dl;
@ -28,21 +32,23 @@ void TileLoader::loadTilesAsync(QList<Tile> &list)
Tile &t = list[i]; Tile &t = list[i];
QString file(tileFile(t)); QString file(tileFile(t));
QFileInfo fi(file); QFileInfo fi(file);
QUrl url(tileUrl(t));
if (url.isLocalFile()) if (fi.exists())
loadTileFile(t, url.toLocalFile());
else if (fi.exists())
loadTileFile(t, file); loadTileFile(t, file);
else else {
dl.append(Download(tileUrl(t), file)); QUrl url(tileUrl(t));
if (url.isLocalFile())
loadTileFile(t, url.toLocalFile());
else
dl.append(Download(url, file));
}
} }
if (!dl.empty()) if (!dl.empty())
_downloader->get(dl, _authorization); _downloader->get(dl, _authorization);
} }
void TileLoader::loadTilesSync(QList<Tile> &list) void TileLoader::loadTilesSync(QVector<Tile> &list)
{ {
QList<Download> dl; QList<Download> dl;
@ -50,14 +56,16 @@ void TileLoader::loadTilesSync(QList<Tile> &list)
Tile &t = list[i]; Tile &t = list[i];
QString file(tileFile(t)); QString file(tileFile(t));
QFileInfo fi(file); QFileInfo fi(file);
QUrl url(tileUrl(t));
if (url.isLocalFile()) if (fi.exists())
loadTileFile(t, url.toLocalFile());
else if (fi.exists())
loadTileFile(t, file); loadTileFile(t, file);
else else {
dl.append(Download(tileUrl(t), file)); QUrl url(tileUrl(t));
if (url.isLocalFile())
loadTileFile(t, url.toLocalFile());
else
dl.append(Download(url, file));
}
} }
if (dl.empty()) if (dl.empty())
@ -112,8 +120,7 @@ QUrl TileLoader::tileUrl(const Tile &tile) const
QString TileLoader::tileFile(const Tile &tile) const QString TileLoader::tileFile(const Tile &tile) const
{ {
QString file = _dir + QString("/%1-%2-%3").arg(tile.zoom().toString()) return _dir + QLatin1Char('/') + tile.zoom().toString() + QLatin1Char('-')
.arg(tile.xy().x()).arg(tile.xy().y()); + QString::number(tile.xy().x()) + QLatin1Char('-')
+ QString::number(tile.xy().y());
return file;
} }

View File

@ -11,15 +11,14 @@ class TileLoader : public QObject
Q_OBJECT Q_OBJECT
public: public:
TileLoader(QObject *parent = 0); TileLoader(const QString &dir, QObject *parent = 0);
void setUrl(const QString &url) {_url = url;} void setUrl(const QString &url) {_url = url;}
void setDir(const QString &dir) {_dir = dir;}
void setAuthorization(const Authorization &authorization) void setAuthorization(const Authorization &authorization)
{_authorization = authorization;} {_authorization = authorization;}
void loadTilesAsync(QList<Tile> &list); void loadTilesAsync(QVector<Tile> &list);
void loadTilesSync(QList<Tile> &list); void loadTilesSync(QVector<Tile> &list);
void clearCache(); void clearCache();
signals: signals:

View File

@ -5,6 +5,7 @@
#include <QRectF> #include <QRectF>
#include "common/range.h" #include "common/range.h"
#include "common/rectc.h" #include "common/rectc.h"
#include "common/kv.h"
#include "projection.h" #include "projection.h"
#include "downloader.h" #include "downloader.h"
#include "coordinatesystem.h" #include "coordinatesystem.h"
@ -18,9 +19,8 @@ public:
{ {
public: public:
Setup(const QString &url, const QString &layer, const QString &style, Setup(const QString &url, const QString &layer, const QString &style,
const QString &format, const QString &crs, const QString &format, const QString &crs, const CoordinateSystem &cs,
const CoordinateSystem &cs, const QList<KV> &dimensions,
const QList<QPair<QString, QString> > &dimensions,
const Authorization &authorization = Authorization()) const Authorization &authorization = Authorization())
: _url(url), _layer(layer), _style(style), _format(format), : _url(url), _layer(layer), _style(style), _format(format),
_crs(crs), _cs(cs), _dimensions(dimensions), _crs(crs), _cs(cs), _dimensions(dimensions),
@ -33,8 +33,7 @@ public:
const QString &format() const {return _format;} const QString &format() const {return _format;}
const QString &crs() const {return _crs;} const QString &crs() const {return _crs;}
const CoordinateSystem &coordinateSystem() const {return _cs;} const CoordinateSystem &coordinateSystem() const {return _cs;}
const QList<QPair<QString, QString> > &dimensions() const const QList<KV> &dimensions() const {return _dimensions;}
{return _dimensions;}
private: private:
QString _url; QString _url;
@ -43,7 +42,7 @@ public:
QString _format; QString _format;
QString _crs; QString _crs;
CoordinateSystem _cs; CoordinateSystem _cs;
QList<QPair<QString, QString> > _dimensions; QList<KV> _dimensions;
Authorization _authorization; Authorization _authorization;
}; };

View File

@ -1,3 +1,4 @@
#include <QtCore>
#include <QDir> #include <QDir>
#include <QPainter> #include <QPainter>
#include "common/wgs84.h" #include "common/wgs84.h"
@ -32,8 +33,8 @@ QString WMSMap::tileUrl(const QString &version) const
url.append(QString("&SRS=%1").arg(_setup.crs())); url.append(QString("&SRS=%1").arg(_setup.crs()));
for (int i = 0; i < _setup.dimensions().size(); i++) { for (int i = 0; i < _setup.dimensions().size(); i++) {
const QPair<QString, QString> &dim = _setup.dimensions().at(i); const KV &dim = _setup.dimensions().at(i);
url.append(QString("&%1=%2").arg(dim.first, dim.second)); url.append(QString("&%1=%2").arg(dim.key(), dim.value()));
} }
return url; return url;
@ -50,9 +51,9 @@ void WMSMap::computeZooms(const RangeF &scaleDenominator)
if (scaleDenominator.size() > 0) { if (scaleDenominator.size() > 0) {
double ld = log2(scaleDenominator.max()) - log2(scaleDenominator.min()); double ld = log2(scaleDenominator.max()) - log2(scaleDenominator.min());
int cld = ceil(ld); int cld = (int)ceil(ld);
double step = ld / (qreal)cld; double step = ld / (double)cld;
qreal lmax = log2(scaleDenominator.max()); double lmax = log2(scaleDenominator.max());
for (int i = 0; i <= cld; i++) for (int i = 0; i <= cld; i++)
_zooms.append(pow(2.0, lmax - i * step)); _zooms.append(pow(2.0, lmax - i * step));
} else } else
@ -105,13 +106,7 @@ WMSMap::WMSMap(const QString &name, const WMS::Setup &setup, QObject *parent)
: Map(parent), _name(name), _setup(setup), _tileLoader(0), _zoom(0), : Map(parent), _name(name), _setup(setup), _tileLoader(0), _zoom(0),
_ratio(1.0), _valid(false) _ratio(1.0), _valid(false)
{ {
if (!QDir().mkpath(tilesDir())) { _tileLoader = new TileLoader(tilesDir(), this);
_errorString = "Error creating tiles dir";
return;
}
_tileLoader = new TileLoader(this);
_tileLoader->setDir(tilesDir());
_tileLoader->setAuthorization(_setup.authorization()); _tileLoader->setAuthorization(_setup.authorization());
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded())); connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded()));
@ -124,7 +119,7 @@ void WMSMap::clearCache()
_zoom = 0; _zoom = 0;
if (!loadWMS()) if (!loadWMS())
qWarning("%s: %s\n", qPrintable(_name), qPrintable(_errorString)); qWarning("%s: %s", qPrintable(_name), qPrintable(_errorString));
} }
QRectF WMSMap::bounds() QRectF WMSMap::bounds()
@ -194,12 +189,13 @@ qreal WMSMap::tileSize() const
void WMSMap::draw(QPainter *painter, const QRectF &rect, Flags flags) void WMSMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
{ {
QPoint tl = QPoint((int)floor(rect.left() / tileSize()), QPoint tl = QPoint(qFloor(rect.left() / tileSize()),
(int)floor(rect.top() / tileSize())); qFloor(rect.top() / tileSize()));
QPoint br = QPoint((int)ceil(rect.right() / tileSize()), QPoint br = QPoint(qCeil(rect.right() / tileSize()),
(int)ceil(rect.bottom() / tileSize())); qCeil(rect.bottom() / tileSize()));
QList<Tile> tiles; QVector<Tile> tiles;
tiles.reserve((br.x() - tl.x()) * (br.y() - tl.y()));
for (int i = tl.x(); i < br.x(); i++) { for (int i = tl.x(); i < br.x(); i++) {
for (int j = tl.y(); j < br.y(); j++) { for (int j = tl.y(); j < br.y(); j++) {
PointD ttl(_transform.img2proj(QPointF(i * TILE_SIZE, PointD ttl(_transform.img2proj(QPointF(i * TILE_SIZE,

View File

@ -318,8 +318,8 @@ WMTS::WMTS(const QString &file, const WMTS::Setup &setup) : _valid(false)
setup.url().contains('?') ? "&" : "?" , setup.format(), setup.url().contains('?') ? "&" : "?" , setup.format(),
setup.layer(), style, setup.set()); setup.layer(), style, setup.set());
for (int i = 0; i < setup.dimensions().size(); i++) { for (int i = 0; i < setup.dimensions().size(); i++) {
const QPair<QString, QString> &dim = setup.dimensions().at(i); const KV &dim = setup.dimensions().at(i);
_tileUrl.append(QString("&%1=%2").arg(dim.first, dim.second)); _tileUrl.append(QString("&%1=%2").arg(dim.key(), dim.value()));
} }
} else { } else {
_tileUrl.replace("{Style}", style, Qt::CaseInsensitive); _tileUrl.replace("{Style}", style, Qt::CaseInsensitive);
@ -328,8 +328,8 @@ WMTS::WMTS(const QString &file, const WMTS::Setup &setup) : _valid(false)
_tileUrl.replace("{TileRow}", "$y", Qt::CaseInsensitive); _tileUrl.replace("{TileRow}", "$y", Qt::CaseInsensitive);
_tileUrl.replace("{TileCol}", "$x", Qt::CaseInsensitive); _tileUrl.replace("{TileCol}", "$x", Qt::CaseInsensitive);
for (int i = 0; i < setup.dimensions().size(); i++) { for (int i = 0; i < setup.dimensions().size(); i++) {
const QPair<QString, QString> &dim = setup.dimensions().at(i); const KV &dim = setup.dimensions().at(i);
_tileUrl.replace(QString("{%1}").arg(dim.first), dim.second, _tileUrl.replace(QString("{%1}").arg(dim.key()), dim.value(),
Qt::CaseInsensitive); Qt::CaseInsensitive);
} }
} }

View File

@ -7,6 +7,7 @@
#include <QList> #include <QList>
#include <QHash> #include <QHash>
#include "common/rectc.h" #include "common/rectc.h"
#include "common/kv.h"
#include "projection.h" #include "projection.h"
#include "downloader.h" #include "downloader.h"
#include "coordinatesystem.h" #include "coordinatesystem.h"
@ -21,8 +22,7 @@ public:
public: public:
Setup(const QString &url, const QString &layer, const QString &set, Setup(const QString &url, const QString &layer, const QString &set,
const QString &style, const QString &format, bool rest, const QString &style, const QString &format, bool rest,
const CoordinateSystem &cs, const CoordinateSystem &cs, const QList<KV> &dimensions,
const QList<QPair<QString, QString> > &dimensions,
const Authorization &authorization = Authorization()) const Authorization &authorization = Authorization())
: _url(url), _layer(layer), _set(set), _style(style), : _url(url), _layer(layer), _set(set), _style(style),
_format(format), _rest(rest), _cs(cs), _dimensions(dimensions), _format(format), _rest(rest), _cs(cs), _dimensions(dimensions),
@ -36,8 +36,7 @@ public:
const QString &format() const {return _format;} const QString &format() const {return _format;}
bool rest() const {return _rest;} bool rest() const {return _rest;}
const CoordinateSystem &coordinateSystem() const {return _cs;} const CoordinateSystem &coordinateSystem() const {return _cs;}
const QList<QPair<QString, QString> > &dimensions() const const QList<KV> &dimensions() const {return _dimensions;}
{return _dimensions;}
private: private:
QString _url; QString _url;
@ -47,7 +46,7 @@ public:
QString _format; QString _format;
bool _rest; bool _rest;
CoordinateSystem _cs; CoordinateSystem _cs;
QList<QPair<QString, QString> > _dimensions; QList<KV> _dimensions;
Authorization _authorization; Authorization _authorization;
}; };

View File

@ -1,3 +1,4 @@
#include <QtCore>
#include <QPainter> #include <QPainter>
#include "common/rectc.h" #include "common/rectc.h"
#include "common/wgs84.h" #include "common/wgs84.h"
@ -39,13 +40,7 @@ WMTSMap::WMTSMap(const QString &name, const WMTS::Setup &setup, qreal tileRatio,
QObject *parent) : Map(parent), _name(name), _setup(setup), _tileLoader(0), QObject *parent) : Map(parent), _name(name), _setup(setup), _tileLoader(0),
_zoom(0), _deviceRatio(1.0), _tileRatio(tileRatio), _valid(false) _zoom(0), _deviceRatio(1.0), _tileRatio(tileRatio), _valid(false)
{ {
if (!QDir().mkpath(tilesDir())) { _tileLoader = new TileLoader(tilesDir(), this);
_errorString = "Error creating tiles dir";
return;
}
_tileLoader = new TileLoader(this);
_tileLoader->setDir(tilesDir());
_tileLoader->setAuthorization(_setup.authorization()); _tileLoader->setAuthorization(_setup.authorization());
connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded())); connect(_tileLoader, SIGNAL(finished()), this, SIGNAL(loaded()));
@ -58,7 +53,7 @@ void WMTSMap::clearCache()
_zoom = 0; _zoom = 0;
if (!loadWMTS()) if (!loadWMTS())
qWarning("%s: %s\n", qPrintable(_name), qPrintable(_errorString)); qWarning("%s: %s", qPrintable(_name), qPrintable(_errorString));
} }
QString WMTSMap::tilesDir() const QString WMTSMap::tilesDir() const
@ -174,12 +169,13 @@ void WMTSMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
const WMTS::Zoom &z = _zooms.at(_zoom); const WMTS::Zoom &z = _zooms.at(_zoom);
QSizeF ts(tileSize(z)); QSizeF ts(tileSize(z));
QPoint tl = QPoint((int)floor(rect.left() / ts.width()), QPoint tl = QPoint(qFloor(rect.left() / ts.width()),
(int)floor(rect.top() / ts.height())); qFloor(rect.top() / ts.height()));
QPoint br = QPoint((int)ceil(rect.right() / ts.width()), QPoint br = QPoint(qCeil(rect.right() / ts.width()),
(int)ceil(rect.bottom() / ts.height())); qCeil(rect.bottom() / ts.height()));
QList<Tile> tiles; QVector<Tile> tiles;
tiles.reserve((br.x() - tl.x()) * (br.y() - tl.y()));
for (int i = tl.x(); i < br.x(); i++) for (int i = tl.x(); i < br.x(); i++)
for (int j = tl.y(); j < br.y(); j++) for (int j = tl.y(); j < br.y(); j++)
tiles.append(Tile(QPoint(i, j), z.id())); tiles.append(Tile(QPoint(i, j), z.id()));