Browse Source

Convert vars into refs to avoid copy construction from const refs

adaptive-webui-19844
thalieht 6 years ago
parent
commit
92a290895b
  1. 2
      src/gui/transferlistmodel.cpp
  2. 2
      src/webui/api/appcontroller.cpp
  3. 4
      src/webui/api/synccontroller.cpp

2
src/gui/transferlistmodel.cpp

@ -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);
} }

2
src/webui/api/appcontroller.cpp

@ -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));

4
src/webui/api/synccontroller.cpp

@ -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…
Cancel
Save