Browse Source

Make various minor changes

adaptive-webui-19844
thalieht 6 years ago
parent
commit
ce437817de
  1. 2
      src/base/search/searchpluginmanager.cpp
  2. 2
      src/gui/addnewtorrentdialog.cpp
  3. 2
      src/gui/transferlistmodel.cpp
  4. 2
      src/webui/api/torrentscontroller.cpp

2
src/base/search/searchpluginmanager.cpp

@ -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

2
src/gui/addnewtorrentdialog.cpp

@ -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

2
src/gui/transferlistmodel.cpp

@ -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);
} }

2
src/webui/api/torrentscontroller.cpp

@ -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…
Cancel
Save