convert RSDHT_RELAY_CLASS_ to enum class

This commit is contained in:
sehraf 2020-02-19 20:17:21 +01:00
parent bc1ba3654d
commit 0678226a93
No known key found for this signature in database
GPG key ID: DF09F6EAE356B2C6
6 changed files with 44 additions and 39 deletions

View file

@ -446,15 +446,15 @@ void ServerPage::load()
//Relay Tab
uint32_t count;
uint32_t bandwidth;
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, count, bandwidth);
rsDht->getRelayAllowance(RsDhtRelayClass::FRIENDS, count, bandwidth);
whileBlocking(ui.noFriendSpinBox)->setValue(count);
whileBlocking(ui.bandFriendSpinBox)->setValue(bandwidth / 1024);
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_FOF, count, bandwidth);
rsDht->getRelayAllowance(RsDhtRelayClass::FOF, count, bandwidth);
whileBlocking(ui.noFOFSpinBox)->setValue(count);
whileBlocking(ui.bandFOFSpinBox)->setValue(bandwidth / 1024);
rsDht->getRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, count, bandwidth);
rsDht->getRelayAllowance(RsDhtRelayClass::GENERAL, count, bandwidth);
whileBlocking(ui.noGeneralSpinBox)->setValue(count);
whileBlocking(ui.bandGeneralSpinBox)->setValue(bandwidth / 1024);
@ -1884,10 +1884,10 @@ void ServerPage::updateTotals()
int total = nFriends + nFOF + nGeneral;
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_ALL, total, 0);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, nFriends, 1024 * friendBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FOF, nFOF, 1024 * fofBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, nGeneral, 1024 * genBandwidth);
rsDht->setRelayAllowance(RsDhtRelayClass::ALL, total, 0);
rsDht->setRelayAllowance(RsDhtRelayClass::FRIENDS, nFriends, 1024 * friendBandwidth);
rsDht->setRelayAllowance(RsDhtRelayClass::FOF, nFOF, 1024 * fofBandwidth);
rsDht->setRelayAllowance(RsDhtRelayClass::GENERAL, nGeneral, 1024 * genBandwidth);
}
/** Saves the changes on this page */