Last active
May 27, 2023 04:27
-
-
Save ivan/18968d3812a60f738039bada45e7ca33 to your computer and use it in GitHub Desktop.
qBittorrent 4.5.2 (actually fcd38a497eac275fa01cac4e04f27aa806df6d30) patch to use decimal sizes everywhere instead of binary prefix sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/app/application.cpp b/src/app/application.cpp | |
index 5a74d27a4..09751de77 100644 | |
--- a/src/app/application.cpp | |
+++ b/src/app/application.cpp | |
@@ -114,12 +114,12 @@ namespace | |
const Path DEFAULT_PORTABLE_MODE_PROFILE_DIR {u"profile"_qs}; | |
- const int MIN_FILELOG_SIZE = 1024; // 1KiB | |
- const int MAX_FILELOG_SIZE = 1000 * 1024 * 1024; // 1000MiB | |
- const int DEFAULT_FILELOG_SIZE = 65 * 1024; // 65KiB | |
+ const int MIN_FILELOG_SIZE = 1000; // 1KB | |
+ const int MAX_FILELOG_SIZE = 1000 * 1000 * 1000; // 1000MB | |
+ const int DEFAULT_FILELOG_SIZE = 65 * 1000; // 65KB | |
#ifndef DISABLE_GUI | |
- const int PIXMAP_CACHE_SIZE = 64 * 1024 * 1024; // 64MiB | |
+ const int PIXMAP_CACHE_SIZE = 64 * 1000 * 1000; // 64MB | |
#endif | |
} | |
@@ -1040,12 +1040,12 @@ void Application::shutdownCleanup(QSessionManager &manager) | |
#ifdef QBT_USES_LIBTORRENT2 | |
void Application::applyMemoryWorkingSetLimit() const | |
{ | |
- const size_t MiB = 1024 * 1024; | |
+ const size_t MB = 1000 * 1000; | |
const QString logMessage = tr("Failed to set physical memory (RAM) usage limit. Error code: %1. Error message: \"%2\""); | |
#ifdef Q_OS_WIN | |
- const SIZE_T maxSize = memoryWorkingSetLimit() * MiB; | |
- const auto minSize = std::min<SIZE_T>((64 * MiB), (maxSize / 2)); | |
+ const SIZE_T maxSize = memoryWorkingSetLimit() * MB; | |
+ const auto minSize = std::min<SIZE_T>((64 * MB), (maxSize / 2)); | |
if (!::SetProcessWorkingSetSizeEx(::GetCurrentProcess(), minSize, maxSize, QUOTA_LIMITS_HARDWS_MAX_ENABLE)) | |
{ | |
const DWORD errorCode = ::GetLastError(); | |
@@ -1067,7 +1067,7 @@ void Application::applyMemoryWorkingSetLimit() const | |
if (::getrlimit(RLIMIT_RSS, &limit) != 0) | |
return; | |
- limit.rlim_cur = memoryWorkingSetLimit() * MiB; | |
+ limit.rlim_cur = memoryWorkingSetLimit() * MB; | |
if (::setrlimit(RLIMIT_RSS, &limit) != 0) | |
{ | |
const auto message = QString::fromLocal8Bit(strerror(errno)); | |
diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h | |
index 79b3f47b4..a965a695f 100644 | |
--- a/src/base/bittorrent/session.h | |
+++ b/src/base/bittorrent/session.h | |
@@ -329,9 +329,9 @@ namespace BitTorrent | |
virtual bool ignoreSlowTorrentsForQueueing() const = 0; | |
virtual void setIgnoreSlowTorrentsForQueueing(bool ignore) = 0; | |
virtual int downloadRateForSlowTorrents() const = 0; | |
- virtual void setDownloadRateForSlowTorrents(int rateInKibiBytes) = 0; | |
+ virtual void setDownloadRateForSlowTorrents(int rateInKiloBytes) = 0; | |
virtual int uploadRateForSlowTorrents() const = 0; | |
- virtual void setUploadRateForSlowTorrents(int rateInKibiBytes) = 0; | |
+ virtual void setUploadRateForSlowTorrents(int rateInKiloBytes) = 0; | |
virtual int slowTorrentsInactivityTimer() const = 0; | |
virtual void setSlowTorrentsInactivityTimer(int timeInSeconds) = 0; | |
virtual int outgoingPortsMin() const = 0; | |
diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp | |
index 944322d90..621c392f8 100644 | |
--- a/src/base/bittorrent/sessionimpl.cpp | |
+++ b/src/base/bittorrent/sessionimpl.cpp | |
@@ -400,7 +400,7 @@ SessionImpl::SessionImpl(QObject *parent) | |
, m_checkingMemUsage(BITTORRENT_SESSION_KEY(u"CheckingMemUsageSize"_qs), 32) | |
, m_diskCacheSize(BITTORRENT_SESSION_KEY(u"DiskCacheSize"_qs), -1) | |
, m_diskCacheTTL(BITTORRENT_SESSION_KEY(u"DiskCacheTTL"_qs), 60) | |
- , m_diskQueueSize(BITTORRENT_SESSION_KEY(u"DiskQueueSize"_qs), (1024 * 1024)) | |
+ , m_diskQueueSize(BITTORRENT_SESSION_KEY(u"DiskQueueSize"_qs), (1000 * 1000)) | |
, m_diskIOType(BITTORRENT_SESSION_KEY(u"DiskIOType"_qs), DiskIOType::Default) | |
, m_diskIOReadMode(BITTORRENT_SESSION_KEY(u"DiskIOReadMode"_qs), DiskIOReadMode::EnableOSCache) | |
, m_diskIOWriteMode(BITTORRENT_SESSION_KEY(u"DiskIOWriteMode"_qs), DiskIOWriteMode::EnableOSCache) | |
@@ -1684,8 +1684,8 @@ lt::settings_pack SessionImpl::loadLTSettings() const | |
settingsPack.set_int(lt::settings_pack::suggest_mode, isSuggestModeEnabled() | |
? lt::settings_pack::suggest_read_cache : lt::settings_pack::no_piece_suggestions); | |
- settingsPack.set_int(lt::settings_pack::send_buffer_watermark, sendBufferWatermark() * 1024); | |
- settingsPack.set_int(lt::settings_pack::send_buffer_low_watermark, sendBufferLowWatermark() * 1024); | |
+ settingsPack.set_int(lt::settings_pack::send_buffer_watermark, sendBufferWatermark() * 1000); | |
+ settingsPack.set_int(lt::settings_pack::send_buffer_low_watermark, sendBufferLowWatermark() * 1000); | |
settingsPack.set_int(lt::settings_pack::send_buffer_watermark_factor, sendBufferWatermarkFactor()); | |
settingsPack.set_bool(lt::settings_pack::anonymous_mode, isAnonymousModeEnabled()); | |
@@ -1697,8 +1697,8 @@ lt::settings_pack SessionImpl::loadLTSettings() const | |
settingsPack.set_int(lt::settings_pack::active_limit, maxActiveTorrents()); | |
settingsPack.set_int(lt::settings_pack::active_seeds, maxActiveUploads()); | |
settingsPack.set_bool(lt::settings_pack::dont_count_slow_torrents, ignoreSlowTorrentsForQueueing()); | |
- settingsPack.set_int(lt::settings_pack::inactive_down_rate, downloadRateForSlowTorrents() * 1024); // KiB to Bytes | |
- settingsPack.set_int(lt::settings_pack::inactive_up_rate, uploadRateForSlowTorrents() * 1024); // KiB to Bytes | |
+ settingsPack.set_int(lt::settings_pack::inactive_down_rate, downloadRateForSlowTorrents() * 1000); // KB to Bytes | |
+ settingsPack.set_int(lt::settings_pack::inactive_up_rate, uploadRateForSlowTorrents() * 1000); // KB to Bytes | |
settingsPack.set_int(lt::settings_pack::auto_manage_startup, slowTorrentsInactivityTimer()); | |
} | |
else | |
@@ -3115,24 +3115,24 @@ void SessionImpl::configureListeningInterface() | |
int SessionImpl::globalDownloadSpeedLimit() const | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
- return m_globalDownloadSpeedLimit * 1024; | |
+ return m_globalDownloadSpeedLimit * 1000; | |
} | |
void SessionImpl::setGlobalDownloadSpeedLimit(const int limit) | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
if (limit == globalDownloadSpeedLimit()) | |
return; | |
if (limit <= 0) | |
m_globalDownloadSpeedLimit = 0; | |
- else if (limit <= 1024) | |
+ else if (limit <= 1000) | |
m_globalDownloadSpeedLimit = 1; | |
else | |
- m_globalDownloadSpeedLimit = (limit / 1024); | |
+ m_globalDownloadSpeedLimit = (limit / 1000); | |
if (!isAltGlobalSpeedLimitEnabled()) | |
configureDeferred(); | |
@@ -3140,24 +3140,24 @@ void SessionImpl::setGlobalDownloadSpeedLimit(const int limit) | |
int SessionImpl::globalUploadSpeedLimit() const | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
- return m_globalUploadSpeedLimit * 1024; | |
+ return m_globalUploadSpeedLimit * 1000; | |
} | |
void SessionImpl::setGlobalUploadSpeedLimit(const int limit) | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
if (limit == globalUploadSpeedLimit()) | |
return; | |
if (limit <= 0) | |
m_globalUploadSpeedLimit = 0; | |
- else if (limit <= 1024) | |
+ else if (limit <= 1000) | |
m_globalUploadSpeedLimit = 1; | |
else | |
- m_globalUploadSpeedLimit = (limit / 1024); | |
+ m_globalUploadSpeedLimit = (limit / 1000); | |
if (!isAltGlobalSpeedLimitEnabled()) | |
configureDeferred(); | |
@@ -3165,24 +3165,24 @@ void SessionImpl::setGlobalUploadSpeedLimit(const int limit) | |
int SessionImpl::altGlobalDownloadSpeedLimit() const | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
- return m_altGlobalDownloadSpeedLimit * 1024; | |
+ return m_altGlobalDownloadSpeedLimit * 1000; | |
} | |
void SessionImpl::setAltGlobalDownloadSpeedLimit(const int limit) | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
if (limit == altGlobalDownloadSpeedLimit()) | |
return; | |
if (limit <= 0) | |
m_altGlobalDownloadSpeedLimit = 0; | |
- else if (limit <= 1024) | |
+ else if (limit <= 1000) | |
m_altGlobalDownloadSpeedLimit = 1; | |
else | |
- m_altGlobalDownloadSpeedLimit = (limit / 1024); | |
+ m_altGlobalDownloadSpeedLimit = (limit / 1000); | |
if (isAltGlobalSpeedLimitEnabled()) | |
configureDeferred(); | |
@@ -3190,24 +3190,24 @@ void SessionImpl::setAltGlobalDownloadSpeedLimit(const int limit) | |
int SessionImpl::altGlobalUploadSpeedLimit() const | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
- return m_altGlobalUploadSpeedLimit * 1024; | |
+ return m_altGlobalUploadSpeedLimit * 1000; | |
} | |
void SessionImpl::setAltGlobalUploadSpeedLimit(const int limit) | |
{ | |
- // Unfortunately the value was saved as KiB instead of B. | |
+ // Unfortunately the value was saved as KB instead of B. | |
// But it is better to pass it around internally(+ webui) as Bytes. | |
if (limit == altGlobalUploadSpeedLimit()) | |
return; | |
if (limit <= 0) | |
m_altGlobalUploadSpeedLimit = 0; | |
- else if (limit <= 1024) | |
+ else if (limit <= 1000) | |
m_altGlobalUploadSpeedLimit = 1; | |
else | |
- m_altGlobalUploadSpeedLimit = (limit / 1024); | |
+ m_altGlobalUploadSpeedLimit = (limit / 1000); | |
if (isAltGlobalSpeedLimitEnabled()) | |
configureDeferred(); | |
@@ -4109,12 +4109,12 @@ int SessionImpl::downloadRateForSlowTorrents() const | |
return m_downloadRateForSlowTorrents; | |
} | |
-void SessionImpl::setDownloadRateForSlowTorrents(const int rateInKibiBytes) | |
+void SessionImpl::setDownloadRateForSlowTorrents(const int rateInKiloBytes) | |
{ | |
- if (rateInKibiBytes == m_downloadRateForSlowTorrents) | |
+ if (rateInKiloBytes == m_downloadRateForSlowTorrents) | |
return; | |
- m_downloadRateForSlowTorrents = rateInKibiBytes; | |
+ m_downloadRateForSlowTorrents = rateInKiloBytes; | |
configureDeferred(); | |
} | |
@@ -4123,12 +4123,12 @@ int SessionImpl::uploadRateForSlowTorrents() const | |
return m_uploadRateForSlowTorrents; | |
} | |
-void SessionImpl::setUploadRateForSlowTorrents(const int rateInKibiBytes) | |
+void SessionImpl::setUploadRateForSlowTorrents(const int rateInKiloBytes) | |
{ | |
- if (rateInKibiBytes == m_uploadRateForSlowTorrents) | |
+ if (rateInKiloBytes == m_uploadRateForSlowTorrents) | |
return; | |
- m_uploadRateForSlowTorrents = rateInKibiBytes; | |
+ m_uploadRateForSlowTorrents = rateInKiloBytes; | |
configureDeferred(); | |
} | |
diff --git a/src/base/bittorrent/sessionimpl.h b/src/base/bittorrent/sessionimpl.h | |
index 45b4bf2d8..861bafdb9 100644 | |
--- a/src/base/bittorrent/sessionimpl.h | |
+++ b/src/base/bittorrent/sessionimpl.h | |
@@ -302,9 +302,9 @@ namespace BitTorrent | |
bool ignoreSlowTorrentsForQueueing() const override; | |
void setIgnoreSlowTorrentsForQueueing(bool ignore) override; | |
int downloadRateForSlowTorrents() const override; | |
- void setDownloadRateForSlowTorrents(int rateInKibiBytes) override; | |
+ void setDownloadRateForSlowTorrents(int rateInKiloBytes) override; | |
int uploadRateForSlowTorrents() const override; | |
- void setUploadRateForSlowTorrents(int rateInKibiBytes) override; | |
+ void setUploadRateForSlowTorrents(int rateInKiloBytes) override; | |
int slowTorrentsInactivityTimer() const override; | |
void setSlowTorrentsInactivityTimer(int timeInSeconds) override; | |
int outgoingPortsMin() const override; | |
diff --git a/src/base/utils/misc.cpp b/src/base/utils/misc.cpp | |
index e9803f36c..0dd10e854 100644 | |
--- a/src/base/utils/misc.cpp | |
+++ b/src/base/utils/misc.cpp | |
@@ -75,17 +75,15 @@ namespace | |
const struct { const char *source; const char *comment; } units[] = | |
{ | |
QT_TRANSLATE_NOOP3("misc", "B", "bytes"), | |
- QT_TRANSLATE_NOOP3("misc", "KiB", "kibibytes (1024 bytes)"), | |
- QT_TRANSLATE_NOOP3("misc", "MiB", "mebibytes (1024 kibibytes)"), | |
- QT_TRANSLATE_NOOP3("misc", "GiB", "gibibytes (1024 mibibytes)"), | |
- QT_TRANSLATE_NOOP3("misc", "TiB", "tebibytes (1024 gibibytes)"), | |
- QT_TRANSLATE_NOOP3("misc", "PiB", "pebibytes (1024 tebibytes)"), | |
- QT_TRANSLATE_NOOP3("misc", "EiB", "exbibytes (1024 pebibytes)") | |
+ QT_TRANSLATE_NOOP3("misc", "KB", "kilobytes (1000 bytes)"), | |
+ QT_TRANSLATE_NOOP3("misc", "MB", "megabytes (1000 kilobytes)"), | |
+ QT_TRANSLATE_NOOP3("misc", "GB", "gigabytes (1000 megabytes)"), | |
+ QT_TRANSLATE_NOOP3("misc", "TB", "terabytes (1000 gigabytes)"), | |
+ QT_TRANSLATE_NOOP3("misc", "PB", "petabytes (1000 terabytes)"), | |
+ QT_TRANSLATE_NOOP3("misc", "EB", "exabytes (1000 petabytes)") | |
}; | |
- // return best userfriendly storage unit (B, KiB, MiB, GiB, TiB, ...) | |
- // use Binary prefix standards from IEC 60027-2 | |
- // see http://en.wikipedia.org/wiki/Kilobyte | |
+ // return best userfriendly storage unit (B, KB, MB, GB, TB, ...) | |
// value must be given in bytes | |
// to send numbers instead of strings with suffixes | |
struct SplitToFriendlyUnitResult | |
@@ -102,9 +100,9 @@ namespace | |
int i = 0; | |
auto value = static_cast<qreal>(bytes); | |
- while ((value >= 1024) && (i < static_cast<int>(Utils::Misc::SizeUnit::ExbiByte))) | |
+ while ((value >= 1000) && (i < static_cast<int>(Utils::Misc::SizeUnit::ExaByte))) | |
{ | |
- value /= 1024; | |
+ value /= 1000; | |
++i; | |
} | |
return {{value, static_cast<Utils::Misc::SizeUnit>(i)}}; | |
@@ -279,10 +277,10 @@ int Utils::Misc::friendlyUnitPrecision(const SizeUnit unit) | |
{ | |
case SizeUnit::Byte: | |
return 0; | |
- case SizeUnit::KibiByte: | |
- case SizeUnit::MebiByte: | |
+ case SizeUnit::KiloByte: | |
+ case SizeUnit::MegaByte: | |
return 1; | |
- case SizeUnit::GibiByte: | |
+ case SizeUnit::GigaByte: | |
return 2; | |
default: | |
return 3; | |
@@ -292,7 +290,7 @@ int Utils::Misc::friendlyUnitPrecision(const SizeUnit unit) | |
qlonglong Utils::Misc::sizeInBytes(qreal size, const Utils::Misc::SizeUnit unit) | |
{ | |
for (int i = 0; i < static_cast<int>(unit); ++i) | |
- size *= 1024; | |
+ size *= 1000; | |
return size; | |
} | |
diff --git a/src/base/utils/misc.h b/src/base/utils/misc.h | |
index fc1eac40d..22748f769 100644 | |
--- a/src/base/utils/misc.h | |
+++ b/src/base/utils/misc.h | |
@@ -44,20 +44,15 @@ enum class ShutdownDialogAction; | |
namespace Utils::Misc | |
{ | |
- // use binary prefix standards from IEC 60027-2 | |
- // see http://en.wikipedia.org/wiki/Kilobyte | |
enum class SizeUnit | |
{ | |
- Byte, // 1024^0, | |
- KibiByte, // 1024^1, | |
- MebiByte, // 1024^2, | |
- GibiByte, // 1024^3, | |
- TebiByte, // 1024^4, | |
- PebiByte, // 1024^5, | |
- ExbiByte // 1024^6, | |
- // int64 is used for sizes and thus the next units can not be handled | |
- // ZebiByte, // 1024^7, | |
- // YobiByte, // 1024^8 | |
+ Byte, | |
+ KiloByte, | |
+ MegaByte, | |
+ GigaByte, | |
+ TeraByte, | |
+ PetaByte, | |
+ ExaByte | |
}; | |
QString parseHtmlLinks(const QString &rawText); | |
@@ -72,7 +67,7 @@ namespace Utils::Misc | |
QString unitString(SizeUnit unit, bool isSpeed = false); | |
- // return the best user friendly storage unit (B, KiB, MiB, GiB, TiB) | |
+ // return the best user friendly storage unit (B, KB, MB, GB, TB) | |
// value must be given in bytes | |
QString friendlyUnit(qint64 bytes, bool isSpeed = false); | |
int friendlyUnitPrecision(SizeUnit unit); | |
diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp | |
index fb8618f6d..73d87b205 100644 | |
--- a/src/gui/advancedsettings.cpp | |
+++ b/src/gui/advancedsettings.cpp | |
@@ -206,7 +206,7 @@ void AdvancedSettings::saveAdvancedSettings() const | |
session->setDiskCacheTTL(m_spinBoxCacheTTL.value()); | |
#endif | |
// Disk queue size | |
- session->setDiskQueueSize(m_spinBoxDiskQueueSize.value() * 1024); | |
+ session->setDiskQueueSize(m_spinBoxDiskQueueSize.value() * 1000); | |
#ifdef QBT_USES_LIBTORRENT2 | |
session->setDiskIOType(m_comboBoxDiskIOType.currentData().value<BitTorrent::DiskIOType>()); | |
#endif | |
@@ -323,7 +323,7 @@ void AdvancedSettings::updateCacheSpinSuffix(const int value) | |
else if (value < 0) | |
m_spinBoxCache.setSuffix(tr(" (auto)")); | |
else | |
- m_spinBoxCache.setSuffix(tr(" MiB")); | |
+ m_spinBoxCache.setSuffix(tr(" MB")); | |
} | |
#endif | |
@@ -421,7 +421,7 @@ void AdvancedSettings::loadAdvancedSettings() | |
// Physical memory (RAM) usage limit | |
m_spinBoxMemoryWorkingSetLimit.setMinimum(1); | |
m_spinBoxMemoryWorkingSetLimit.setMaximum(std::numeric_limits<int>::max()); | |
- m_spinBoxMemoryWorkingSetLimit.setSuffix(tr(" MiB")); | |
+ m_spinBoxMemoryWorkingSetLimit.setSuffix(tr(" MB")); | |
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"(?)")) | |
@@ -471,7 +471,7 @@ void AdvancedSettings::loadAdvancedSettings() | |
m_spinBoxCheckingMemUsage.setMaximum(128); | |
#endif | |
m_spinBoxCheckingMemUsage.setValue(session->checkingMemUsage()); | |
- m_spinBoxCheckingMemUsage.setSuffix(tr(" MiB")); | |
+ m_spinBoxCheckingMemUsage.setSuffix(tr(" MB")); | |
addRow(CHECKING_MEM_USAGE, (tr("Outstanding memory when checking torrents") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#checking_mem_usage", u"(?)")) | |
, &m_spinBoxCheckingMemUsage); | |
#ifndef QBT_USES_LIBTORRENT2 | |
@@ -481,7 +481,7 @@ void AdvancedSettings::loadAdvancedSettings() | |
#ifdef QBT_APP_64BIT | |
m_spinBoxCache.setMaximum(33554431); // 32768GiB | |
#else | |
- // allocate 1536MiB and leave 512MiB to the rest of program data in RAM | |
+ // allocate 1536MB and leave 512MB to the rest of program data in RAM | |
m_spinBoxCache.setMaximum(1536); | |
#endif | |
m_spinBoxCache.setValue(session->diskCacheSize()); | |
@@ -501,8 +501,8 @@ void AdvancedSettings::loadAdvancedSettings() | |
// Disk queue size | |
m_spinBoxDiskQueueSize.setMinimum(1); | |
m_spinBoxDiskQueueSize.setMaximum(std::numeric_limits<int>::max()); | |
- m_spinBoxDiskQueueSize.setValue(session->diskQueueSize() / 1024); | |
- m_spinBoxDiskQueueSize.setSuffix(tr(" KiB")); | |
+ m_spinBoxDiskQueueSize.setValue(session->diskQueueSize() / 1000); | |
+ m_spinBoxDiskQueueSize.setSuffix(tr(" KB")); | |
addRow(DISK_QUEUE_SIZE, (tr("Disk queue size") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#max_queued_disk_bytes", u"(?)")) | |
, &m_spinBoxDiskQueueSize); | |
#ifdef QBT_USES_LIBTORRENT2 | |
@@ -545,13 +545,13 @@ void AdvancedSettings::loadAdvancedSettings() | |
// Send buffer watermark | |
m_spinBoxSendBufferWatermark.setMinimum(1); | |
m_spinBoxSendBufferWatermark.setMaximum(std::numeric_limits<int>::max()); | |
- m_spinBoxSendBufferWatermark.setSuffix(tr(" KiB")); | |
+ m_spinBoxSendBufferWatermark.setSuffix(tr(" KB")); | |
m_spinBoxSendBufferWatermark.setValue(session->sendBufferWatermark()); | |
addRow(SEND_BUF_WATERMARK, (tr("Send buffer watermark") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark", u"(?)")) | |
, &m_spinBoxSendBufferWatermark); | |
m_spinBoxSendBufferLowWatermark.setMinimum(1); | |
m_spinBoxSendBufferLowWatermark.setMaximum(std::numeric_limits<int>::max()); | |
- m_spinBoxSendBufferLowWatermark.setSuffix(tr(" KiB")); | |
+ m_spinBoxSendBufferLowWatermark.setSuffix(tr(" KB")); | |
m_spinBoxSendBufferLowWatermark.setValue(session->sendBufferLowWatermark()); | |
addRow(SEND_BUF_LOW_WATERMARK, (tr("Send buffer low watermark") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#send_buffer_low_watermark", u"(?)")) | |
, &m_spinBoxSendBufferLowWatermark); | |
diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp | |
index 5fd86649c..4abedd084 100644 | |
--- a/src/gui/mainwindow.cpp | |
+++ b/src/gui/mainwindow.cpp | |
@@ -1519,8 +1519,8 @@ void MainWindow::reloadSessionStats() | |
} | |
#else | |
const auto toolTip = u"%1\n%2"_qs.arg( | |
- tr("DL speed: %1", "e.g: Download speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadDownloadRate, true)) | |
- , tr("UP speed: %1", "e.g: Upload speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadUploadRate, true))); | |
+ tr("DL speed: %1", "e.g: Download speed: 10 KB/s").arg(Utils::Misc::friendlyUnit(status.payloadDownloadRate, true)) | |
+ , tr("UP speed: %1", "e.g: Upload speed: 10 KB/s").arg(Utils::Misc::friendlyUnit(status.payloadUploadRate, true))); | |
app()->desktopIntegration()->setToolTip(toolTip); // tray icon | |
#endif // Q_OS_MACOS | |
diff --git a/src/gui/optionsdialog.cpp b/src/gui/optionsdialog.cpp | |
index 66ceb7f58..063e49abf 100644 | |
--- a/src/gui/optionsdialog.cpp | |
+++ b/src/gui/optionsdialog.cpp | |
@@ -305,7 +305,7 @@ void OptionsDialog::loadBehaviorTabOptions() | |
m_ui->checkFileLogDelete->setChecked(fileLogDelete); | |
m_ui->spinFileLogAge->setEnabled(fileLogEnabled && fileLogDelete); | |
m_ui->comboFileLogAgeType->setEnabled(fileLogEnabled && fileLogDelete); | |
- m_ui->spinFileLogSize->setValue(app()->fileLoggerMaxSize() / 1024); | |
+ m_ui->spinFileLogSize->setValue(app()->fileLoggerMaxSize() / 1000); | |
m_ui->spinFileLogAge->setValue(app()->fileLoggerAge()); | |
m_ui->comboFileLogAgeType->setCurrentIndex(app()->fileLoggerAgeType()); | |
@@ -449,7 +449,7 @@ void OptionsDialog::saveBehaviorTabOptions() const | |
app()->setFileLoggerPath(m_ui->textFileLogPath->selectedPath()); | |
app()->setFileLoggerBackup(m_ui->checkFileLogBackup->isChecked()); | |
- app()->setFileLoggerMaxSize(m_ui->spinFileLogSize->value() * 1024); | |
+ app()->setFileLoggerMaxSize(m_ui->spinFileLogSize->value() * 1000); | |
app()->setFileLoggerAge(m_ui->spinFileLogAge->value()); | |
app()->setFileLoggerAgeType(m_ui->comboFileLogAgeType->currentIndex()); | |
app()->setFileLoggerDeleteOld(m_ui->checkFileLogDelete->isChecked()); | |
@@ -886,12 +886,12 @@ void OptionsDialog::loadSpeedTabOptions() | |
const auto *session = BitTorrent::Session::instance(); | |
m_ui->labelGlobalRate->setPixmap(Utils::Gui::scaledPixmapSvg(UIThemeManager::instance()->getIconPath(u"slow_off"_qs), this, Utils::Gui::mediumIconSize(this).height())); | |
- m_ui->spinUploadLimit->setValue(session->globalUploadSpeedLimit() / 1024); | |
- m_ui->spinDownloadLimit->setValue(session->globalDownloadSpeedLimit() / 1024); | |
+ m_ui->spinUploadLimit->setValue(session->globalUploadSpeedLimit() / 1000); | |
+ m_ui->spinDownloadLimit->setValue(session->globalDownloadSpeedLimit() / 1000); | |
m_ui->labelAltRate->setPixmap(Utils::Gui::scaledPixmapSvg(UIThemeManager::instance()->getIconPath(u"slow"_qs), this, Utils::Gui::mediumIconSize(this).height())); | |
- m_ui->spinUploadLimitAlt->setValue(session->altGlobalUploadSpeedLimit() / 1024); | |
- m_ui->spinDownloadLimitAlt->setValue(session->altGlobalDownloadSpeedLimit() / 1024); | |
+ m_ui->spinUploadLimitAlt->setValue(session->altGlobalUploadSpeedLimit() / 1000); | |
+ m_ui->spinDownloadLimitAlt->setValue(session->altGlobalDownloadSpeedLimit() / 1000); | |
m_ui->comboBoxScheduleDays->addItems(translatedWeekdayNames()); | |
@@ -925,11 +925,11 @@ void OptionsDialog::saveSpeedTabOptions() const | |
auto *pref = Preferences::instance(); | |
auto *session = BitTorrent::Session::instance(); | |
- session->setGlobalUploadSpeedLimit(m_ui->spinUploadLimit->value() * 1024); | |
- session->setGlobalDownloadSpeedLimit(m_ui->spinDownloadLimit->value() * 1024); | |
+ session->setGlobalUploadSpeedLimit(m_ui->spinUploadLimit->value() * 1000); | |
+ session->setGlobalDownloadSpeedLimit(m_ui->spinDownloadLimit->value() * 1000); | |
- session->setAltGlobalUploadSpeedLimit(m_ui->spinUploadLimitAlt->value() * 1024); | |
- session->setAltGlobalDownloadSpeedLimit(m_ui->spinDownloadLimitAlt->value() * 1024); | |
+ session->setAltGlobalUploadSpeedLimit(m_ui->spinUploadLimitAlt->value() * 1000); | |
+ session->setAltGlobalDownloadSpeedLimit(m_ui->spinDownloadLimitAlt->value() * 1000); | |
session->setBandwidthSchedulerEnabled(m_ui->groupBoxSchedule->isChecked()); | |
pref->setSchedulerStartTime(m_ui->timeEditScheduleFrom->time()); | |
diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui | |
index e407d79e9..7534bbf42 100644 | |
--- a/src/gui/optionsdialog.ui | |
+++ b/src/gui/optionsdialog.ui | |
@@ -617,13 +617,13 @@ | |
<item> | |
<widget class="QSpinBox" name="spinFileLogSize"> | |
<property name="suffix"> | |
- <string> KiB</string> | |
+ <string> KB</string> | |
</property> | |
<property name="minimum"> | |
<number>1</number> | |
</property> | |
<property name="maximum"> | |
- <number>1024000</number> | |
+ <number>1000000</number> | |
</property> | |
<property name="value"> | |
<number>65</number> | |
@@ -2042,7 +2042,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -2058,7 +2058,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -2113,7 +2113,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -2249,7 +2249,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -2637,7 +2637,7 @@ Disable encryption: Only connect to peers without protocol encryption</string> | |
<item row="0" column="1"> | |
<widget class="QSpinBox" name="spinDownloadRateForSlowTorrents"> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -2650,7 +2650,7 @@ Disable encryption: Only connect to peers without protocol encryption</string> | |
<item row="1" column="1"> | |
<widget class="QSpinBox" name="spinUploadRateForSlowTorrents"> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp | |
index b8875a6e7..9b56407a7 100644 | |
--- a/src/gui/properties/propertieswidget.cpp | |
+++ b/src/gui/properties/propertieswidget.cpp | |
@@ -482,12 +482,12 @@ void PropertiesWidget::loadDynamicData() | |
const qlonglong dlDuration = m_torrent->activeTime() - m_torrent->finishedTime(); | |
const QString dlAvg = Utils::Misc::friendlyUnit((m_torrent->totalDownload() / ((dlDuration == 0) ? -1 : dlDuration)), true); | |
- m_ui->labelDlSpeedVal->setText(tr("%1 (%2 avg.)", "%1 and %2 are speed rates, e.g. 200KiB/s (100KiB/s avg.)") | |
+ m_ui->labelDlSpeedVal->setText(tr("%1 (%2 avg.)", "%1 and %2 are speed rates, e.g. 200KB/s (100KB/s avg.)") | |
.arg(Utils::Misc::friendlyUnit(m_torrent->downloadPayloadRate(), true), dlAvg)); | |
const qlonglong ulDuration = m_torrent->activeTime(); | |
const QString ulAvg = Utils::Misc::friendlyUnit((m_torrent->totalUpload() / ((ulDuration == 0) ? -1 : ulDuration)), true); | |
- m_ui->labelUpSpeedVal->setText(tr("%1 (%2 avg.)", "%1 and %2 are speed rates, e.g. 200KiB/s (100KiB/s avg.)") | |
+ m_ui->labelUpSpeedVal->setText(tr("%1 (%2 avg.)", "%1 and %2 are speed rates, e.g. 200KB/s (100KB/s avg.)") | |
.arg(Utils::Misc::friendlyUnit(m_torrent->uploadPayloadRate(), true), ulAvg)); | |
m_ui->labelLastSeenCompleteVal->setText(m_torrent->lastSeenComplete().isValid() ? QLocale().toString(m_torrent->lastSeenComplete(), QLocale::ShortFormat) : tr("Never")); | |
diff --git a/src/gui/properties/speedplotview.cpp b/src/gui/properties/speedplotview.cpp | |
index 08f9785f0..9bed875f9 100644 | |
--- a/src/gui/properties/speedplotview.cpp | |
+++ b/src/gui/properties/speedplotview.cpp | |
@@ -63,9 +63,9 @@ namespace | |
if (value <= 12.0) return {12, SizeUnit::Byte}; | |
SizeUnit calculatedUnit = SizeUnit::Byte; | |
- while (value > 1024) | |
+ while (value > 1000) | |
{ | |
- value /= 1024; | |
+ value /= 1000; | |
calculatedUnit = static_cast<SizeUnit>(static_cast<int>(calculatedUnit) + 1); | |
} | |
diff --git a/src/gui/rss/htmlbrowser.cpp b/src/gui/rss/htmlbrowser.cpp | |
index d2797192a..2a453c62b 100644 | |
--- a/src/gui/rss/htmlbrowser.cpp | |
+++ b/src/gui/rss/htmlbrowser.cpp | |
@@ -48,7 +48,7 @@ HtmlBrowser::HtmlBrowser(QWidget *parent) | |
m_diskCache = new QNetworkDiskCache(this); | |
m_diskCache->setCacheDirectory((specialFolderLocation(SpecialFolder::Cache) / Path(u"rss"_qs)).data()); | |
m_diskCache->setMaximumCacheSize(50 * 1024 * 1024); | |
- qDebug() << "HtmlBrowser cache path:" << m_diskCache->cacheDirectory() << " max size:" << m_diskCache->maximumCacheSize() / 1024 / 1024 << "MB"; | |
+ qDebug() << "HtmlBrowser cache path:" << m_diskCache->cacheDirectory() << " max size:" << m_diskCache->maximumCacheSize() / 1000 / 1000 << "MB"; | |
m_netManager->setCache(m_diskCache); | |
connect(m_netManager, &QNetworkAccessManager::finished, this, &HtmlBrowser::resourceLoaded); | |
diff --git a/src/gui/search/searchjobwidget.cpp b/src/gui/search/searchjobwidget.cpp | |
index 3b7cb37d1..6f2b6fd90 100644 | |
--- a/src/gui/search/searchjobwidget.cpp | |
+++ b/src/gui/search/searchjobwidget.cpp | |
@@ -332,12 +332,12 @@ void SearchJobWidget::fillFilterComboBoxes() | |
QStringList unitStrings; | |
unitStrings.append(unitString(SizeUnit::Byte)); | |
- unitStrings.append(unitString(SizeUnit::KibiByte)); | |
- unitStrings.append(unitString(SizeUnit::MebiByte)); | |
- unitStrings.append(unitString(SizeUnit::GibiByte)); | |
- unitStrings.append(unitString(SizeUnit::TebiByte)); | |
- unitStrings.append(unitString(SizeUnit::PebiByte)); | |
- unitStrings.append(unitString(SizeUnit::ExbiByte)); | |
+ unitStrings.append(unitString(SizeUnit::KiloByte)); | |
+ unitStrings.append(unitString(SizeUnit::MegaByte)); | |
+ unitStrings.append(unitString(SizeUnit::GigaByte)); | |
+ unitStrings.append(unitString(SizeUnit::TeraByte)); | |
+ unitStrings.append(unitString(SizeUnit::PetaByte)); | |
+ unitStrings.append(unitString(SizeUnit::ExaByte)); | |
m_ui->minSizeUnit->clear(); | |
m_ui->maxSizeUnit->clear(); | |
@@ -345,10 +345,10 @@ void SearchJobWidget::fillFilterComboBoxes() | |
m_ui->maxSizeUnit->addItems(unitStrings); | |
m_ui->minSize->setValue(0); | |
- m_ui->minSizeUnit->setCurrentIndex(static_cast<int>(SizeUnit::MebiByte)); | |
+ m_ui->minSizeUnit->setCurrentIndex(static_cast<int>(SizeUnit::MegaByte)); | |
m_ui->maxSize->setValue(-1); | |
- m_ui->maxSizeUnit->setCurrentIndex(static_cast<int>(SizeUnit::GibiByte)); | |
+ m_ui->maxSizeUnit->setCurrentIndex(static_cast<int>(SizeUnit::GigaByte)); | |
m_ui->filterMode->clear(); | |
diff --git a/src/gui/speedlimitdialog.cpp b/src/gui/speedlimitdialog.cpp | |
index 165ece724..37986c6df 100644 | |
--- a/src/gui/speedlimitdialog.cpp | |
+++ b/src/gui/speedlimitdialog.cpp | |
@@ -67,17 +67,17 @@ SpeedLimitDialog::SpeedLimitDialog(QWidget *parent) | |
slider->setValue(value); | |
}; | |
const auto *session = BitTorrent::Session::instance(); | |
- const int uploadVal = std::max(0, (session->globalUploadSpeedLimit() / 1024)); | |
- const int downloadVal = std::max(0, (session->globalDownloadSpeedLimit() / 1024)); | |
- const int maxUpload = std::max(10000, (session->globalUploadSpeedLimit() / 1024)); | |
- const int maxDownload = std::max(10000, (session->globalDownloadSpeedLimit() / 1024)); | |
+ const int uploadVal = std::max(0, (session->globalUploadSpeedLimit() / 1000)); | |
+ const int downloadVal = std::max(0, (session->globalDownloadSpeedLimit() / 1000)); | |
+ const int maxUpload = std::max(10000, (session->globalUploadSpeedLimit() / 1000)); | |
+ const int maxDownload = std::max(10000, (session->globalDownloadSpeedLimit() / 1000)); | |
initSlider(m_ui->sliderUploadLimit, uploadVal, maxUpload); | |
initSlider(m_ui->sliderDownloadLimit, downloadVal, maxDownload); | |
- const int altUploadVal = std::max(0, (session->altGlobalUploadSpeedLimit() / 1024)); | |
- const int altDownloadVal = std::max(0, (session->altGlobalDownloadSpeedLimit() / 1024)); | |
- const int altMaxUpload = std::max(10000, (session->altGlobalUploadSpeedLimit() / 1024)); | |
- const int altMaxDownload = std::max(10000, (session->altGlobalDownloadSpeedLimit() / 1024)); | |
+ const int altUploadVal = std::max(0, (session->altGlobalUploadSpeedLimit() / 1000)); | |
+ const int altDownloadVal = std::max(0, (session->altGlobalDownloadSpeedLimit() / 1000)); | |
+ const int altMaxUpload = std::max(10000, (session->altGlobalUploadSpeedLimit() / 1000)); | |
+ const int altMaxDownload = std::max(10000, (session->altGlobalDownloadSpeedLimit() / 1000)); | |
initSlider(m_ui->sliderAltUploadLimit, altUploadVal, altMaxUpload); | |
initSlider(m_ui->sliderAltDownloadLimit, altDownloadVal, altMaxDownload); | |
@@ -121,19 +121,19 @@ SpeedLimitDialog::~SpeedLimitDialog() | |
void SpeedLimitDialog::accept() | |
{ | |
auto *session = BitTorrent::Session::instance(); | |
- const int uploadLimit = (m_ui->spinUploadLimit->value() * 1024); | |
+ const int uploadLimit = (m_ui->spinUploadLimit->value() * 1000); | |
if (m_initialValues.uploadSpeedLimit != m_ui->spinUploadLimit->value()) | |
session->setGlobalUploadSpeedLimit(uploadLimit); | |
- const int downloadLimit = (m_ui->spinDownloadLimit->value() * 1024); | |
+ const int downloadLimit = (m_ui->spinDownloadLimit->value() * 1000); | |
if (m_initialValues.downloadSpeedLimit != m_ui->spinDownloadLimit->value()) | |
session->setGlobalDownloadSpeedLimit(downloadLimit); | |
- const int altUploadLimit = (m_ui->spinAltUploadLimit->value() * 1024); | |
+ const int altUploadLimit = (m_ui->spinAltUploadLimit->value() * 1000); | |
if (m_initialValues.altUploadSpeedLimit != m_ui->spinAltUploadLimit->value()) | |
session->setAltGlobalUploadSpeedLimit(altUploadLimit); | |
- const int altDownloadLimit = (m_ui->spinAltDownloadLimit->value() * 1024); | |
+ const int altDownloadLimit = (m_ui->spinAltDownloadLimit->value() * 1000); | |
if (m_initialValues.altDownloadSpeedLimit != m_ui->spinAltDownloadLimit->value()) | |
session->setAltGlobalDownloadSpeedLimit(altDownloadLimit); | |
diff --git a/src/gui/speedlimitdialog.ui b/src/gui/speedlimitdialog.ui | |
index ea680b6a2..b3f865ee6 100644 | |
--- a/src/gui/speedlimitdialog.ui | |
+++ b/src/gui/speedlimitdialog.ui | |
@@ -47,7 +47,7 @@ | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -74,7 +74,7 @@ | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -117,7 +117,7 @@ | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -144,7 +144,7 @@ | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
diff --git a/src/gui/torrentcreatordialog.cpp b/src/gui/torrentcreatordialog.cpp | |
index c91953be5..6c5d85817 100644 | |
--- a/src/gui/torrentcreatordialog.cpp | |
+++ b/src/gui/torrentcreatordialog.cpp | |
@@ -141,7 +141,7 @@ BitTorrent::TorrentFormat TorrentCreatorDialog::getTorrentFormat() const | |
int TorrentCreatorDialog::getPaddedFileSizeLimit() const | |
{ | |
const int value = m_ui->spinPaddedFileSizeLimit->value(); | |
- return ((value >= 0) ? (value * 1024) : -1); | |
+ return ((value >= 0) ? (value * 1000) : -1); | |
} | |
#endif | |
diff --git a/src/gui/torrentcreatordialog.ui b/src/gui/torrentcreatordialog.ui | |
index 90b931872..098fa67bc 100644 | |
--- a/src/gui/torrentcreatordialog.ui | |
+++ b/src/gui/torrentcreatordialog.ui | |
@@ -338,7 +338,7 @@ | |
<string>Disabled</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB</string> | |
+ <string> KB</string> | |
</property> | |
<property name="minimum"> | |
<number>-1</number> | |
diff --git a/src/gui/torrentoptionsdialog.cpp b/src/gui/torrentoptionsdialog.cpp | |
index f31dbe969..701f436fc 100644 | |
--- a/src/gui/torrentoptionsdialog.cpp | |
+++ b/src/gui/torrentoptionsdialog.cpp | |
@@ -226,14 +226,14 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTor | |
const bool isAltLimitEnabled = session->isAltGlobalSpeedLimitEnabled(); | |
const int globalUploadLimit = isAltLimitEnabled | |
- ? (session->altGlobalUploadSpeedLimit() / 1024) | |
- : (session->globalUploadSpeedLimit() / 1024); | |
+ ? (session->altGlobalUploadSpeedLimit() / 1000) | |
+ : (session->globalUploadSpeedLimit() / 1000); | |
const int globalDownloadLimit = isAltLimitEnabled | |
- ? (session->altGlobalDownloadSpeedLimit() / 1024) | |
- : (session->globalDownloadSpeedLimit() / 1024); | |
+ ? (session->altGlobalDownloadSpeedLimit() / 1000) | |
+ : (session->globalDownloadSpeedLimit() / 1000); | |
- const int uploadVal = std::max(0, (firstTorrentUpLimit / 1024)); | |
- const int downloadVal = std::max(0, (firstTorrentDownLimit / 1024)); | |
+ const int uploadVal = std::max(0, (firstTorrentUpLimit / 1000)); | |
+ const int downloadVal = std::max(0, (firstTorrentDownLimit / 1000)); | |
int maxUpload = (globalUploadLimit <= 0) ? 10000 : globalUploadLimit; | |
int maxDownload = (globalDownloadLimit <= 0) ? 10000 : globalDownloadLimit; | |
@@ -447,9 +447,9 @@ void TorrentOptionsDialog::accept() | |
} | |
if (m_initialValues.upSpeedLimit != m_ui->spinUploadLimit->value()) | |
- torrent->setUploadLimit(m_ui->spinUploadLimit->value() * 1024); | |
+ torrent->setUploadLimit(m_ui->spinUploadLimit->value() * 1000); | |
if (m_initialValues.downSpeedLimit != m_ui->spinDownloadLimit->value()) | |
- torrent->setDownloadLimit(m_ui->spinDownloadLimit->value() * 1024); | |
+ torrent->setDownloadLimit(m_ui->spinDownloadLimit->value() * 1000); | |
const qreal ratioLimit = getRatio(); | |
if (m_initialValues.ratio != ratioLimit) | |
diff --git a/src/gui/torrentoptionsdialog.ui b/src/gui/torrentoptionsdialog.ui | |
index 05d10121c..d3b9ba585 100644 | |
--- a/src/gui/torrentoptionsdialog.ui | |
+++ b/src/gui/torrentoptionsdialog.ui | |
@@ -99,7 +99,7 @@ | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
@@ -112,7 +112,7 @@ | |
<string>∞</string> | |
</property> | |
<property name="suffix"> | |
- <string> KiB/s</string> | |
+ <string> KB/s</string> | |
</property> | |
<property name="maximum"> | |
<number>2000000</number> | |
diff --git a/src/webui/www/private/download.html b/src/webui/www/private/download.html | |
index 3cf9034f5..0e8656a16 100644 | |
--- a/src/webui/www/private/download.html | |
+++ b/src/webui/www/private/download.html | |
@@ -133,7 +133,7 @@ | |
</td> | |
<td> | |
<input type="hidden" id="dlLimitHidden" name="dlLimit" /> | |
- <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KiB/s" /> | |
+ <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KB/s" /> | |
</td> | |
</tr> | |
<tr> | |
@@ -142,7 +142,7 @@ | |
</td> | |
<td> | |
<input type="hidden" id="upLimitHidden" name="upLimit" /> | |
- <input type="text" id="upLimitText" style="width: 16em;" placeholder="KiB/s" /> | |
+ <input type="text" id="upLimitText" style="width: 16em;" placeholder="KB/s" /> | |
</td> | |
</tr> | |
</table> | |
@@ -170,8 +170,8 @@ | |
$('downloadForm').addEventListener("submit", function() { | |
$('startTorrentHidden').value = $('startTorrent').checked ? 'false' : 'true'; | |
- $('dlLimitHidden').value = $('dlLimitText').value.toInt() * 1024; | |
- $('upLimitHidden').value = $('upLimitText').value.toInt() * 1024; | |
+ $('dlLimitHidden').value = $('dlLimitText').value.toInt() * 1000; | |
+ $('upLimitHidden').value = $('upLimitText').value.toInt() * 1000; | |
$('download_spinner').style.display = "block"; | |
submitted = true; | |
diff --git a/src/webui/www/private/downloadlimit.html b/src/webui/www/private/downloadlimit.html | |
index 4371c9fb1..2dca9c77a 100644 | |
--- a/src/webui/www/private/downloadlimit.html | |
+++ b/src/webui/www/private/downloadlimit.html | |
@@ -14,7 +14,7 @@ | |
<body> | |
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden"> | |
<div id="dllimitSlider" class="slider"> | |
- <div id="dllimitUpdate" class="update">QBT_TR(Download limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="dllimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="dlLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]</span></div> | |
+ <div id="dllimitUpdate" class="update">QBT_TR(Download limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="dllimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="dlLimitUnit">KB/s</span></div> | |
<div class="sliderWrapper"> | |
<div id="dllimitSliderknob" class="sliderknob"></div> | |
<div id="dllimitSliderarea" class="sliderarea"></div> | |
@@ -26,7 +26,7 @@ | |
const hashes = new URI().getData('hashes').split('|'); | |
const setDlLimit = function() { | |
- const limit = $("dllimitUpdatevalue").value.toInt() * 1024; | |
+ const limit = $("dllimitUpdatevalue").value.toInt() * 1000; | |
if (hashes[0] == "global") { | |
new Request({ | |
url: 'api/v2/transfer/setDownloadLimit', | |
diff --git a/src/webui/www/private/scripts/misc.js b/src/webui/www/private/scripts/misc.js | |
index 618d6fec1..e591324b9 100644 | |
--- a/src/webui/www/private/scripts/misc.js | |
+++ b/src/webui/www/private/scripts/misc.js | |
@@ -54,30 +54,30 @@ window.qBittorrent.Misc = (function() { | |
*/ | |
const friendlyUnit = function(value, isSpeed) { | |
const units = [ | |
- "QBT_TR(B)QBT_TR[CONTEXT=misc]", | |
- "QBT_TR(KiB)QBT_TR[CONTEXT=misc]", | |
- "QBT_TR(MiB)QBT_TR[CONTEXT=misc]", | |
- "QBT_TR(GiB)QBT_TR[CONTEXT=misc]", | |
- "QBT_TR(TiB)QBT_TR[CONTEXT=misc]", | |
- "QBT_TR(PiB)QBT_TR[CONTEXT=misc]", | |
- "QBT_TR(EiB)QBT_TR[CONTEXT=misc]" | |
+ "B", | |
+ "KB", | |
+ "MB", | |
+ "GB", | |
+ "TB", | |
+ "PB", | |
+ "EB" | |
]; | |
if ((value === undefined) || (value === null) || (value < 0)) | |
- return "QBT_TR(Unknown)QBT_TR[CONTEXT=misc]"; | |
+ return "Unknown"; | |
let i = 0; | |
- while (value >= 1024.0 && i < 6) { | |
- value /= 1024.0; | |
+ while (value >= 1000.0 && i < 6) { | |
+ value /= 1000.0; | |
++i; | |
} | |
function friendlyUnitPrecision(sizeUnit) { | |
- if (sizeUnit <= 2) // KiB, MiB | |
+ if (sizeUnit <= 2) // KB, MB | |
return 1; | |
- else if (sizeUnit === 3) // GiB | |
+ else if (sizeUnit === 3) // GB | |
return 2; | |
- else // TiB, PiB, EiB | |
+ else // TB, PB, EB | |
return 3; | |
} | |
@@ -92,7 +92,7 @@ window.qBittorrent.Misc = (function() { | |
} | |
if (isSpeed) | |
- ret += "QBT_TR(/s)QBT_TR[CONTEXT=misc]"; | |
+ ret += "/s"; | |
return ret; | |
}; | |
diff --git a/src/webui/www/private/scripts/speedslider.js b/src/webui/www/private/scripts/speedslider.js | |
index be27c8f53..47eeecbbf 100644 | |
--- a/src/webui/www/private/scripts/speedslider.js | |
+++ b/src/webui/www/private/scripts/speedslider.js | |
@@ -41,7 +41,7 @@ MochaUI.extend({ | |
if (data) { | |
const tmp = data.toInt(); | |
if (tmp > 0) { | |
- maximum = tmp / 1024.0; | |
+ maximum = tmp / 1000.0; | |
} | |
else { | |
if (hashes[0] == "global") | |
@@ -103,7 +103,7 @@ MochaUI.extend({ | |
new Slider($('uplimitSliderarea'), $('uplimitSliderknob'), { | |
steps: maximum, | |
offset: 0, | |
- initialStep: (up_limit / 1024.0).round(), | |
+ initialStep: (up_limit / 1000.0).round(), | |
onChange: function(pos) { | |
if (pos > 0) { | |
$('uplimitUpdatevalue').value = pos; | |
@@ -121,7 +121,7 @@ MochaUI.extend({ | |
$('upLimitUnit').style.visibility = "hidden"; | |
} | |
else { | |
- $('uplimitUpdatevalue').value = (up_limit / 1024.0).round(); | |
+ $('uplimitUpdatevalue').value = (up_limit / 1000.0).round(); | |
$('upLimitUnit').style.visibility = "visible"; | |
} | |
} | |
@@ -145,7 +145,7 @@ MochaUI.extend({ | |
if (data) { | |
const tmp = data.toInt(); | |
if (tmp > 0) { | |
- maximum = tmp / 1024.0; | |
+ maximum = tmp / 1000.0; | |
} | |
else { | |
if (hashes[0] == "global") | |
@@ -207,7 +207,7 @@ MochaUI.extend({ | |
new Slider($('dllimitSliderarea'), $('dllimitSliderknob'), { | |
steps: maximum, | |
offset: 0, | |
- initialStep: (dl_limit / 1024.0).round(), | |
+ initialStep: (dl_limit / 1000.0).round(), | |
onChange: function(pos) { | |
if (pos > 0) { | |
$('dllimitUpdatevalue').value = pos; | |
@@ -225,7 +225,7 @@ MochaUI.extend({ | |
$('dlLimitUnit').style.visibility = "hidden"; | |
} | |
else { | |
- $('dllimitUpdatevalue').value = (dl_limit / 1024.0).round(); | |
+ $('dllimitUpdatevalue').value = (dl_limit / 1000.0).round(); | |
$('dlLimitUnit').style.visibility = "visible"; | |
} | |
} | |
diff --git a/src/webui/www/private/upload.html b/src/webui/www/private/upload.html | |
index 61b094c42..f71707dff 100644 | |
--- a/src/webui/www/private/upload.html | |
+++ b/src/webui/www/private/upload.html | |
@@ -121,7 +121,7 @@ | |
</td> | |
<td> | |
<input type="hidden" id="dlLimitHidden" name="dlLimit" /> | |
- <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KiB/s" /> | |
+ <input type="text" id="dlLimitText" style="width: 16em;" placeholder="KB/s" /> | |
</td> | |
</tr> | |
<tr> | |
@@ -130,7 +130,7 @@ | |
</td> | |
<td> | |
<input type="hidden" id="upLimitHidden" name="upLimit" /> | |
- <input type="text" id="upLimitText" style="width: 16em;" placeholder="KiB/s" /> | |
+ <input type="text" id="upLimitText" style="width: 16em;" placeholder="KB/s" /> | |
</td> | |
</tr> | |
</table> | |
@@ -147,8 +147,8 @@ | |
$('uploadForm').addEventListener("submit", function() { | |
$('startTorrentHidden').value = $('startTorrent').checked ? 'false' : 'true'; | |
- $('dlLimitHidden').value = $('dlLimitText').value.toInt() * 1024; | |
- $('upLimitHidden').value = $('upLimitText').value.toInt() * 1024; | |
+ $('dlLimitHidden').value = $('dlLimitText').value.toInt() * 1000; | |
+ $('upLimitHidden').value = $('upLimitText').value.toInt() * 1000; | |
$('upload_spinner').style.display = "block"; | |
submitted = true; | |
diff --git a/src/webui/www/private/uploadlimit.html b/src/webui/www/private/uploadlimit.html | |
index 044a8cf05..5f042dfc0 100644 | |
--- a/src/webui/www/private/uploadlimit.html | |
+++ b/src/webui/www/private/uploadlimit.html | |
@@ -14,7 +14,7 @@ | |
<body> | |
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden"> | |
<div id="uplimitSlider" class="slider"> | |
- <div id="uplimitUpdate" class="update">QBT_TR(Upload limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="uplimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="upLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]</span></div> | |
+ <div id="uplimitUpdate" class="update">QBT_TR(Upload limit:)QBT_TR[CONTEXT=PropertiesWidget] <input id="uplimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="upLimitUnit">KB/s]</span></div> | |
<div class="sliderWrapper"> | |
<div id="uplimitSliderknob" class="sliderknob"></div> | |
<div id="uplimitSliderarea" class="sliderarea"></div> | |
@@ -26,7 +26,7 @@ | |
const hashes = new URI().getData('hashes').split('|'); | |
const setUpLimit = function() { | |
- const limit = $("uplimitUpdatevalue").value.toInt() * 1024; | |
+ const limit = $("uplimitUpdatevalue").value.toInt() * 1000; | |
if (hashes[0] == "global") { | |
new Request({ | |
url: 'api/v2/transfer/setUploadLimit', | |
diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html | |
index 3c3634431..6054b49f8 100644 | |
--- a/src/webui/www/private/views/preferences.html | |
+++ b/src/webui/www/private/views/preferences.html | |
@@ -397,11 +397,11 @@ | |
<img src="images/slow_off.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]"> | |
</td> | |
<td><label for="up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td> | |
- <td><input type="number" id="up_limit_value" style="width: 4em;" min="0" /> QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td> | |
+ <td><input type="number" id="up_limit_value" style="width: 4em;" min="0" /> KB/s</td> | |
</tr> | |
<tr> | |
<td><label for="dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td> | |
- <td><input type="number" id="dl_limit_value" style="width: 4em;" min="0" /> QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td> | |
+ <td><input type="number" id="dl_limit_value" style="width: 4em;" min="0" /> KB/s</td> | |
</tr> | |
</table> | |
<i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i> | |
@@ -415,11 +415,11 @@ | |
<img src="images/slow.svg" style="height: 1.5em;" alt="QBT_TR(Alternative speed limits)QBT_TR[CONTEXT=MainWindow]"> | |
</td> | |
<td><label for="alt_up_limit_value">QBT_TR(Upload:)QBT_TR[CONTEXT=OptionsDialog]</label></td> | |
- <td><input type="number" id="alt_up_limit_value" style="width: 4em;" min="0" /> QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td> | |
+ <td><input type="number" id="alt_up_limit_value" style="width: 4em;" min="0" /> KB/s</td> | |
</tr> | |
<tr> | |
<td><label for="alt_dl_limit_value">QBT_TR(Download:)QBT_TR[CONTEXT=OptionsDialog]</label></td> | |
- <td><input type="number" id="alt_dl_limit_value" style="width: 4em;" min="0" /> QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog]</td> | |
+ <td><input type="number" id="alt_dl_limit_value" style="width: 4em;" min="0" /> KB/s</td> | |
</tr> | |
</table> | |
<i>QBT_TR(0 means unlimited)QBT_TR[CONTEXT=OptionsDialog]</i> | |
@@ -546,7 +546,7 @@ | |
<label for="dl_rate_threshold">QBT_TR(Download rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label> | |
</td> | |
<td> | |
- <input type="text" id="dl_rate_threshold" style="width: 4em;" /> QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="dl_rate_threshold" style="width: 4em;" /> KB/s | |
</td> | |
</tr> | |
<tr> | |
@@ -554,7 +554,7 @@ | |
<label for="ul_rate_threshold">QBT_TR(Upload rate threshold:)QBT_TR[CONTEXT=OptionsDialog]</label> | |
</td> | |
<td> | |
- <input type="text" id="ul_rate_threshold" style="width: 4em;" /> QBT_TR(KiB/s)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="ul_rate_threshold" style="width: 4em;" /> KB/s | |
</td> | |
</tr> | |
<tr> | |
@@ -895,7 +895,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
<label for="memoryWorkingSetLimit">QBT_TR(Physical memory (RAM) usage limit (applied if libtorrent >= 2.0):)QBT_TR[CONTEXT=OptionsDialog] <a href="https://wikipedia.org/wiki/Working_set" target="_blank">(?)</a></label> | |
</td> | |
<td> | |
- <input type="text" id="memoryWorkingSetLimit" style="width: 15em;" title="QBT_TR(This option is less effective on Linux)QBT_TR[CONTEXT=OptionsDialog]"> QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="memoryWorkingSetLimit" style="width: 15em;" title="QBT_TR(This option is less effective on Linux)QBT_TR[CONTEXT=OptionsDialog]"> MB/s | |
</td> | |
</tr> | |
<tr> | |
@@ -1014,7 +1014,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
<label for="outstandMemoryWhenCheckingTorrents">QBT_TR(Outstanding memory when checking torrents:)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#checking_mem_usage" target="_blank">(?)</a></label> | |
</td> | |
<td> | |
- <input type="text" id="outstandMemoryWhenCheckingTorrents" style="width: 15em;" /> QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="outstandMemoryWhenCheckingTorrents" style="width: 15em;" /> MB | |
</td> | |
</tr> | |
<tr> | |
@@ -1022,7 +1022,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
<label for="diskCache">QBT_TR(Disk cache (requires libtorrent < 2.0):)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#cache_size" target="_blank">(?)</a></label> | |
</td> | |
<td> | |
- <input type="text" id="diskCache" style="width: 15em;" /> QBT_TR(MiB)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="diskCache" style="width: 15em;" /> MB | |
</td> | |
</tr> | |
<tr> | |
@@ -1038,7 +1038,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
<label for="diskQueueSize">QBT_TR(Disk queue size:)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#max_queued_disk_bytes" target="_blank">(?)</a></label> | |
</td> | |
<td> | |
- <input type="text" id="diskQueueSize" style="width: 15em;"> QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="diskQueueSize" style="width: 15em;"> KB | |
</td> | |
</tr> | |
<tr> | |
@@ -1105,7 +1105,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
<label for="sendBufferWatermark">QBT_TR(Send buffer watermark:)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark" target="_blank">(?)</a></label> | |
</td> | |
<td> | |
- <input type="text" id="sendBufferWatermark" style="width: 15em;" /> QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="sendBufferWatermark" style="width: 15em;" /> KB | |
</td> | |
</tr> | |
<tr> | |
@@ -1113,7 +1113,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
<label for="sendBufferLowWatermark">QBT_TR(Send buffer low watermark:)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#send_buffer_low_watermark" target="_blank">(?)</a></label> | |
</td> | |
<td> | |
- <input type="text" id="sendBufferLowWatermark" style="width: 15em;" /> QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog] | |
+ <input type="text" id="sendBufferLowWatermark" style="width: 15em;" /> KB | |
</td> | |
</tr> | |
<tr> | |
@@ -1901,11 +1901,11 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
// Speed tab | |
// Global Rate Limits | |
- $('up_limit_value').setProperty('value', (pref.up_limit.toInt() / 1024)); | |
- $('dl_limit_value').setProperty('value', (pref.dl_limit.toInt() / 1024)); | |
+ $('up_limit_value').setProperty('value', (pref.up_limit.toInt() / 1000)); | |
+ $('dl_limit_value').setProperty('value', (pref.dl_limit.toInt() / 1000)); | |
// Alternative Global Rate Limits | |
- $('alt_up_limit_value').setProperty('value', (pref.alt_up_limit.toInt() / 1024)); | |
- $('alt_dl_limit_value').setProperty('value', (pref.alt_dl_limit.toInt() / 1024)); | |
+ $('alt_up_limit_value').setProperty('value', (pref.alt_up_limit.toInt() / 1000)); | |
+ $('alt_dl_limit_value').setProperty('value', (pref.alt_dl_limit.toInt() / 1000)); | |
$('enable_protocol_combobox').setProperty('value', pref.bittorrent_protocol); | |
$('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate); | |
@@ -2053,7 +2053,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
$('outstandMemoryWhenCheckingTorrents').setProperty('value', pref.checking_memory_use); | |
$('diskCache').setProperty('value', pref.disk_cache); | |
$('diskCacheExpiryInterval').setProperty('value', pref.disk_cache_ttl); | |
- $('diskQueueSize').setProperty('value', (pref.disk_queue_size / 1024)); | |
+ $('diskQueueSize').setProperty('value', (pref.disk_queue_size / 1000)); | |
$('diskIOType').setProperty('value', pref.disk_io_type); | |
$('diskIOReadMode').setProperty('value', pref.disk_io_read_mode); | |
$('diskIOWriteMode').setProperty('value', pref.disk_io_write_mode); | |
@@ -2243,14 +2243,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
// Speed tab | |
// Global Rate Limits | |
- const up_limit = $('up_limit_value').getProperty('value').toInt() * 1024; | |
+ const up_limit = $('up_limit_value').getProperty('value').toInt() * 1000; | |
if (isNaN(up_limit) || up_limit < 0) { | |
alert("QBT_TR(Global upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]"); | |
return; | |
} | |
settings.set('up_limit', up_limit); | |
- const dl_limit = $('dl_limit_value').getProperty('value').toInt() * 1024; | |
+ const dl_limit = $('dl_limit_value').getProperty('value').toInt() * 1000; | |
if (isNaN(dl_limit) || dl_limit < 0) { | |
alert("QBT_TR(Global download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]"); | |
return; | |
@@ -2258,14 +2258,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
settings.set('dl_limit', dl_limit); | |
// Alternative Global Rate Limits | |
- const alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt() * 1024; | |
+ const alt_up_limit = $('alt_up_limit_value').getProperty('value').toInt() * 1000; | |
if (isNaN(alt_up_limit) || alt_up_limit < 0) { | |
alert("QBT_TR(Alternative upload rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]"); | |
return; | |
} | |
settings.set('alt_up_limit', alt_up_limit); | |
- const alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt() * 1024; | |
+ const alt_dl_limit = $('alt_dl_limit_value').getProperty('value').toInt() * 1000; | |
if (isNaN(alt_dl_limit) || alt_dl_limit < 0) { | |
alert("QBT_TR(Alternative download rate limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]"); | |
return; | |
@@ -2482,7 +2482,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD | |
settings.set('checking_memory_use', $('outstandMemoryWhenCheckingTorrents').getProperty('value')); | |
settings.set('disk_cache', $('diskCache').getProperty('value')); | |
settings.set('disk_cache_ttl', $('diskCacheExpiryInterval').getProperty('value')); | |
- settings.set('disk_queue_size', ($('diskQueueSize').getProperty('value') * 1024)); | |
+ settings.set('disk_queue_size', ($('diskQueueSize').getProperty('value') * 1000)); | |
settings.set('disk_io_type', $('diskIOType').getProperty('value')); | |
settings.set('disk_io_read_mode', $('diskIOReadMode').getProperty('value')); | |
settings.set('disk_io_write_mode', $('diskIOWriteMode').getProperty('value')); | |
diff --git a/src/webui/www/private/views/search.html b/src/webui/www/private/views/search.html | |
index b37ca8541..1479937ed 100644 | |
--- a/src/webui/www/private/views/search.html | |
+++ b/src/webui/www/private/views/search.html | |
@@ -125,24 +125,24 @@ | |
<span style="margin-left: 15px;">QBT_TR(Size:)QBT_TR[CONTEXT=SearchEngineWidget]</span> | |
<input type="number" min="0" max="1000" step=".01" value="0.00" id="searchMinSizeFilter" onchange="qBittorrent.Search.searchSizeFilterChanged()"> | |
<select id="searchMinSizePrefix" onchange="qBittorrent.Search.searchSizeFilterPrefixChanged()"> | |
- <option value="0">QBT_TR(B)QBT_TR[CONTEXT=misc]</option> | |
- <option value="1">QBT_TR(KiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="2" selected>QBT_TR(MiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="3">QBT_TR(GiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="4">QBT_TR(TiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="5">QBT_TR(PiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="6">QBT_TR(EiB)QBT_TR[CONTEXT=misc]</option> | |
+ <option value="0">B</option> | |
+ <option value="1">KB</option> | |
+ <option value="2" selected>MB</option> | |
+ <option value="3">GB</option> | |
+ <option value="4">TB</option> | |
+ <option value="5">PB</option> | |
+ <option value="6">EB</option> | |
</select> | |
<span>QBT_TR(to)QBT_TR[CONTEXT=SearchEngineWidget]</span> | |
<input type="number" min="0" max="1000" step=".01" value="0.00" id="searchMaxSizeFilter" onchange="qBittorrent.Search.searchSizeFilterChanged()"> | |
<select id="searchMaxSizePrefix" onchange="qBittorrent.Search.searchSizeFilterPrefixChanged()"> | |
- <option value="0">QBT_TR(B)QBT_TR[CONTEXT=misc]</option> | |
- <option value="1">QBT_TR(KiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="2" selected>QBT_TR(MiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="3">QBT_TR(GiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="4">QBT_TR(TiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="5">QBT_TR(PiB)QBT_TR[CONTEXT=misc]</option> | |
- <option value="6">QBT_TR(EiB)QBT_TR[CONTEXT=misc]</option> | |
+ <option value="0">B</option> | |
+ <option value="1">KB</option> | |
+ <option value="2" selected>MB</option> | |
+ <option value="3">GB</option> | |
+ <option value="4">TB</option> | |
+ <option value="5">PB</option> | |
+ <option value="6">EB</option> | |
</select> | |
</div> | |
</div> | |
@@ -229,7 +229,7 @@ | |
}; | |
const searchSizeFilter = { | |
min: 0.00, | |
- minUnit: 2, // B = 0, KiB = 1, MiB = 2, GiB = 3, TiB = 4, PiB = 5, EiB = 6 | |
+ minUnit: 2, // B = 0, KB = 1, MB = 2, GB = 3, TB = 4, PB = 5, EB = 6 | |
max: 0.00, | |
maxUnit: 3 | |
}; | |
@@ -601,9 +601,9 @@ | |
$('searchMinSeedsFilter').set('value', '0'); | |
$('searchMaxSeedsFilter').set('value', '0'); | |
$('searchMinSizeFilter').set('value', '0.00'); | |
- $('searchMinSizePrefix').set('value', '2'); // MiB | |
+ $('searchMinSizePrefix').set('value', '2'); // MB | |
$('searchMaxSizeFilter').set('value', '0.00'); | |
- $('searchMaxSizePrefix').set('value', '3'); // GiB | |
+ $('searchMaxSizePrefix').set('value', '3'); // GB | |
}; | |
const searchSeedsFilterChanged = function() { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment