void KFileItemListView::setItemLayout(Layout layout)
{
if (m_itemLayout != layout) {
+ const bool updateRoles = (m_itemLayout == DetailsLayout || layout == DetailsLayout);
m_itemLayout = layout;
+ if (updateRoles) {
+ // The details-layout requires some invisible roles that
+ // must be added to the model if the new layout is "details".
+ // If the old layout was "details" the roles will get removed.
+ applyRolesToModel();
+ }
updateLayoutOfVisibleItems();
+
+ setSupportsItemExpanding(m_itemLayout == DetailsLayout);
}
}
return sizes;
}
-bool KFileItemListView::supportsItemExpanding() const
-{
- return m_itemLayout == DetailsLayout;
-}
-
QPixmap KFileItemListView::createDragPixmap(const QSet<int>& indexes) const
{
if (!model()) {