mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-05 22:57:25 +03:00
Convert vars into refs to avoid copy construction from const refs
This commit is contained in:
parent
400792d18e
commit
92a290895b
3 changed files with 4 additions and 4 deletions
|
@ -468,6 +468,6 @@ bool isDarkTheme()
|
||||||
{
|
{
|
||||||
const QPalette pal = QApplication::palette();
|
const QPalette pal = QApplication::palette();
|
||||||
// QPalette::Base is used for the background of the Treeview
|
// QPalette::Base is used for the background of the Treeview
|
||||||
const QColor color = pal.color(QPalette::Active, QPalette::Base);
|
const QColor &color = pal.color(QPalette::Active, QPalette::Base);
|
||||||
return (color.lightness() < 127);
|
return (color.lightness() < 127);
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,7 +329,7 @@ void AppController::setPreferencesAction()
|
||||||
|
|
||||||
// Update deleted folders
|
// Update deleted folders
|
||||||
for (auto i = oldScanDirs.cbegin(); i != oldScanDirs.cend(); ++i) {
|
for (auto i = oldScanDirs.cbegin(); i != oldScanDirs.cend(); ++i) {
|
||||||
const QString folder = i.key();
|
const QString &folder = i.key();
|
||||||
if (!scanDirs.contains(folder)) {
|
if (!scanDirs.contains(folder)) {
|
||||||
model->removePath(folder);
|
model->removePath(folder);
|
||||||
qDebug("Removed watched folder %s", qUtf8Printable(folder));
|
qDebug("Removed watched folder %s", qUtf8Printable(folder));
|
||||||
|
|
|
@ -434,9 +434,9 @@ void SyncController::maindataAction()
|
||||||
data["torrents"] = torrents;
|
data["torrents"] = torrents;
|
||||||
|
|
||||||
QVariantHash categories;
|
QVariantHash categories;
|
||||||
const auto categoriesList = session->categories();
|
const auto &categoriesList = session->categories();
|
||||||
for (auto it = categoriesList.cbegin(); it != categoriesList.cend(); ++it) {
|
for (auto it = categoriesList.cbegin(); it != categoriesList.cend(); ++it) {
|
||||||
const auto key = it.key();
|
const auto &key = it.key();
|
||||||
categories[key] = QVariantMap {
|
categories[key] = QVariantMap {
|
||||||
{"name", key},
|
{"name", key},
|
||||||
{"savePath", it.value()}
|
{"savePath", it.value()}
|
||||||
|
|
Loading…
Reference in a new issue