mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Expose Mark-of-the-Web setting in Options
This commit is contained in:
@@ -2245,7 +2245,7 @@ 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 (isDownloading())
|
||||
if (Preferences::instance()->isMarkOfTheWebEnabled() && isDownloading())
|
||||
{
|
||||
const Path fullpath = actualStorageLocation() / actualPath;
|
||||
Utils::OS::applyMarkOfTheWeb(fullpath);
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
|
||||
#include "base/preferences.h"
|
||||
#include "base/utils/os.h"
|
||||
#endif // Q_OS_MACOS || Q_OS_WIN
|
||||
|
||||
@@ -155,7 +156,8 @@ void Net::DownloadHandlerImpl::processFinishedDownload()
|
||||
m_result.filePath = result.value();
|
||||
|
||||
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
|
||||
Utils::OS::applyMarkOfTheWeb(m_result.filePath, m_result.url);
|
||||
if (Preferences::instance()->isMarkOfTheWebEnabled())
|
||||
Utils::OS::applyMarkOfTheWeb(m_result.filePath, m_result.url);
|
||||
#endif // Q_OS_MACOS || Q_OS_WIN
|
||||
}
|
||||
else
|
||||
@@ -171,7 +173,8 @@ void Net::DownloadHandlerImpl::processFinishedDownload()
|
||||
m_result.filePath = destinationPath;
|
||||
|
||||
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
|
||||
Utils::OS::applyMarkOfTheWeb(m_result.filePath, m_result.url);
|
||||
if (Preferences::instance()->isMarkOfTheWebEnabled())
|
||||
Utils::OS::applyMarkOfTheWeb(m_result.filePath, m_result.url);
|
||||
#endif // Q_OS_MACOS || Q_OS_WIN
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1319,6 +1319,19 @@ void Preferences::setTrackerPortForwardingEnabled(const bool enabled)
|
||||
setValue(u"Preferences/Advanced/trackerPortForwarding"_s, enabled);
|
||||
}
|
||||
|
||||
bool Preferences::isMarkOfTheWebEnabled() const
|
||||
{
|
||||
return value(u"Preferences/Advanced/markOfTheWeb"_s, true);
|
||||
}
|
||||
|
||||
void Preferences::setMarkOfTheWebEnabled(const bool enabled)
|
||||
{
|
||||
if (enabled == isMarkOfTheWebEnabled())
|
||||
return;
|
||||
|
||||
setValue(u"Preferences/Advanced/markOfTheWeb"_s, enabled);
|
||||
}
|
||||
|
||||
Path Preferences::getPythonExecutablePath() const
|
||||
{
|
||||
return value(u"Preferences/Search/pythonExecutablePath"_s, Path());
|
||||
|
||||
@@ -291,6 +291,8 @@ public:
|
||||
void setTrackerPort(int port);
|
||||
bool isTrackerPortForwardingEnabled() const;
|
||||
void setTrackerPortForwardingEnabled(bool enabled);
|
||||
bool isMarkOfTheWebEnabled() const;
|
||||
void setMarkOfTheWebEnabled(bool enabled);
|
||||
Path getPythonExecutablePath() const;
|
||||
void setPythonExecutablePath(const Path &path);
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
|
||||
Reference in New Issue
Block a user