Make various minor changes

This commit is contained in:
thalieht 2019-02-22 03:59:31 +02:00
parent 89dce36e98
commit ce437817de
4 changed files with 4 additions and 4 deletions

View file

@ -170,7 +170,7 @@ PluginInfo *SearchPluginManager::pluginInfo(const QString &name) const
void SearchPluginManager::enablePlugin(const QString &name, const bool enabled)
{
PluginInfo *plugin = m_plugins.value(name, 0);
PluginInfo *plugin = m_plugins.value(name, nullptr);
if (plugin) {
plugin->enabled = enabled;
// Save to Hard disk

View file

@ -233,7 +233,7 @@ void AddNewTorrentDialog::saveState()
void AddNewTorrentDialog::show(const QString &source, const BitTorrent::AddTorrentParams &inParams, QWidget *parent)
{
AddNewTorrentDialog *dlg = new AddNewTorrentDialog(inParams, parent);
auto *dlg = new AddNewTorrentDialog(inParams, parent);
if (Net::DownloadManager::hasSupportedScheme(source)) {
// Launch downloader

View file

@ -149,7 +149,7 @@ QVariant TransferListModel::headerData(int section, Qt::Orientation orientation,
case TR_RATIO:
case TR_PRIORITY:
case TR_LAST_ACTIVITY:
return {Qt::AlignRight | Qt::AlignVCenter};
return QVariant(Qt::AlignRight | Qt::AlignVCenter);
default:
return QAbstractListModel::headerData(section, orientation, role);
}

View file

@ -134,7 +134,7 @@ namespace
QVariantList getStickyTrackers(const BitTorrent::TorrentHandle *const torrent)
{
uint seedsDHT = 0, seedsPeX = 0, seedsLSD = 0, leechesDHT = 0, leechesPeX = 0, leechesLSD = 0;
for (const BitTorrent::PeerInfo &peer : torrent->peers()) {
for (const BitTorrent::PeerInfo &peer : asConst(torrent->peers())) {
if (peer.isConnecting()) continue;
if (peer.isSeed()) {