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

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

View File

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

View File

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

View File

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