X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/e1d76541ba62e2eec5874ace02049be96bf3378e..817f3952e2bed820ea3b50dfdfe91ccb99dcb748:/src/dolphinview.cpp 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);