Browse Source

Clean up code

and remove unused parameters/variables.
adaptive-webui-19844
Chocobo1 4 years ago
parent
commit
53b7956968
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 7
      src/base/bittorrent/session.cpp
  2. 2
      src/base/bittorrent/torrentimpl.cpp
  3. 16
      src/gui/mainwindow.cpp

7
src/base/bittorrent/session.cpp

@ -3766,14 +3766,13 @@ void Session::updateSeedingLimitTimer() @@ -3766,14 +3766,13 @@ void Session::updateSeedingLimitTimer()
}
}
void Session::handleTorrentShareLimitChanged(TorrentImpl *const torrent)
void Session::handleTorrentShareLimitChanged(TorrentImpl *const)
{
updateSeedingLimitTimer();
}
void Session::handleTorrentNameChanged(TorrentImpl *const torrent)
void Session::handleTorrentNameChanged(TorrentImpl *const)
{
Q_UNUSED(torrent);
}
void Session::handleTorrentSavePathChanged(TorrentImpl *const torrent)
@ -4653,11 +4652,11 @@ void Session::handleSessionStatsAlert(const lt::session_stats_alert *p) @@ -4653,11 +4652,11 @@ void Session::handleSessionStatsAlert(const lt::session_stats_alert *p)
m_status.diskWriteQueue = stats[m_metricIndices.peer.numPeersDownDisk];
m_status.peersCount = stats[m_metricIndices.peer.numPeersConnected];
const int64_t numBlocksRead = stats[m_metricIndices.disk.numBlocksRead];
m_cacheStatus.totalUsedBuffers = stats[m_metricIndices.disk.diskBlocksInUse];
m_cacheStatus.jobQueueLength = stats[m_metricIndices.disk.queuedDiskJobs];
#if (LIBTORRENT_VERSION_NUM < 20000)
const int64_t numBlocksRead = stats[m_metricIndices.disk.numBlocksRead];
const int64_t numBlocksCacheHits = stats[m_metricIndices.disk.numBlocksCacheHits];
m_cacheStatus.readRatio = static_cast<qreal>(numBlocksCacheHits) / std::max<int64_t>((numBlocksCacheHits + numBlocksRead), 1);
#endif

2
src/base/bittorrent/torrentimpl.cpp

@ -1887,7 +1887,7 @@ void TorrentImpl::handleFileCompletedAlert(const lt::file_completed_alert *p) @@ -1887,7 +1887,7 @@ void TorrentImpl::handleFileCompletedAlert(const lt::file_completed_alert *p)
}
#if (LIBTORRENT_VERSION_NUM >= 20003)
void TorrentImpl::handleFilePrioAlert(const lt::file_prio_alert *p)
void TorrentImpl::handleFilePrioAlert(const lt::file_prio_alert *)
{
if (m_nativeHandle.need_save_resume_data())
m_session->handleTorrentNeedSaveResumeData(this);

16
src/gui/mainwindow.cpp

@ -1664,11 +1664,14 @@ void MainWindow::reloadTorrentStats(const QVector<BitTorrent::Torrent *> &torren @@ -1664,11 +1664,14 @@ void MainWindow::reloadTorrentStats(const QVector<BitTorrent::Torrent *> &torren
void MainWindow::showNotificationBaloon(const QString &title, const QString &msg) const
{
if (!isNotificationsEnabled()) return;
if (!isNotificationsEnabled())
return;
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)) && defined(QT_DBUS_LIB)
OrgFreedesktopNotificationsInterface notifications("org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
QDBusConnection::sessionBus());
OrgFreedesktopNotificationsInterface notifications(QLatin1String("org.freedesktop.Notifications")
, QLatin1String("/org/freedesktop/Notifications")
, QDBusConnection::sessionBus());
// Testing for 'notifications.isValid()' isn't helpful here.
// If the notification daemon is configured to run 'as needed'
// the above check can be false if the daemon wasn't started
@ -1679,8 +1682,9 @@ void MainWindow::showNotificationBaloon(const QString &title, const QString &msg @@ -1679,8 +1682,9 @@ void MainWindow::showNotificationBaloon(const QString &title, const QString &msg
// to start their daemons at the session startup and have it sit
// idling for the whole session.
const QVariantMap hints {{QLatin1String("desktop-entry"), QLatin1String("org.qbittorrent.qBittorrent")}};
QDBusPendingReply<uint> reply = notifications.Notify("qBittorrent", 0, "qbittorrent", title,
msg, QStringList(), hints, getNotificationTimeout());
QDBusPendingReply<uint> reply = notifications.Notify(QLatin1String("qBittorrent"), 0
, QLatin1String("qbittorrent"), title, msg, {}, hints, getNotificationTimeout());
reply.waitForFinished();
if (!reply.isError())
return;

Loading…
Cancel
Save