]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/treeviewsidebarpage.cpp
remove the asynchronous update of the zooming again, it decreases the "feeled" perfor...
[dolphin.git] / src / treeviewsidebarpage.cpp
index 8258fbfc8d390b3896edde13937e693324220524..6cf2ede18433bc0382e4c6dcebd24baaa890721b 100644 (file)
 
 #include "treeviewsidebarpage.h"
 
+#include "dolphindropcontroller.h"
 #include "dolphinmodel.h"
 #include "dolphinsortfilterproxymodel.h"
 #include "dolphinview.h"
 #include "dolphinsettings.h"
 #include "dolphin_folderspanelsettings.h"
 #include "dolphin_generalsettings.h"
+#include "folderexpander.h"
 #include "renamedialog.h"
 #include "sidebartreeview.h"
 #include "treeviewcontextmenu.h"
@@ -52,6 +54,7 @@ TreeViewSidebarPage::TreeViewSidebarPage(QWidget* parent) :
     m_treeView(0),
     m_leafDir()
 {
+    setLayoutDirection(Qt::LeftToRight);
 }
 
 TreeViewSidebarPage::~TreeViewSidebarPage()
@@ -157,11 +160,13 @@ void TreeViewSidebarPage::showEvent(QShowEvent* event)
         m_treeView->setModel(m_proxyModel);
         m_proxyModel->setSorting(DolphinView::SortByName);
         m_proxyModel->setSortOrder(Qt::AscendingOrder);
+        
+        new FolderExpander(m_treeView, m_proxyModel);
 
         connect(m_treeView, SIGNAL(clicked(const QModelIndex&)),
                 this, SLOT(updateActiveView(const QModelIndex&)));
-        connect(m_treeView, SIGNAL(urlsDropped(const KUrl::List&, const QModelIndex&)),
-                this, SLOT(dropUrls(const KUrl::List&, const QModelIndex&)));
+        connect(m_treeView, SIGNAL(urlsDropped(const QModelIndex&, QDropEvent*)),
+                this, SLOT(dropUrls(const QModelIndex&, QDropEvent*)));
         connect(m_treeView, SIGNAL(pressed(const QModelIndex&)),
                 this, SLOT(updateMouseButtons()));
 
@@ -199,15 +204,14 @@ void TreeViewSidebarPage::updateActiveView(const QModelIndex& index)
     }
 }
 
-void TreeViewSidebarPage::dropUrls(const KUrl::List& urls,
-                                   const QModelIndex& index)
+void TreeViewSidebarPage::dropUrls(const QModelIndex& index, QDropEvent* event)
 {
     if (index.isValid()) {
         const QModelIndex dirIndex = m_proxyModel->mapToSource(index);
         KFileItem item = m_dolphinModel->itemForIndex(dirIndex);
         Q_ASSERT(!item.isNull());
         if (item.isDir()) {
-            emit urlsDropped(urls, item.url());
+            DolphinDropController::dropUrls(item, item.url(), event, this);
         }
     }
 }