Browse Source

Improve handleFileErrorAlert error message

adaptive-webui-19844
Chocobo1 6 years ago
parent
commit
623210df58
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 13
      src/base/bittorrent/session.cpp

13
src/base/bittorrent/session.cpp

@ -4002,21 +4002,24 @@ void Session::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)
void Session::handleFileErrorAlert(const lt::file_error_alert *p) void Session::handleFileErrorAlert(const lt::file_error_alert *p)
{ {
qDebug() << Q_FUNC_INFO;
// NOTE: Check this function!
TorrentHandle *const torrent = m_torrents.value(p->handle.info_hash()); TorrentHandle *const torrent = m_torrents.value(p->handle.info_hash());
if (torrent) { if (!torrent)
return;
const InfoHash hash = torrent->hash(); const InfoHash hash = torrent->hash();
if (!m_recentErroredTorrents.contains(hash)) { if (!m_recentErroredTorrents.contains(hash)) {
m_recentErroredTorrents.insert(hash); m_recentErroredTorrents.insert(hash);
const QString msg = QString::fromStdString(p->message()); const QString msg = QString::fromStdString(p->message());
LogMsg(tr("An I/O error occurred, '%1' paused. %2").arg(torrent->name(), msg)); LogMsg(tr("File error alert. Torrent: \"%1\". File: \"%2\". Reason: %3")
.arg(torrent->name(), p->filename(), msg)
, Log::WARNING);
emit fullDiskError(torrent, msg); emit fullDiskError(torrent, msg);
} }
m_recentErroredTorrentsTimer->start(); m_recentErroredTorrentsTimer->start();
} }
}
void Session::handlePortmapWarningAlert(const lt::portmap_error_alert *p) void Session::handlePortmapWarningAlert(const lt::portmap_error_alert *p)
{ {

Loading…
Cancel
Save