mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
Give better name to parameter checking function
This function will throw exceptions if the required parameters do not exsit hence a stronger word is more appropriate here. Also change the function parameter type to QVector. We don't need the duplicate entries checking as currently we only use 3 fields at max and can be easily checked by hand. So drop back to QVector which can be constructed more efficiently.
This commit is contained in:
@@ -90,7 +90,7 @@ void TransferController::downloadLimitAction()
|
||||
|
||||
void TransferController::setUploadLimitAction()
|
||||
{
|
||||
checkParams({"limit"});
|
||||
requireParams({"limit"});
|
||||
qlonglong limit = params()["limit"].toLongLong();
|
||||
if (limit == 0) limit = -1;
|
||||
|
||||
@@ -99,7 +99,7 @@ void TransferController::setUploadLimitAction()
|
||||
|
||||
void TransferController::setDownloadLimitAction()
|
||||
{
|
||||
checkParams({"limit"});
|
||||
requireParams({"limit"});
|
||||
qlonglong limit = params()["limit"].toLongLong();
|
||||
if (limit == 0) limit = -1;
|
||||
|
||||
@@ -119,7 +119,7 @@ void TransferController::speedLimitsModeAction()
|
||||
|
||||
void TransferController::banPeersAction()
|
||||
{
|
||||
checkParams({"peers"});
|
||||
requireParams({"peers"});
|
||||
|
||||
const QStringList peers = params()["peers"].split('|');
|
||||
for (const QString &peer : peers) {
|
||||
|
||||
Reference in New Issue
Block a user