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.
Move the code that attempts to fill missing song metadata out of the
tagreader worker. In the main process, it will be controllable using
settings and calling context.
The methods were moved into a new SongPathParser class that checks new
settings to determine if action should be taken.
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.
Include the global /include/clementine-config.h rather than src/config.h
from /ext.
Note that this does not fully remove the dependencies on src from ext.
Set the QNetworkRequest::FollowRedirectsAttribute attribute to true.
This should be changed to use RedirectPolicyAttribute when all supported
platforms move to 5.9 or greater. Stretch is at 5.7.
Protobuf 3.15 adds a namespace alias for "pb" that conflicts with
Clementine's. Modify Clementine to use "cpb".
Patch provided by @ahesford
Reference: 5c028d6cf4/src/google/protobuf/port.h (L44)
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.
As of Qt 5.10 the badly named created() which would fall back to POSIX
ctime if birthtime wasn't supported (as was the case on basically every
Unix filesystem up to some decades ago) is deprecated and replaced by
the better named birthTime or metadataChangeTime (yay!).
As of some years now, created() returns birthtime under FreeBSD, but
either due to the protocol or lack of implementation, this returns -1
under FreeBSD mounting a ZFS pool from a FreeBSD server with NFSv3.
This would render Clementine completely useless. Local filesystems are
not affected though. The fix is to catch the -1 birthtime and use mtime
instead, which is a more meaningful value anyway.
This closes issue #6423.