mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00: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)
|
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) {
|
if (plugin) {
|
||||||
plugin->enabled = enabled;
|
plugin->enabled = enabled;
|
||||||
// Save to Hard disk
|
// Save to Hard disk
|
||||||
|
@ -233,7 +233,7 @@ void AddNewTorrentDialog::saveState()
|
|||||||
|
|
||||||
void AddNewTorrentDialog::show(const QString &source, const BitTorrent::AddTorrentParams &inParams, QWidget *parent)
|
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)) {
|
if (Net::DownloadManager::hasSupportedScheme(source)) {
|
||||||
// Launch downloader
|
// Launch downloader
|
||||||
|
@ -149,7 +149,7 @@ QVariant TransferListModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
case TR_RATIO:
|
case TR_RATIO:
|
||||||
case TR_PRIORITY:
|
case TR_PRIORITY:
|
||||||
case TR_LAST_ACTIVITY:
|
case TR_LAST_ACTIVITY:
|
||||||
return {Qt::AlignRight | Qt::AlignVCenter};
|
return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
||||||
default:
|
default:
|
||||||
return QAbstractListModel::headerData(section, orientation, role);
|
return QAbstractListModel::headerData(section, orientation, role);
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ namespace
|
|||||||
QVariantList getStickyTrackers(const BitTorrent::TorrentHandle *const torrent)
|
QVariantList getStickyTrackers(const BitTorrent::TorrentHandle *const torrent)
|
||||||
{
|
{
|
||||||
uint seedsDHT = 0, seedsPeX = 0, seedsLSD = 0, leechesDHT = 0, leechesPeX = 0, leechesLSD = 0;
|
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.isConnecting()) continue;
|
||||||
|
|
||||||
if (peer.isSeed()) {
|
if (peer.isSeed()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user