Many sites include various HTML entities in the content of RSS feeds.
The most of these entities are not declared in the underlying XML,
so the documents are considered by parser to be malformed.
This patch allows you to successfully parse such soft-malformed
RSS feeds.
Closes#8527.
Closes#8569.
For some reason, the RSS feed may contain malformed XML data and it may not be
successfully parsed by the XML parser. We are still trying to load as many articles
as possible until we encounter corrupted data. So we can have some articles even in
case of parsing error.
Closes#8527.
Closes#8569.
Avoid temporary string allocations. They are only used to convert to
something else.
QString::xxxRef() returns a QStringRef. QStringRef avoids the memory
allocation and reference counting overhead of a standard QString by simply
referencing a part of the original string.
Explicit or implicit calls to begin() and end() cause a non-const
container to detach from shared data, ie. to perform a deep-copy to gain
a unique copy of the data.
That can be a expensive although unneeded operation.
In order to assist the developer a copyAsConst function is added.
copyAsConst returns a const copy of the object.
For lvalues just use qAsConst. It's only available on Qt 5.7.0. But we
added also for earlier versions. The developer can always use qAsConst.
Intended uses:
QString s = ...;
for (const auto &ch : qAsConst(s))
process(ch);
for (const auto &ch : copyAsConst(funcReturningQString()))
process(ch);
It may be useful to have different configurations either for portable
versions or for debugging purposes. To implement this we add two
options, avaliable via command line switches
1. An option to change configuration name ("--configuration"). The name
supplied via this option is appended to
QCoreApplication::applicationName() to form "qBittorrent_<conf_name>"
name for the configuration files.
2. An option to provide a path do directory where all the settings are
stored (kind of profile directory). There is a shortcut "--portable"
which means "use directory 'profile' near the executable location".
In order to implement that we have to perform initialisation of the
profile directories before the SettingStorage and Preferences singletones
are initialised. Thus, options parsing shall be performed without defaults
read from preferences.