tsteven4 [Sat, 13 Feb 2021 16:09:58 +0000 (09:09 -0700)]
remove a few old kludges that are no longer needed. (#691)
* remove a few old kludges that are no longer needed.
* clean up upgrade a bit
"GPSBabel Version " doesn't need to be removed from currentVersionIn
in UpgradeCheck::checkForUpgrade,
that is taken care of in MainWindow::findBabelVersion
tsteven4 [Sun, 7 Feb 2021 21:43:27 +0000 (14:43 -0700)]
prefer implicitly-defined dtors instead of user dtors with empty bodies. (#685)
Not only is this simpler, it avoids clang-tidy complaining about
warning: class * defines a non-default destructor but does not define a copy
constructor, a copy assignment operator, a move constructor or a move
assignment operator [cppcoreguidelines-special-member-functions]
tsteven4 [Sat, 6 Feb 2021 13:55:00 +0000 (06:55 -0700)]
use new style connect, i.e. function pointers (#682)
* migrate from old style connects to the new style.
The changes using qOverload were done by hand, the rest were done
with clazy 1.9.
The ones using the TreeAction constructor were not found by clazy
and would require more manual intervention.
Also, I note uic generates old style connects.
* eliminate our TreeAction class in favor of QMenu::addAction method.
It is a mystery to me why we created TreeAction. The QMenu method existed
in Qt 4.3. Documentation before 4.3 is scarce.
QMenu::addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0)
tsteven4 [Fri, 5 Feb 2021 17:01:41 +0000 (10:01 -0700)]
drop support for QtWebKit. (#680)
Our QtWebKit build didn't work any longer on Ubuntu bionic or focal,
but went into an infinite loop if map preview was used.
I observed this behavior with builds of 1.7.0 as well.
I note that latest fedora build spec falls back to QtWebKit on some
architectures where QtWebEngine is not available. This change will
require them to fall back to disabling the map preview instead.
https://src.fedoraproject.org/rpms/gpsbabel/blob/rawhide/f/gpsbabel.spec
QtWebEngine appears to be coming to Qt6 with or after 6.2.
https://bugreports.qt.io/browse/QTBUG-63235
tsteven4 [Thu, 4 Feb 2021 22:56:38 +0000 (15:56 -0700)]
replace obsolete and overloaded QProcess signal error(QProcess::ProcessError error) (#679)
with the recommended replacement, QProcess signal errorOccurred(QProcess::ProcessError error).
It seems this should have caused an issue in Qt6, but we hadn't noticed it yet.
tsteven4 [Tue, 2 Feb 2021 13:07:41 +0000 (06:07 -0700)]
fix deprecated-copy waring. (#675)
This fixes
"formatload.cc:127:40: warning: implicitly-declared
‘Format& Format::operator=(const Format&)’ is deprecated [-Wdeprecated-copy]"
Use default member initializers for FormatOption and Format classes.
This allows the use of the default constructor and simplifies the
creation of parameterized constructors.
Use implicit copy constructor for FormatOption and Format classes.
Note the previous copy constructor for the Format class was not
really a copy constructor, it re-initialized readUseCount and writeUseCount.
This was unnecessary. The only place we want to use the copy constructor is
in FormatLoad::getFormats and the instances to be copied have just been
created with one of the Format constructors so the use counts will be zero.
There are plenty of other opportunities where Qt might detach formatList_
and use the copy constructor. Most of these cases are read accesses and
improved const correctness could eliminate the possiblity, i.e. using
QList::at instead of QList::operator[]. A few of these are modifying an
item on the formatList_, and Qt will insist the copy constructor is available
at compile time even if it is never used at run time.
tsteven4 [Tue, 26 Jan 2021 13:42:40 +0000 (06:42 -0700)]
add github actions for CI. (#662)
* add github actions for CI.
* fix shellcheck issues in ci_install_windows.sh
* generalize windows ci build support
cleanup powershell scripts with Invoke-ScriptAnalyzer, including use of
"-Settings CodeFormatting".
create staging directory for windows installer creation.
It is difficult to exclude all the files in the build directory that we don't
want to distribute as the files are a function of the build system.
Robert Lipe [Tue, 27 Oct 2020 08:28:03 +0000 (03:28 -0500)]
ozi: don't deinit a write stream if we don't have one.
We can get into close() with a null stream_ TextStream. I think it has to do with ozi_openfile() reopening a file with a new name to match an extension of a certain type so it's renaming a file that hasn't been written. See issue #646
tsteven4 [Sun, 30 Aug 2020 20:26:54 +0000 (14:26 -0600)]
backward compatible changes for Qt6. (#640)
* backward compatible changes for Qt6.
This is mostly QRegExp -> QRegularExpression.
Some QRegExp usage was was replaced by QString::trimmed.
There is also a QNetworkRequest redirect attribute change that is backward
compatible to Qt5.9.
* eliminate usage of unnecessary regular expressions.
* bring serial_unix into Qt6 compliance.
QSet::toList is gone, QSet::values is identical.
qSort is deprecated.
tsteven4 [Fri, 28 Aug 2020 11:50:07 +0000 (05:50 -0600)]
Fix potential segmentation faults with exif. (#639)
1. A pointer exif_app_ to an ExifApp on QList<ExifApp> exif_apps was saved.
After this the list was modified. This can lead to the saved pointer becoming
invalid.
2. The ExifApp structure had a dtor, but no other special functions, i.e. it
violated the rule of 3 and the rule of 5. Operations on QList<ExifApp> may
cause an ExifApp on the list to be copied or destroyed. If an ExifApp is
destroyed, then the ExifApp dtor would close the files, even though there could
be a copy of the ExifApp expecting the files still to be open.
This scenerio occured with Qt6, causing segmentation faults in exif.test.
tsteven4 [Thu, 27 Aug 2020 18:05:37 +0000 (12:05 -0600)]
fix hiketech datetime bug, prepare for toTime_t override (#638)
* correct hiketech written time values.
the mystery previously noted in the code was due to the use of the %I format
specifier which prints out the hour using a 12 hour clock.
note that it is easy to see the times in the reference files were wrong. the
times in the first reference file, expertgpx.gpx, are in UTC. This is always
true for gpx, and is indicated as well by the Z. the times in the hiketech file
appear in a utc element, so they must be in UTC as well.
this eliminates the usage of QDateTime::toTime_t which is obsolete.
* elimnate remaining uses of obsolete QDateTime::toTime_t
This sounds better than it is, we added uses of gpsbabel::DateTime::toTime_t.
But we control that and can add our own toTime_t.
GPSBabel [Mon, 24 Aug 2020 03:15:29 +0000 (22:15 -0500)]
Remove dependency on gperf. (#631)
* Remove dependency on gperf.
There may be more "computer sciency" ways to do this, but let's start here.
Smallest cut possible for removal. Throwing this into CI to plan for actual
removal.
It seems like xcsv_tokens should be more const-able (constexpr?). If necessary,
we can defer this initialization from a global created at startup to being
only inflated when needed. Let's see.
* Bludgeon in temporary better handling for LAT_10E and friends.
tsteven4 [Fri, 14 Aug 2020 22:41:03 +0000 (16:41 -0600)]
compile in gpsbabel translations and map on non mac unix distribution… (#622)
* compile in gpsbabel translations and map on non mac unix distributions by default.
This eliminates the need to install gpsbabelfe_*.qm, gpsbabel_*.qm and
gmapbase.html on the system.
Note that the Qt supplied translations must still be installed on the system.
The Qt translations may be in a package like qttranslations5-l10n or
qt5-qttranslations.
tsteven4 [Fri, 7 Aug 2020 18:55:09 +0000 (12:55 -0600)]
move linux CI from configure to qmake. (#613)
- Add recipe for internal_styles.cc, xcsv_tokens.gperf, gui, unix-gui, toolinfo to GPSBabel.pro.
- Add support for text substitution in setup.iss and gbversion.h to GPSBabel.pro.
- fix qmake warnings from "qmake -Wall".
- split recipes for documents into scripts.
- shellcheck fixes for fixdoc, mkcapabilities.
- parallel build for coverage.
- add INSTALL file with build instructions.
- sort document targets into ones for general consumption (gpsbabel.html, gpsbabel.pdf) and one to support www.gpsbabel.org (now gpsbabel.org instead of index.html).
tsteven4 [Fri, 7 Aug 2020 17:29:22 +0000 (11:29 -0600)]
fix i386 regression error with engima. (#620)
this was motivated by the test failure seen at
https://buildd.debian.org/status/fetch.php?pkg=gpsbabel&arch=i386&ver=1.7.0%2Bds-4&stamp=1596794554&raw=0
tsteven4 [Fri, 7 Aug 2020 13:38:47 +0000 (07:38 -0600)]
use Qt endian detetion. (#619)
This frees us from AC_C_BIGENDIAN which conditionally defined WORDS_BIGENDIAN.
The defintion of WORDS_BIGENDIAN was and is not handled by GPSBabel.pro.
tsteven4 [Sun, 2 Aug 2020 15:00:09 +0000 (09:00 -0600)]
fix lupdate warning. (#617)
With Qt 5.12.9 the lupdate command in package_app could print a warning:
/home/strabert/work/pkgconfig/gui/preferences.cc:28: Discarding unconsumed meta data
Viet-Tam Luu [Sat, 1 Aug 2020 19:57:22 +0000 (12:57 -0700)]
Fix NMEA parsing creating Null Island waypoints (#607)
* Fix NMEA parsing creating Null Island waypoints
Fix parsing of NMEA GPGGA sentences: ones with 0 "fix quality" (i.e. "invalid") are allowed in serial (i.e. live GPS) mode because (according to the comment) some GPS devices will report previously-read data in the absence of a current good fix. Adjust this allowance to require an actual coordinate value; at least one popular USB GPS device will issue GPGGA such as "$GPGGA,010222.00,,,,,0,00,99.99,,,,,,*65" if it loses a good fix, and the empty lat/lng coordinates (",,,,,") are parsed as 0N 0W (a.k.a. "Null Island"). QString::toDouble() won't report a problem with an empty input so we simply check for 0 lat/lng.
* Use "ok" QString::toDouble() argument instead
... of checking for checking for both lat & lng exactly zero, as `ok` does indeed get set to `false` on empty inputs, in recent Qt versions.
pass parameters to tools/mkcapabilites instead of
using text replacement in configure.
text replacement in xmldoc/makedoc was unnecessary, directory
creation is handled in the recipee.
there is some foolishness in GPSBabel.pro to allow overriding of
WEB and DOCVERSION on the command line of make. If those values
are known when running qmake it could be slightly simpler.
lintondf [Sun, 7 Jun 2020 22:19:10 +0000 (18:19 -0400)]
Extract expected travel durations from Garmin BaseCamp GDB output (#585)
* extract track segment expected travel durations from Garmin BaseCamp autorouted GDB exports and report as <rtept/src> elements in gpx output
* revised to use Garmin Format-Specific Data object to store durations
* generate at frozen test time
* include code review suggestions
* store Garmin BaseCamp autoroute waypoint travel durations in the <desc> elements of <rtept> waypoints; modify gpx ouptut to exclude autoroute generated rtept waypoints from initial waypoint list
* remove waypoint class lookup and replace tabs with spaces
GPSBabel [Thu, 4 Jun 2020 07:46:11 +0000 (02:46 -0500)]
Remove Mapsource .mps format (#588)
* Fix numerous instances of shadowing confusion.
Inspired by a cppcon talk and our recent conversations about warnings, I
took a closer look at shadowing variables in our code and I wasn't proud
of my findings.
We had a lot of code that was writing to local variables or function
arguments when it thought it was operating on globals or (soon)
method-member variables. I made a rather half-hearted pass at changing
this by splitting up huge functions, renaming arguments, renaming globals
to reflect their future status as method variables (foo_), and generally
cleaning things up. The amound of effort I spent on each format was
approximately equal to its expected lifespan - I'm not spending an hour
on cleanups on formats I should instead be deleting.
In a future submit, I'll try to find some combination of -W flags on
our targets that allows us to not regress easily.
* Fix merge conflict I just created in gdb.cc
* Delete workspace.xml
* Delete the same link in garmin_icons.xml that I deleted twice yesterday.
Fix more esoteric warnings.
* Reapply MORE of yesterday's commits.
Seriously, I know this has been committed and is in HEAD...
* Attempt to fix list detachment within route.cc
* Remove Mapsource
The Mapsource format has been deprecated by Garmin for something
like 15 years. Later versions of Mapsource used GDB and Basecamp,
Garmin's first replacement for the Mapsource lineage, was used
exclusively in later versions.
I've reviewed list traffic and floated a discussion on the list.
The code style was never really very flexible and it it bears
a high maintenance cost that we can no longer afford. This
format is dead.
* Remove more pieces of Mapsource.
* Change Netstumbler test to not use Mapsource for staging.
More cleanups.