Making "net_speed_boost" also accept values from 0 to 3
This commit is contained in:
parent
3d614801b8
commit
33eedc6f52
2 changed files with 21 additions and 25 deletions
|
|
@ -185,37 +185,19 @@ bool Manager::readCustomFile() {
|
|||
|
||||
const auto option = (*settingsNetSpeedIt).toString();
|
||||
if (option == "high") {
|
||||
cSetNetRequestsCount(8);
|
||||
cSetNetDownloadSessionsCount(8);
|
||||
cSetNetUploadSessionsCount(8);
|
||||
cSetNetMaxFileQueries(64);
|
||||
cSetNetUploadRequestInterval(200);
|
||||
SetNetworkBoost(3);
|
||||
} else if (option == "medium") {
|
||||
cSetNetRequestsCount(6);
|
||||
cSetNetDownloadSessionsCount(6);
|
||||
cSetNetUploadSessionsCount(6);
|
||||
cSetNetMaxFileQueries(48);
|
||||
cSetNetUploadRequestInterval(300);
|
||||
SetNetworkBoost(2);
|
||||
} else if (option == "low") {
|
||||
cSetNetRequestsCount(4);
|
||||
cSetNetDownloadSessionsCount(4);
|
||||
cSetNetUploadSessionsCount(4);
|
||||
cSetNetMaxFileQueries(32);
|
||||
cSetNetUploadRequestInterval(400);
|
||||
SetNetworkBoost(1);
|
||||
} else {
|
||||
cSetNetRequestsCount(2);
|
||||
cSetNetDownloadSessionsCount(2);
|
||||
cSetNetUploadSessionsCount(2);
|
||||
cSetNetMaxFileQueries(16);
|
||||
cSetNetUploadRequestInterval(500);
|
||||
SetNetworkBoost(0);
|
||||
}
|
||||
|
||||
} else if ((*settingsNetSpeedIt).isNull()) {
|
||||
cSetNetRequestsCount(2);
|
||||
cSetNetDownloadSessionsCount(2);
|
||||
cSetNetUploadSessionsCount(2);
|
||||
cSetNetMaxFileQueries(16);
|
||||
cSetNetUploadRequestInterval(500);
|
||||
SetNetworkBoost(0);
|
||||
} else if ((*settingsNetSpeedIt).isDouble()) {
|
||||
SetNetworkBoost((*settingsNetSpeedIt).toInt());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -195,6 +195,20 @@ DeclareSetting(int, NetUploadSessionsCount);
|
|||
DeclareSetting(int, NetMaxFileQueries);
|
||||
DeclareSetting(int, NetUploadRequestInterval);
|
||||
|
||||
inline void SetNetworkBoost(int boost) {
|
||||
if (boost < 0) {
|
||||
boost = 0;
|
||||
} else if (boost > 3) {
|
||||
boost = 3;
|
||||
}
|
||||
|
||||
cSetNetRequestsCount(2 + (2 * boost));
|
||||
cSetNetDownloadSessionsCount(2 + (2 * boost));
|
||||
cSetNetUploadSessionsCount(2 + (2 * boost));
|
||||
cSetNetMaxFileQueries(16 + (16 * boost));
|
||||
cSetNetUploadRequestInterval(500 - (100 * boost));
|
||||
}
|
||||
|
||||
DeclareSetting(bool, ShowPhoneInDrawer);
|
||||
|
||||
using ScaleVector = std::std::vector<int>;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue