+ delete m_categoryDrawer;
+ m_categoryDrawer = 0;
+}
+
+void DolphinIconsView::scrollTo(const QModelIndex& index, ScrollHint hint)
+{
+ // Enable the QListView implementation of scrollTo() only if it has been
+ // triggered by a key press. Otherwise QAbstractItemView wants to scroll to the current
+ // index each time the layout has been changed. This becomes an issue when
+ // previews are loaded and the scrollbar is used: the scrollbar will always
+ // be reset to 0 on each new preview.
+ if (m_enableScrollTo || (state() != QAbstractItemView::NoState)) {
+ KCategorizedView::scrollTo(index, hint);
+ m_enableScrollTo = false;
+ }
+}
+
+void DolphinIconsView::dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
+{
+ KCategorizedView::dataChanged(topLeft, bottomRight);
+
+ KCategorizedSortFilterProxyModel* proxyModel = dynamic_cast<KCategorizedSortFilterProxyModel*>(model());
+ if (!proxyModel->isCategorizedModel()) {
+ // bypass a QListView issue that items are not layout correctly if the decoration size of
+ // an index changes
+ scheduleDelayedItemsLayout();
+ }