Clean up code

Add const.
Move template implementation to .cpp file.
This commit is contained in:
Chocobo1
2022-05-14 14:39:28 +08:00
parent 538c88ced4
commit 114c6d36d1
4 changed files with 26 additions and 23 deletions

View File

@@ -156,7 +156,7 @@ AdvancedSettings::AdvancedSettings(QWidget *parent)
{
// column
setColumnCount(COL_COUNT);
QStringList header = {tr("Setting"), tr("Value", "Value set for this setting")};
const QStringList header = {tr("Setting"), tr("Value", "Value set for this setting")};
setHorizontalHeaderLabels(header);
// row
setRowCount(ROW_COUNT);
@@ -171,7 +171,7 @@ AdvancedSettings::AdvancedSettings(QWidget *parent)
horizontalHeader()->setStretchLastSection(true);
}
void AdvancedSettings::saveAdvancedSettings()
void AdvancedSettings::saveAdvancedSettings() const
{
Preferences *const pref = Preferences::instance();
BitTorrent::Session *const session = BitTorrent::Session::instance();
@@ -314,7 +314,7 @@ void AdvancedSettings::saveAdvancedSettings()
}
#ifndef QBT_USES_LIBTORRENT2
void AdvancedSettings::updateCacheSpinSuffix(int value)
void AdvancedSettings::updateCacheSpinSuffix(const int value)
{
if (value == 0)
m_spinBoxCache.setSuffix(tr(" (disabled)"));