The Q_OS_UNIX macro is inappropriate because many UNIX-like platforms may
lack backtrace support in the libc. E.g.: Darwin / Mac OS X, Musl libc,
OpenBSD, OpenIndiana.
QRandomGenerator::generate() returns an unbounded int32, while the legacy
qrand method always returned a positive number. When generating a tag
reader ID with QRandomGenerator, cast the random value to an unsigned so
that it is formatted as a positive number in the name.
Note that most usages of QRandomGenrator in the codebase use bounded()
instead of generate(), and should work as expected.
QRandomGenerator was introduced in 5.10 and qrand has since been
deprecated. QRandomGenerator::global() returns a global instance that
has been securely seeded. QRandomGenerator provides methods that
generate values within ranges, so taking a modulus of the result isn't
necessary.
workerpool.h utilizes the MAC-specific USE_BUNDLE option, but the file
didn't directly include the config header file. Cleanup change 341dc73
reordered some headers, so it was no longer included as a side-effect
either.
This allows a delete function to be provided with the prototype: void d(T*)
This function is passed to the unique_ptr constructor to be used when the object
is released. The default function simply deletes the object, where the default
behavior for unique_ptr would have a specialization for arrays. If Lazy is ever
used with arrays, a delete function should be provided.
To avoid infinite recursion, Qt prevents a log generated from an installed
message handler from being handled by that same handler. So when a Qt message
is handled, the logging magic (__logging_message__) that is added by
CreateLogger, and is expected to be detected and stripped by the handler, is
instead dumped to the log.
Instead of sending the Qt messages back through the logging system, use a new
BufferedDebug to build the log message in a buffer, then immeiately print the
buffer to stderr.
Use qLogCat to put verbose GStreamer callback messages into a new
GstEnginePipelineCallbacks category. Filter that category instead of
the entire class by default.
In some cases, such as message handling callback functions, the line and function
macros don't provide a lot of useful information. In other cases, we may want more
granularity of control withing a class. For these cases, add a qLogCat that takes
a category string. Print this string in the message and use it as the filter
category.
When a closure involves an ObjectHelper, a connection is made from the
receiver's destroyed signal and the helper object's deleteLater slot. Since
the signal between the sender and the helper object isn't disconnected until
either object is actually destroyed, this leaves a hole where the helper
holds a pointer to an invalid receiver object, but is still able to receive
the signal connected to its Invoke slot.
Instead of connecting the destroyed signal to deleteLater, connect it to a new
TearDown slot that immediately disconnects the signal then calls deleteLater.
One usage of the macro remains in the bundled libmygpo-qt5. This should
be updated once the pending upstream fix was merged. qtsingleapplication
is already fixed upstream.