]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
Fix for show_filter_bar action of tools-menu, which is not correctly set (when the...
[dolphin.git] / src / dolphinview.cpp
index 24b331d84b9607a0940f56b79722131979aaf508..610a6d1ffe802fa6a4cf24a28c94126b75f5aac3 100644 (file)
 #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);