Add const to many vars and arguments

Also remove const in declarations' arguments that are passed by value
This commit is contained in:
thalieht 2019-02-09 17:40:14 +02:00
parent fc534e88a3
commit ca3ce87e06
21 changed files with 217 additions and 219 deletions

View file

@ -85,8 +85,8 @@ void FileLogger::changePath(const QString &newPath)
void FileLogger::deleteOld(const int age, const FileLogAgeType ageType)
{
QDateTime date = QDateTime::currentDateTime();
QDir dir(Utils::Fs::branchPath(m_path));
const QDateTime date = QDateTime::currentDateTime();
const QDir dir(Utils::Fs::branchPath(m_path));
for (const QFileInfo &file : asConst(dir.entryInfoList(QStringList("qbittorrent.log.bak*"), QDir::Files | QDir::Writable, QDir::Time | QDir::Reversed))) {
QDateTime modificationDate = file.lastModified();
@ -111,7 +111,7 @@ void FileLogger::setBackup(bool value)
m_backup = value;
}
void FileLogger::setMaxSize(int value)
void FileLogger::setMaxSize(const int value)
{
m_maxSize = value;
}