From 475f8b1261a6ea106ca9dd90b625ea95fe63a4c7 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 9 Mar 2012 16:12:00 +0100 Subject: Details view: Allow to turn off expandable folders like in Dolphin 1.7 The option for turning off expandable folders has been removed with the new view-engine. Due to several requests this option has been readded again. As for 4.8.x no new user-interface strings may be introduced, the line ExpandableFolders=false must be manually added below the section "[DetailsMode]" in the file ~/.kde/share/config/dolphinrc if the expandable-folders feature should be disabled. Thanks to H.H. "cyberbeat" for the initial patch! BUG: 289090 FIXED-IN: 4.8.2 --- src/kitemviews/kfileitemlistview.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/kitemviews/kfileitemlistview.cpp') diff --git a/src/kitemviews/kfileitemlistview.cpp b/src/kitemviews/kfileitemlistview.cpp index 27ef7fdb5..796a45099 100644 --- a/src/kitemviews/kfileitemlistview.cpp +++ b/src/kitemviews/kfileitemlistview.cpp @@ -106,8 +106,6 @@ void KFileItemListView::setItemLayout(Layout layout) applyRolesToModel(); } updateLayoutOfVisibleItems(); - - setSupportsItemExpanding(m_itemLayout == DetailsLayout); } } @@ -324,6 +322,8 @@ void KFileItemListView::initializeItemListWidget(KItemListWidget* item) case DetailsLayout: fileItemListWidget->setLayout(KFileItemListWidget::DetailsLayout); break; default: Q_ASSERT(false); break; } + + fileItemListWidget->setSupportsItemExpanding(supportsItemExpanding()); } bool KFileItemListView::itemSizeHintUpdateRequired(const QSet& changedRoles) const @@ -388,6 +388,13 @@ void KFileItemListView::onStyleOptionChanged(const KItemListStyleOption& current triggerIconSizeUpdate(); } +void KFileItemListView::onSupportsItemExpandingChanged(bool supportsExpanding) +{ + Q_UNUSED(supportsExpanding); + applyRolesToModel(); + updateLayoutOfVisibleItems(); +} + void KFileItemListView::onTransactionBegin() { m_modelRolesUpdater->setPaused(true); @@ -569,7 +576,7 @@ void KFileItemListView::applyRolesToModel() roles.insert("iconName"); roles.insert("name"); roles.insert("isDir"); - if (m_itemLayout == DetailsLayout) { + if (supportsItemExpanding()) { roles.insert("isExpanded"); roles.insert("isExpandable"); roles.insert("expandedParentsCount"); -- cgit v1.3