Commit 2ce3374f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[KateFileTreeModel] Don't iterate over keys()

Creates a temporary list just to iterate it. Use iterators instead.

Differential Revision: https://phabricator.kde.org/D7735
parent daa067a6
......@@ -899,13 +899,15 @@ void KateFileTreeModel::updateBackgrounds(bool force)
m_brushes[it.key()] = QBrush(KColorUtils::mix(QPalette().color(QPalette::Base), shade, t));
}
foreach(ProxyItem * item, m_brushes.keys()) {
for (auto it = m_brushes.constBegin(), end = m_brushes.constEnd(); it != end; ++it) {
ProxyItem *item = it.key();
oldBrushes.remove(item);
const QModelIndex idx = createIndex(item->row(), 0, item);
dataChanged(idx, idx);
}
foreach(ProxyItem * item, oldBrushes.keys()) {
for (auto it = oldBrushes.constBegin(), end = oldBrushes.constEnd(); it != end; ++it) {
ProxyItem *item = it.key();
const QModelIndex idx = createIndex(item->row(), 0, item);
dataChanged(idx, idx);
}
......
Markdown is supported
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