From ac9ca4f452e138a199ee6e16d18487ed73dbdc67 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 16 Nov 2024 15:57:55 +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. Closes #21788. PR #21836. --- 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 e4bdbbd4e..a3b82eff5 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -2378,7 +2378,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);