mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Improve handleFileErrorAlert error message
This commit is contained in:
parent
e8be3bf939
commit
9a7e79bd0e
1 changed files with 14 additions and 11 deletions
|
@ -4337,20 +4337,23 @@ void Session::handleMetadataReceivedAlert(libt::metadata_received_alert *p)
|
|||
|
||||
void Session::handleFileErrorAlert(libt::file_error_alert *p)
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// NOTE: Check this function!
|
||||
TorrentHandle *const torrent = m_torrents.value(p->handle.info_hash());
|
||||
if (torrent) {
|
||||
const InfoHash hash = torrent->hash();
|
||||
if (!m_recentErroredTorrents.contains(hash)) {
|
||||
m_recentErroredTorrents.insert(hash);
|
||||
const QString msg = QString::fromStdString(p->message());
|
||||
LogMsg(tr("An I/O error occurred, '%1' paused. %2").arg(torrent->name(), msg));
|
||||
emit fullDiskError(torrent, msg);
|
||||
}
|
||||
if (!torrent)
|
||||
return;
|
||||
|
||||
m_recentErroredTorrentsTimer->start();
|
||||
const InfoHash hash = torrent->hash();
|
||||
|
||||
if (!m_recentErroredTorrents.contains(hash)) {
|
||||
m_recentErroredTorrents.insert(hash);
|
||||
|
||||
const QString msg = QString::fromStdString(p->message());
|
||||
LogMsg(tr("File error alert. Torrent: \"%1\". File: \"%2\". Reason: %3")
|
||||
.arg(torrent->name(), p->filename(), msg)
|
||||
, Log::WARNING);
|
||||
emit fullDiskError(torrent, msg);
|
||||
}
|
||||
|
||||
m_recentErroredTorrentsTimer->start();
|
||||
}
|
||||
|
||||
void Session::handlePortmapWarningAlert(libt::portmap_error_alert *p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue