mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08:00
Make various minor changes
This commit is contained in:
parent
89dce36e98
commit
ce437817de
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user