┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-11-26 01:05:58 +0100
committerPeter Penz <[email protected]>2011-11-26 01:16:31 +0100
commit362817d1834f2ada3ea4552a25fa39bbbb540f8c (patch)
tree706f316224397b44f95516ba857bb8d380a0bb47 /src/views/dolphinview.cpp
parentbf1a8f989e75a50c9a5c839e69573a87ab9ad934 (diff)
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).
Diffstat (limited to 'src/views/dolphinview.cpp')
-rw-r--r--src/views/dolphinview.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index c5c13e97f..379cd9f90 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -141,7 +141,6 @@ DolphinView::DolphinView(const KUrl& url, QWidget* parent) :
connect(controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF)));
connect(controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF)));
connect(controller, SIGNAL(headerContextMenuRequested(QPointF)), this, SLOT(slotHeaderContextMenuRequested(QPointF)));
- connect(controller, SIGNAL(itemExpansionToggleClicked(int)), this, SLOT(slotItemExpansionToggleClicked(int)));
connect(controller, SIGNAL(itemHovered(int)), this, SLOT(slotItemHovered(int)));
connect(controller, SIGNAL(itemUnhovered(int)), this, SLOT(slotItemUnhovered(int)));
connect(controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
@@ -788,17 +787,6 @@ void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
delete menu.data();
}
-void DolphinView::slotItemExpansionToggleClicked(int index)
-{
- // TODO: When doing a model->setExpanded(false) it should
- // be checked here whether the current index is part of the
- // closed sub-tree. If this is the case, the current index
- // should be adjusted to the parent index.
- KFileItemModel* model = fileItemModel();
- const bool expanded = model->isExpanded(index);
- model->setExpanded(index, !expanded);
-}
-
void DolphinView::slotItemHovered(int index)
{
const KFileItem item = fileItemModel()->fileItem(index);