diff --git a/src/app/application.cpp b/src/app/application.cpp index a6666c57e..8fe47033e 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -410,7 +410,7 @@ void Application::setMemoryWorkingSetLimit(const int size) return; m_storeMemoryWorkingSetLimit = size; -#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS) +#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) applyMemoryWorkingSetLimit(); #endif } @@ -844,7 +844,7 @@ int Application::exec() printf("%s\n", qUtf8Printable(loadingStr)); #endif -#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS) +#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) applyMemoryWorkingSetLimit(); #endif @@ -1202,7 +1202,7 @@ void Application::shutdownCleanup([[maybe_unused]] QSessionManager &manager) } #endif -#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS) +#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) void Application::applyMemoryWorkingSetLimit() const { const size_t MiB = 1024 * 1024; diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index b5a56f936..ba620e027 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -64,7 +64,7 @@ namespace QBITTORRENT_HEADER, RESUME_DATA_STORAGE, TORRENT_CONTENT_REMOVE_OPTION, -#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS) +#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) MEMORY_WORKING_SET_LIMIT, #endif #if defined(Q_OS_WIN) @@ -209,7 +209,7 @@ void AdvancedSettings::saveAdvancedSettings() const BitTorrent::Session *const session = BitTorrent::Session::instance(); session->setResumeDataStorageType(m_comboBoxResumeDataStorage.currentData().value()); -#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS) +#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) // Physical memory (RAM) usage limit app()->setMemoryWorkingSetLimit(m_spinBoxMemoryWorkingSetLimit.value()); #endif @@ -494,12 +494,11 @@ void AdvancedSettings::loadAdvancedSettings() m_comboBoxTorrentContentRemoveOption.setCurrentIndex(m_comboBoxTorrentContentRemoveOption.findData(QVariant::fromValue(session->torrentContentRemoveOption()))); addRow(TORRENT_CONTENT_REMOVE_OPTION, tr("Torrent content removing mode"), &m_comboBoxTorrentContentRemoveOption); -#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS) +#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) // Physical memory (RAM) usage limit m_spinBoxMemoryWorkingSetLimit.setMinimum(1); m_spinBoxMemoryWorkingSetLimit.setMaximum(std::numeric_limits::max()); m_spinBoxMemoryWorkingSetLimit.setSuffix(tr(" MiB")); - m_spinBoxMemoryWorkingSetLimit.setToolTip(tr("This option is less effective on Linux")); m_spinBoxMemoryWorkingSetLimit.setValue(app()->memoryWorkingSetLimit()); addRow(MEMORY_WORKING_SET_LIMIT, (tr("Physical memory (RAM) usage limit") + u' ' + makeLink(u"https://wikipedia.org/wiki/Working_set", u"(?)")) , &m_spinBoxMemoryWorkingSetLimit); diff --git a/src/gui/advancedsettings.h b/src/gui/advancedsettings.h index 2305e830a..7ffca4f33 100644 --- a/src/gui/advancedsettings.h +++ b/src/gui/advancedsettings.h @@ -93,7 +93,7 @@ private: QSpinBox m_spinBoxHashingThreads; #endif -#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS) +#if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) QSpinBox m_spinBoxMemoryWorkingSetLimit; #endif diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index 1ea44c725..15770a5e5 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -1159,7 +1159,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD -   QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog] +   QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog] @@ -3164,6 +3164,9 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD document.getElementById("diskIOWriteModeWriteThrough").style.display = "none"; } + if ((buildInfo.platform === "linux") || (buildInfo.platform === "macos")) + document.getElementById("rowMemoryWorkingSetLimit").style.display = "none"; + if ((buildInfo.platform !== "macos") && (buildInfo.platform !== "windows")) document.getElementById("rowMarkOfTheWeb").style.display = "none";