mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Add const to many vars and arguments
Also remove const in declarations' arguments that are passed by value
This commit is contained in:
@@ -120,9 +120,9 @@ int PropTabBar::currentIndex() const
|
||||
void PropTabBar::setCurrentIndex(int index)
|
||||
{
|
||||
if (index >= m_btnGroup->buttons().size())
|
||||
index = 0;
|
||||
index = 0;
|
||||
// If asked to hide or if the currently selected tab is clicked
|
||||
if (index < 0 || m_currentIndex == index) {
|
||||
if ((index < 0) || (m_currentIndex == index)) {
|
||||
if (m_currentIndex >= 0) {
|
||||
m_btnGroup->button(m_currentIndex)->setDown(false);
|
||||
m_currentIndex = -1;
|
||||
|
||||
@@ -149,7 +149,7 @@ QList<QTreeWidgetItem*> TrackerListWidget::getSelectedTrackerItems() const
|
||||
return selectedTrackers;
|
||||
}
|
||||
|
||||
void TrackerListWidget::setRowColor(int row, QColor color)
|
||||
void TrackerListWidget::setRowColor(const int row, QColor color)
|
||||
{
|
||||
const int nbColumns = columnCount();
|
||||
QTreeWidgetItem *item = topLevelItem(row);
|
||||
|
||||
@@ -228,7 +228,7 @@ void PluginSelectDialog::enableSelection(bool enable)
|
||||
}
|
||||
|
||||
// Set the color of a row in data model
|
||||
void PluginSelectDialog::setRowColor(int row, QString color)
|
||||
void PluginSelectDialog::setRowColor(const int row, QString color)
|
||||
{
|
||||
QTreeWidgetItem *item = m_ui->pluginsTree->topLevelItem(row);
|
||||
for (int i = 0; i < m_ui->pluginsTree->columnCount(); ++i) {
|
||||
|
||||
@@ -466,8 +466,8 @@ QIcon getErrorIcon()
|
||||
|
||||
bool isDarkTheme()
|
||||
{
|
||||
QPalette pal = QApplication::palette();
|
||||
const QPalette pal = QApplication::palette();
|
||||
// QPalette::Base is used for the background of the Treeview
|
||||
QColor color = pal.color(QPalette::Active, QPalette::Base);
|
||||
const QColor color = pal.color(QPalette::Active, QPalette::Base);
|
||||
return (color.lightness() < 127);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user