From b559d8c23c6109c1cad0181641695bb8f589b3aa Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 13 Nov 2024 14:55:39 +0800 Subject: [PATCH] Don't apply Mark-of-the-Web on existing files `TorrentImpl::isDownloading()` was excessively broad which included unexpected events for the case here. So use the underlying state directly. Close #21788. --- src/base/bittorrent/torrentimpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index ad749d1c3..5396ad0b0 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -2388,7 +2388,8 @@ void TorrentImpl::handleFileCompletedAlert(const lt::file_completed_alert *p) #if defined(Q_OS_MACOS) || defined(Q_OS_WIN) // only apply Mark-of-the-Web to new download files - if (Preferences::instance()->isMarkOfTheWebEnabled() && isDownloading()) + if (Preferences::instance()->isMarkOfTheWebEnabled() + && (m_nativeStatus.state == lt::torrent_status::downloading)) { const Path fullpath = actualStorageLocation() / actualPath; Utils::OS::applyMarkOfTheWeb(fullpath);