- m_modelRolesUpdater->setPaused(isTransactionActive());
- updateTimersInterval();
-}
-
-QSizeF KFileItemListView::visibleRoleSizeHint(int index, const QByteArray& role) const
-{
- const KItemListStyleOption& option = styleOption();
-
- qreal width = m_minimumRolesWidths.value(role, 0);
- const qreal height = option.margin * 2 + option.fontMetrics.height();
-
- const QHash<QByteArray, QVariant> values = model()->data(index);
- const QString text = KFileItemListWidget::roleText(role, values);
- if (!text.isEmpty()) {
- const qreal columnMargin = option.margin * 3;
- width = qMax(width, qreal(2 * columnMargin + option.fontMetrics.width(text)));
- }
-
- if (role == "name") {
- // Increase the width by the expansion-toggle and the current expansion level
- const int expansionLevel = values.value("expansionLevel", 0).toInt();
- width += option.margin + expansionLevel * itemSize().height() + KIconLoader::SizeSmall;
-
- // Increase the width by the required space for the icon
- width += option.margin * 2 + option.iconSize;
- }
-
- return QSizeF(width, height);
-}
+ // Update the visible index range (which has most likely changed after the
+ // icon size change) before unpausing m_modelRolesUpdater.
+ const int index = firstVisibleIndex();
+ const int count = lastVisibleIndex() - index + 1;
+ m_modelRolesUpdater->setVisibleIndexRange(index, count);