From 362817d1834f2ada3ea4552a25fa39bbbb540f8c Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 26 Nov 2011 01:05:58 +0100 Subject: Folders Panel fixes The following functionality from Dolphin 1.x has been ported to the new view-engine: - Allow expanding/collapsing of items - Automatically select the current item - Context menu for items Related improvements to the view-engine: - Make the expanding/collapsing interface already accessible in the base classes KItemModelBase and KItemListView. If no expanding/collapsing is supported at all by derived models (which is usually the default case) simply not reimplementing those 3 methods is sufficient and it does not introduce an additional complexity like in QAbstractItemModel/QModelIndex. - Automatically handle the expanding/collapsing in KItemListController. This also includes the key-handling, which is quite special for expandable items. - Don't let KItemListView automatically scroll to the current item if the current item got changed. The automatic scrolling should only be done if the current item has been changed by the user. Hence this functionality has been moved to the KItemListController which currently only triggers the automatic scrolling if the current item has been changed by the keyboard (we might extend the usecases later if required). --- src/kitemviews/kitemmodelbase.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/kitemviews/kitemmodelbase.cpp') diff --git a/src/kitemviews/kitemmodelbase.cpp b/src/kitemviews/kitemmodelbase.cpp index 3e6114027..e2b86d8a0 100644 --- a/src/kitemviews/kitemmodelbase.cpp +++ b/src/kitemviews/kitemmodelbase.cpp @@ -109,6 +109,25 @@ QList > KItemModelBase::groups() const return QList >(); } +bool KItemModelBase::setExpanded(int index, bool expanded) +{ + Q_UNUSED(index); + Q_UNUSED(expanded); + return false; +} + +bool KItemModelBase::isExpanded(int index) const +{ + Q_UNUSED(index); + return false; +} + +bool KItemModelBase::isExpandable(int index) const +{ + Q_UNUSED(index); + return false; +} + QMimeData* KItemModelBase::createMimeData(const QSet& indexes) const { Q_UNUSED(indexes); -- cgit v1.3