In Application::MoveToNewThread, name the new thread after the object being
moved. Give those objects names as well.
The thread names display in gdb with "info threads".
The NetworkRemote is moved to a new thread after creation. On that thread, its
child classes create timers. When the network remote class is deleted on the
main thread, we see "Timers cannot be stopped from another thread".
To avoid this error, use deleteLater to delete NetworkRemote and its composition
classes on its own thread.
Add a class to wrap the URL in the playback engines. In the future, this will
contain authentication information for the specified URL. It can also include
the start and end time as well as other data that is currently specified along
with the URL.
Clementine detects a data directory in the same directory as the executable to
determine portable configuration. But there are some packages that create
/usr/bin/data, causing Clementine to run in portable mode.
Use a more unique data directory name, clementine-data, as the portable data
directory. For backwards compatibility, use the legacy data directory if the
already exists there.
In some cases, URL queries contain auth information. For cases where error
strings are passed from other libraries, such as from gstreamer, add a utility
function, ScrubUrlQueries, to strip queries from URLs in strings.
There are several instances of the LibraryModel class used in the system. Each
of these creates a LibraryDirectoryModel instance, but only the instance held
by the main library is every used. Move this out of the LibraryModel class and
into the Library class.
The fix-up for URLs for files that that begin with // no longer works since the
QUrl class determines that these modifications are invalid, resulting in an
empty string when converted. Instead of attempting to modify the QUrl, add a
utility function that makes the correction on the encoded byte array at time of
usage.
QFileSystemWatcher::addPath returns a boolean to indicate success. Modify
QtFSListener::AddPath to reflect that. For now, the MacFSListener version will
always return true.
In most cases, timeouts can be applied to a reply after a request has been made.
But some APIs, such as libmygpo-qt, don't always provide access to the reply or
provide abort methods. For these cases, add an optional timeout to
NetworkAccessManager. If set, create a NetworkTimeouts instance in createRequest
and add the reply. Use the reply as the parent so that it is destroyed when the
reply is destroyed.
Instead of immediately saving, which leads to poor performance,
and possible hardware damage (see #6057), limit saves to once
per second (similar to how KDE does it). It also guarantees
that only one save is required per second, by sharing a QSettings
object, and establishes a signaling framework to put other
setting save events into (but only uses this for the two major
offenders: playlist tab switching and window resizing).
This is in contrast to 6a312e7, which simply deferred the save
until program exit, and caused problems for some people (see #6217
and #6209).
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Previously, the number of processes spawned was always
QThread::idealThreadCount() (returning the number of logical CPU
cores). On new systems with many cores, however, this can result
in 12, 16, 24, or ... processes being spawned, which is a bit
excessive.
This establishes a new config variable,
'max_numprocs_tagclients' within the Settings group, in order
to limit the maximum number of tag client processes that get
spawned. It also adds a means of setting this via the Behavior
page in Settings. It can be set to any integer in the interval
[1, QThread::idealThreadCount()]; it defaults to the maximal value
so as to emulate the old behavior.
Async song loading can fail without user feedback. This change adds return codes
to these async load functions. It will now produce an error dialog in simple
scenarios (test case is user selecting a file that is not readable). Other cases,
such as directories and playlists, aren't yet covered.