tsteven4 [Wed, 17 Nov 2021 15:52:08 +0000 (08:52 -0700)]
Eliminiate redundant route_head data member (#764)
eliminate redundant route_head data member rte_waypt_ct, replacing it with a member function rte_waypt_ct() that gets the count from the waypoint_list container.
Robert Lipe [Mon, 1 Nov 2021 05:49:57 +0000 (00:49 -0500)]
C++ improvements in VCard. Add tests. (#750)
* C++ improvements inside Vcard. Add test.
* Eternal impedance mismatch on C vs C++ pointer ownership.
* VCF: Incorporate review feedback: auote ','. Match HTML tage regardless of case.
* Quote commas in ASCII source, not just UTH8-encoded text.
tsteven4 [Fri, 29 Oct 2021 00:24:00 +0000 (18:24 -0600)]
fix windows release with Qt6. (#748)
* fix windows release with Qt6.
windeployqt failed to deploy Qt6Core5Compat.dll because it was
not used by the gui and we didn't tell windeployqt there was
another executable to scan for dependencies.
* fiddle with github cache conditionals.
cache was restored, but we tried to install qt anyway.
tsteven4 [Fri, 15 Oct 2021 00:29:54 +0000 (18:29 -0600)]
fix an out of bounds access to a QString in tpo. (#738)
This was caught with Qt6.2.0, which has an assertion to check for
out of bounds access.
ASSERT: "i >= 0 && i < size()" in file .../Qt-6.2.0/6.2.0/gcc_64/include/QtCore/qstring.h, line 1325
SRE-babel [Wed, 13 Oct 2021 15:13:03 +0000 (08:13 -0700)]
Update tpo.cc (#643)
Some .tpo file tracks were/are parsed such that wild jumps occur in lat/lon, creating invalid coords which were not caught by output routines. Some logic flaws and int size errors have been fixed, but some tracks still contain invalid points. Tracks not corrected by this patch now result in warning messages to STDOUT. Entirely valid tracks will also generate warnings if lat or lon changes by a full degree between adjacent track points (should never happen). Non-fatal warning allows manual removal of the few bad track points in an output format like GPX. Damage is apparently limited to half a dozen incremental points before the next full point, but that can't be guaranteed.
Mechanically remove QStringRef use for QStringView to help with Qt6. (#722)
* Make more string literals encoded at UTF-16 (bloaty-bytes) to
reduce conversions.
* Favor QStringView(Qt6-ism that mirrors C++ standard std::stringview)
over QStringRef (Qt5 hack).
Co-authored-by: Robert Lipe <robertlipe@gmail.com>
Robert Lipe [Mon, 13 Sep 2021 22:32:51 +0000 (17:32 -0500)]
Remove Bushnell and Bushnell_trl formats.
These were added in 2009 when Onix unit were on firesale at places like Woot
as Bushnell had just exited the handheld GPS space. There was a flurry of
activity by a low number of users, followed by years of silence beyond
maintenance burden.
tsteven4 [Tue, 23 Mar 2021 18:58:39 +0000 (12:58 -0600)]
fix erroneous Qt translation caught by PVS studio.
V646 Consider inspecting the application's logic. It's possible that 'else' keyword is missing.
This makes me wonder if this code is ever used. If args == "OutputFromUnit"
it would throw a fatal error since b9cdbe4e8dc02cff07af9e0fa28adb2372337963 Oct 22, 2013
tsteven4 [Tue, 23 Mar 2021 15:46:42 +0000 (09:46 -0600)]
pvs fix
V668 There is no sense in testing the 'wpt_tmp' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error.
tsteven4 [Mon, 15 Mar 2021 13:04:10 +0000 (07:04 -0600)]
fix Qt6 deprecation warning in mapbar_track. (#703)
* fix Qt6 deprecation warning in mapbar_track.
"warning: 'fromUtf16' is deprecated: Use char16_t* overload."
However, it is recommended to use QString(const QChar *, int) or
QString(const QChar *) instead of
QString::fromUtf16(const ushort *unicode, int size = -1) and
QString::fromUtf16(const char16_t *str, int size = -1) anyway.
* fix Either the condition 'track==nullptr' is redundant or there is possible null pointer dereference.
as this isn't using a non-throwing allocation function memory allocation
errors will cause std::bad_alloc to be thrown anyway, we won't return
with track == nullptr.
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.