diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 368059544..ab39677c0 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -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) diff --git a/src/gui/properties/peerlistwidget.cpp b/src/gui/properties/peerlistwidget.cpp index eab083c15..8f69ec633 100644 --- a/src/gui/properties/peerlistwidget.cpp +++ b/src/gui/properties/peerlistwidget.cpp @@ -462,10 +462,10 @@ void PeerListWidget::handleSortColumnChanged(int col) void PeerListWidget::wheelEvent(QWheelEvent *event) { - event->accept(); - if (event->modifiers() & Qt::ShiftModifier) { // Shift + scroll = horizontal scroll + event->accept(); + QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal); QTreeView::wheelEvent(&scrollHEvent); return; diff --git a/src/gui/tagfiltermodel.cpp b/src/gui/tagfiltermodel.cpp index 02ab1c92f..99f22b67f 100644 --- a/src/gui/tagfiltermodel.cpp +++ b/src/gui/tagfiltermodel.cpp @@ -216,15 +216,15 @@ void TagFilterModel::torrentTagAdded(BitTorrent::TorrentHandle *const torrent, c void TagFilterModel::torrentTagRemoved(BitTorrent::TorrentHandle *const torrent, const QString &tag) { - Q_ASSERT(torrent->tags().count() >= 0); - if (torrent->tags().count() == 0) + if (torrent->tags().empty()) untaggedItem()->increaseTorrentsCount(); const int row = findRow(tag); - Q_ASSERT(isValidRow(row)); - TagModelItem &item = m_tagItems[row]; + if (row < 0) + return; + + m_tagItems[row].decreaseTorrentsCount(); - item.decreaseTorrentsCount(); const QModelIndex i = index(row, 0, QModelIndex()); emit dataChanged(i, i); } diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 79606171f..eb629810c 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -1212,10 +1212,10 @@ bool TransferListWidget::loadSettings() void TransferListWidget::wheelEvent(QWheelEvent *event) { - event->accept(); - if (event->modifiers() & Qt::ShiftModifier) { // Shift + scroll = horizontal scroll + event->accept(); + QWheelEvent scrollHEvent(event->pos(), event->globalPos(), event->delta(), event->buttons(), event->modifiers(), Qt::Horizontal); QTreeView::wheelEvent(&scrollHEvent); return;