From cbabe56fcf41b99d9d4b6e3927cb36ac9e9e2ce3 Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Thu, 8 Aug 2024 08:19:53 +0300 Subject: [PATCH] Hide zero status filters when torrents removed PR #21150. Closes #21146. --- src/gui/transferlistfilters/statusfilterwidget.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/transferlistfilters/statusfilterwidget.cpp b/src/gui/transferlistfilters/statusfilterwidget.cpp index 2032df176..92f9d8c3e 100644 --- a/src/gui/transferlistfilters/statusfilterwidget.cpp +++ b/src/gui/transferlistfilters/statusfilterwidget.cpp @@ -235,10 +235,7 @@ void StatusFilterWidget::applyFilter(int row) void StatusFilterWidget::handleTorrentsLoaded(const QList &torrents) { - for (const BitTorrent::Torrent *torrent : torrents) - updateTorrentStatus(torrent); - - updateTexts(); + update(torrents); } void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torrent) @@ -273,6 +270,12 @@ void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torr m_nbStalled = m_nbStalledUploading + m_nbStalledDownloading; updateTexts(); + + if (Preferences::instance()->getHideZeroStatusFilters()) + { + hideZeroItems(); + updateGeometry(); + } } void StatusFilterWidget::configure() -- 2.11.4.GIT