Index: kfile/kdiroperator.cpp
===================================================================
--- kfile/kdiroperator.cpp	(revision 829584)
+++ kfile/kdiroperator.cpp	(working copy)
@@ -180,10 +180,14 @@
     void triggerSorting();
 
     static bool isReadable(const KUrl &url);
+    
+    KFile::FileView allViews();
 
     // private slots
     void _k_slotDetailedView();
     void _k_slotSimpleView();
+    void _k_slotTreeView();
+    void _k_slotDetailedTreeView();
     void _k_slotToggleHidden(bool);
     void _k_togglePreview(bool);
     void _k_slotSortByName();
@@ -533,18 +537,34 @@
     return d->actionCollection;
 }
 
+KFile::FileView KDirOperator::Private::allViews() {
+    return static_cast<KFile::FileView>(KFile::Simple | KFile::Detail | KFile::Tree | KFile::DetailTree);
+}
+
 void KDirOperator::Private::_k_slotDetailedView()
 {
-    KFile::FileView view = static_cast<KFile::FileView>((viewKind & ~KFile::Simple) | KFile::Detail);
+    KFile::FileView view = static_cast<KFile::FileView>((viewKind & ~allViews()) | KFile::Detail);
     parent->setView(view);
 }
 
 void KDirOperator::Private::_k_slotSimpleView()
 {
-    KFile::FileView view = static_cast<KFile::FileView>((viewKind & ~KFile::Detail) | KFile::Simple);
+    KFile::FileView view = static_cast<KFile::FileView>((viewKind & ~allViews()) | KFile::Simple);
     parent->setView(view);
 }
 
