tsteven4 [Wed, 2 May 2018 21:45:40 +0000 (15:45 -0600)]
update gperf usage for C++. (#172)
this resolves clang 6.0.0 warnings:
warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
in_word_set(register const char* str, register unsigned int len);
Robert Lipe [Mon, 30 Apr 2018 06:12:35 +0000 (01:12 -0500)]
Fix warning in .Pro build by forcing HAVE_UNISTD
I'm not sure if it's new in Qt 5.9, but it's trivial (I think) to fix and harmless. When building files like gzread and gzwrite, MacOS would complain that we were missing declarations to extremely well known system functions (write, close, read, seek, ...) Those live in <unistd.h>, so we nudge the Makefile generator to trigger its inclusion for MacOS and Linux.
Don't cram different parts of polylines into one route, they
may not be connected.
Add documentation on transformation of coordinate systems that
may be required for GPSBabel usage of shapefiles.
Torsten Metzner [Tue, 20 Mar 2018 21:31:24 +0000 (22:31 +0100)]
Added support for FIT version 2.0
With FIT version 2.0 developer fields where added to the definition
messages. These fields extends the definiton messages and due to this the
number of records which must be parsed afterwards.
FIT files containing developer fields could not be parsed before
this changes.
Simple support was added by just parsing the data but without using them.
It is not expected that any of the currently used data like the
position or the elevation is coded inside the developer fields
because for this we have the already existing records from
FIT version 1.0
Added a test with a fit test file coming from the Wahoo Element Bolt
which uses developer fields from FIT version 2.0
tsteven4 [Sat, 30 Dec 2017 23:21:12 +0000 (16:21 -0700)]
fixes for the position and track filters. (#157)
the position filter could corrupt the route_waypt_ct for routes/tracks.
the track filter underestimated speed when there were multiple
waypoints with the same time.
tsteven4 [Wed, 27 Dec 2017 14:46:02 +0000 (07:46 -0700)]
garmin gpi reader and writer enhancements (#154)
* enhance garmin gpi reader and writer.
1. fix a few memory leaks.
2. properly encode category passed from user to writer.
3. add support for reading gpi files with dual language strings.
4. add support for code page 65001, i.e. utf8.
5. make sure writer embeds encoded string lengths instead of the lengths of source QStrings.
6. enhance test to cover all of the above.
* correct reference mode.
* fix garmin_gpi test for windows.
* rename garmin_gpi country code to language code.
tsteven4 [Mon, 18 Dec 2017 15:15:34 +0000 (08:15 -0700)]
Prefer QLatin1String for conversion from char strings (#152)
* Prefer QLatin1String for conversion from char strings
as opposed to QStringLiteral or QString when used with
QString::compare or QStringRef::compare.
tsteven4 [Sun, 17 Dec 2017 19:28:18 +0000 (12:28 -0700)]
generalize make_windows_release for MinGW or MSVC. (#151)
make_windows_release.ps1 now can be used with MinGW or MSVC. It is likely we will have to switch compilers with Qt >= 5.6 because MinGW is not supported with webengine, and Qt >= 5.6 release packages from www.qt.io distributes webengine and not webkit (although some other parties build webkit from source with these versions of Qt).
appveyor.yml is modified to run a release on one MinGW case (Qt 5.5, webkit) and one MSVC case (Qt 5.6, webengine, 32 bit). In the case of MSVC the VC redistributible installer is run by setup.
Note that inno setup compiler is always run in 32 bit mode, so if you use this with 64 bit executables they will install in the wrong place, i.e. "Program Files (x86)"
tsteven4 [Sun, 17 Dec 2017 16:42:57 +0000 (09:42 -0700)]
allow passing of multiple possible extensions to GUI (#149)
The extensions are used by GUI for filtering files to display for both input and output. The first extension is used by the gui in the output file dialog if a user doesn't supply and extension.
Viet-Tam Luu [Mon, 4 Dec 2017 21:54:19 +0000 (13:54 -0800)]
Better handling of UTF-8 paths (#87)
* Better handling of UTF-8 paths
Remove gpsbabel calls to qPrintable which destroys non-ANSI path names on Windows. Replace with QString::toUtf8() and modify low-level file handling code to use _wfopen() and other wide-char functions on Windows to support non-ASCII paths. (I did an experiment to convince myself that fopen() doesn't do UTF-8, and that _wfopen() correctly creates a file with a non-ASCII filename starting from a UTF-8 name.) Add ufopen() function as a UTF-8 wrapper for fopen(). Change inifile_init() filename argument type to QString.
Leave serial port paths alone ("if your serial port path has non-ANSI characters, you're going to have a bad time").
* Fix valgrind mismatched free/malloc error.
* Correctly encode output paths in native locale on non-Windows
On Mac/Linux, convert output file path from internal UTF-8 to local encoding (which may be UTF-8 or something else) when creating the file. Fixes test_encoding failure.
* Support Unicode paths for .gz files on Windows
Use zlib's Windows-specific gzopen_w() to support Unicode paths.
* Convert UTF-8 to local encoding when opening gzip file on non-Windows
This should fix the test_encoding failure on Travis-CI.
Also, change Windows side to manually allocating wchar_t array; although a bit less elegant, it's very localized and avoids introducing a whole new dependency on std::wstring.
* Use explicit char* to QString conversion in qPrintable
The implicit conversion works, but I prefer the an explicit one (if only as a reminder that we should convert all internal strings to QString).
* Add comment to QString-to-wchar_t[] conversion
... since it may not be immediately obvious what that line of code does.
* Fix merge conflict resolution error
* Fix merge conflict (again)
* Revert shape.cc
* Update gbfile.cc
* Update mkt_logger.cc to use QString tempfile paths.
* Change ufopen() to take QString filename argument.
Where converting from char*, use an explicit QString::fromUtf8() conversion rather than the implicit QString(const char*) constructor.
* Use QFile::exists() and QFile::open() rather than ufopen() to verify a file exists and can be opened.
* Remove redundant call to QFile::exists(). Trivial include cleanup in main.cc.
GPSBabel [Mon, 4 Dec 2017 08:17:12 +0000 (02:17 -0600)]
Merge pull request #124 from tsteven4/appveyor
Appveyor for misc internal builds (debug /opt, 32/64, mscvc/gcc, etc) and start adding features to allow a full release withing Amveor, hopefully in lliest tientethan it takes my VM down download and register the mandatory 4GB of updates! Hooray kl
Viet-Tam Luu [Fri, 1 Dec 2017 00:53:58 +0000 (16:53 -0800)]
Support Unicode environment variables.
Create ugetenv() OS-abstraction to return a QString environment variable value. Use it in place of getenv() in most places. Update inifile.cc routines to use QString to support Unicode paths for the gpsbabel.ini file, also greatly streamlining the code.