Commit 2ecb63c1 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

kcms/colors: Port 2 foreach loops to for loops

This also fixes: Critical - Uninitialized variable: button (CWE-457)
parent b96d56ae
Pipeline #193000 passed with stage
in 17 minutes and 15 seconds
......@@ -368,8 +368,7 @@ void SchemeEditorColors::updateColorTable()
stackColors->setCurrentIndex(0);
stackPreview->setCurrentIndex(0);
KColorButton *button;
foreach (button, m_commonColorButtons) {
for (KColorButton *button : std::as_const(m_commonColorButtons)) {
button->blockSignals(true);
}
......@@ -404,7 +403,7 @@ void SchemeEditorColors::updateColorTable()
m_commonColorButtons[24]->setColor(m_wmColors.color(WindecoColors::InactiveForeground));
m_commonColorButtons[25]->setColor(m_wmColors.color(WindecoColors::InactiveBlend));
foreach (button, m_commonColorButtons) {
for (KColorButton *button : std::as_const(m_commonColorButtons)) {
button->blockSignals(false);
}
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment