From 6a2df8e669e5cf2f38ed95bb0e92a41d571dcacf 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 ad749d1c3c0..dc490e1ac11 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_state == TorrentState::ForcedDownloading) || (m_state == TorrentState::Downloading))) { const Path fullpath = actualStorageLocation() / actualPath; Utils::OS::applyMarkOfTheWeb(fullpath);