+void KDirOperator::Private::_k_slotTreeView()
+{
+    KFile::FileView view = static_cast<KFile::FileView>((viewKind & ~allViews()) | KFile::Tree);
+    parent->setView(view);
+}
+
+void KDirOperator::Private::_k_slotDetailedTreeView()
+{
+    KFile::FileView view = static_cast<KFile::FileView>((viewKind & ~allViews()) | KFile::DetailTree);
+    parent->setView(view);
+}
+
 void KDirOperator::Private::_k_slotToggleHidden(bool show)
 {
     dirLister->setShowingDotFiles(show);
@@ -1262,8 +1282,9 @@
 QAbstractItemView* KDirOperator::createView(QWidget* parent, KFile::FileView viewKind)
 {
     QAbstractItemView *itemView = 0;
-    if (KFile::isDetailView(viewKind)) {
+    if (KFile::isDetailView(viewKind) || KFile::isTreeView(viewKind) || KFile::isDetailTreeView(viewKind)) {
         KDirOperatorDetailView *detailView = new KDirOperatorDetailView(parent);
+        detailView->setViewMode(viewKind);
         connect(detailView->header(), SIGNAL(sortIndicatorChanged (int, Qt::SortOrder)),
                 this, SLOT(_k_synchronizeSortingState(int, Qt::SortOrder)));
         itemView = detailView;
@@ -1631,10 +1652,22 @@
     d->actionCollection->addAction("detailed view", detailedAction);
     detailedAction->setIcon(KIcon(QLatin1String("view-list-details")));
     connect(detailedAction, SIGNAL(triggered ()), SLOT(_k_slotDetailedView()));
+    
+    KToggleAction *treeAction = new KToggleAction(i18n("Tree View"), this);
+    d->actionCollection->addAction("tree view", treeAction);
+    treeAction->setIcon(KIcon(QLatin1String("view-list-tree")));
+    connect(treeAction, SIGNAL(triggered ()), SLOT(_k_slotTreeView()));
+    
+    KToggleAction *detailedTreeAction = new KToggleAction(i18n("Detailed Tree View"), this);
+    d->actionCollection->addAction("detailed tree view", detailedTreeAction);
+    detailedTreeAction->setIcon(KIcon(QLatin1String("view-list-tree")));
+    connect(detailedTreeAction, SIGNAL(triggered ()), SLOT(_k_slotDetailedTreeView()));
 
     QActionGroup* viewGroup = new QActionGroup(this);
     shortAction->setActionGroup(viewGroup);
     detailedAction->setActionGroup(viewGroup);
+    treeAction->setActionGroup(viewGroup);
+    detailedTreeAction->setActionGroup(viewGroup);
 
     KToggleAction *showHiddenAction = new KToggleAction(i18n("Show Hidden Files"), this);
     d->actionCollection->addAction("show hidden", showHiddenAction);
@@ -1657,6 +1690,9 @@
     d->actionCollection->addAction("view menu", viewMenu);
     viewMenu->addAction(shortAction);
     viewMenu->addAction(detailedAction);
+    // Comment following lines to hide the extra two modes
+    viewMenu->addAction(treeAction);
+    viewMenu->addAction(detailedTreeAction);
     // TODO: QAbstractItemView does not offer an action collection. Provide
     // an interface to add a custom action collection.
 
@@ -1748,6 +1784,8 @@
 
     d->actionCollection->action("short view")->setChecked(KFile::isSimpleView(fv));
     d->actionCollection->action("detailed view")->setChecked(KFile::isDetailView(fv));
+    d->actionCollection->action("tree view")->setChecked(KFile::isTreeView(fv));
+    d->actionCollection->action("detailed tree view")->setChecked(KFile::isDetailTreeView(fv));
 }
 
 void KDirOperator::readConfig(const KConfigGroup& configGroup)
Index: kfile/kdiroperatordetailview_p.h
===================================================================
--- kfile/kdiroperatordetailview_p.h	(revision 829584)
+++ kfile/kdiroperatordetailview_p.h	(working copy)
@@ -21,6 +21,8 @@
 
 #include <QtGui/QTreeView>
 
+#include <kfile.h>
+
 class QAbstractItemModel;
 
 /**
@@ -36,6 +38,11 @@
     virtual ~KDirOperatorDetailView();
     virtual void setModel(QAbstractItemModel *model);
 
+    /**
+    * Displays either Detail, Tree or DetailTree modes.
+    */
+    virtual bool setViewMode(KFile::FileView viewMode);
+
 protected:
     virtual bool event(QEvent *event);
     virtual void dragEnterEvent(QDragEnterEvent *event);
@@ -49,6 +56,7 @@
 
 private:
     bool m_resizeColumns;
+    bool m_hideDetailColumns;
 };
 
 #endif
Index: kfile/kdiroperator.h
===================================================================
--- kfile/kdiroperator.h	(revision 829584)
+++ kfile/kdiroperator.h	(working copy)
@@ -763,6 +763,8 @@
 
     Q_PRIVATE_SLOT( d, void _k_slotDetailedView() )
     Q_PRIVATE_SLOT( d, void _k_slotSimpleView() )
+    Q_PRIVATE_SLOT( d, void _k_slotTreeView() )
+    Q_PRIVATE_SLOT( d, void _k_slotDetailedTreeView() )
     Q_PRIVATE_SLOT( d, void _k_slotToggleHidden(bool) )
     Q_PRIVATE_SLOT( d, void _k_togglePreview(bool) )
     Q_PRIVATE_SLOT( d, void _k_slotSortByName() )
Index: kfile/kdiroperatordetailview.cpp
===================================================================
--- kfile/kdiroperatordetailview.cpp	(revision 829584)
+++ kfile/kdiroperatordetailview.cpp	(working copy)
@@ -20,6 +20,7 @@
 
 #include <kdirlister.h>
 #include <kdirmodel.h>
+#include <kdebug.h>
 
 #include <QtCore/QEvent>
 #include <QtCore/QTimer>
@@ -32,7 +33,7 @@
 
 KDirOperatorDetailView::KDirOperatorDetailView(QWidget *parent) :
     QTreeView(parent),
-    m_resizeColumns(true)
+    m_resizeColumns(true), m_hideDetailColumns(false)
 {
     setRootIsDecorated(false);
     setSortingEnabled(true);
@@ -64,6 +65,31 @@
     QTreeView::setModel(model);
 }
 
+bool KDirOperatorDetailView::setViewMode(KFile::FileView viewMode)
+{
+    bool tree = false;
+    
+    if (KFile::isDetailView(viewMode)) {
+        m_hideDetailColumns = false;
+        kDebug() << "detail view (DO)";
+    } else if (KFile::isTreeView(viewMode)) {
+        m_hideDetailColumns = true;
+        tree = true;
+        kDebug() << "tree view (DO)";
+    } else if (KFile::isDetailTreeView(viewMode)) {
+        m_hideDetailColumns = false;
+        tree = true;
+        kDebug() << "detail tree view (DO)";
+    } else {
+        return false;
+    }
+    
+    setRootIsDecorated(tree);
+    setItemsExpandable(tree);
+    
+    return true;
+}
+
 bool KDirOperatorDetailView::event(QEvent *event)
 {
     if (event->type() == QEvent::Polish) {
@@ -72,6 +98,10 @@
         headerView->setStretchLastSection(false);
         headerView->setMovable(false);
 
+        setColumnHidden(KDirModel::Size, m_hideDetailColumns);
+        setColumnHidden(KDirModel::ModifiedTime, m_hideDetailColumns);
+        setColumnHidden(KDirModel::Type, m_hideDetailColumns);
+
         hideColumn(KDirModel::Permissions);
         hideColumn(KDirModel::Owner);
         hideColumn(KDirModel::Group);
@@ -145,3 +175,5 @@
 {
     m_resizeColumns = false;
 }
+
+// kate: space-indent on; indent-width 4; replace-tabs on;
Index: kio/kfile/kfile.h
===================================================================
--- kio/kfile/kfile.h	(revision 829584)
+++ kio/kfile/kfile.h	(working copy)
@@ -58,6 +58,8 @@
         SeparateDirs    = 4,
         PreviewContents = 8,
         PreviewInfo     = 16,
+        Tree            = 32,
+        DetailTree      = 64,
         FileViewMax     = 65536
     };
 
@@ -100,6 +102,10 @@
     static bool isPreviewContents( const FileView& view ); 
 
     static bool isPreviewInfo( const FileView& view );
+    
+    static bool isTreeView( const FileView& view );
+    
+    static bool isDetailTreeView( const FileView& view );
 
 private:
     KFile(); // forbidden
Index: kio/kfile/kfile.cpp
===================================================================
--- kio/kfile/kfile.cpp	(revision 829584)
+++ kio/kfile/kfile.cpp	(working copy)
@@ -80,4 +80,14 @@
     return (view & PreviewInfo) == PreviewInfo;
 }
 
+bool KFile::isTreeView( const FileView& view )
+{
+    return (view & Tree) == Tree;
+}
+
+bool KFile::isDetailTreeView( const FileView& view )
+{
+    return (view & DetailTree) == DetailTree;
+}
+
 #include "kfile.moc"
