┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-08-12 18:36:49 +0000
committerPeter Penz <[email protected]>2008-08-12 18:36:49 +0000
commitb94777f9d19b3d515088493a81885082a50be791 (patch)
tree13bcf6ba24534ace7dfebbb1c9dc4ec280529a60 /src/dolphinview.cpp
parente41715db92d8f30f69b6831e3e03657740e25254 (diff)
Provide functionality for auto-expanding folders (the whole patch has been provided by Simon St James). The setting is currently not offered in the GUI, as some minor remaining issues must be fixed.
CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=845975
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 24b331d84..610a6d1ff 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -53,9 +53,11 @@
#include "dolphincontroller.h"
#include "dolphinsortfilterproxymodel.h"
#include "dolphindetailsview.h"
+#include "dolphin_detailsmodesettings.h"
#include "dolphiniconsview.h"
#include "dolphinsettings.h"
#include "dolphin_generalsettings.h"
+#include "folderexpander.h"
#include "iconmanager.h"
#include "renamedialog.h"
#include "tooltipmanager.h"
@@ -741,7 +743,6 @@ void DolphinView::toggleAdditionalInfo(QAction* action)
}
}
-
void DolphinView::mouseReleaseEvent(QMouseEvent* event)
{
QWidget::mouseReleaseEvent(event);
@@ -1155,6 +1156,20 @@ void DolphinView::createView()
Q_ASSERT(view != 0);
view->installEventFilter(this);
+ if (m_mode != ColumnView) {
+ // Give the view the ability to auto-expand its directories on hovering
+ // (the column view takes care about this itself). If the details view
+ // uses expandable folders, the auto-expanding should be used always.
+ DolphinSettings& settings = DolphinSettings::instance();
+ const bool enabled = settings.generalSettings()->autoExpandFolders() ||
+ ((m_detailsView != 0) && settings.detailsModeSettings()->expandableFolders());
+
+ FolderExpander* folderExpander = new FolderExpander(view, m_proxyModel);
+ folderExpander->setEnabled(enabled);
+ connect(folderExpander, SIGNAL(enterDir(const QModelIndex&)),
+ m_controller, SLOT(triggerItem(const QModelIndex&)));
+ }
+
m_controller->setItemView(view);
m_fileItemDelegate = new KFileItemDelegate(view);