X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b5cc2a6924cfd8f59611d3cec2edbb00a08b4ff1..cd4b064fb273fcf1f1c849eb7dea7d92ddb4b7c3:/src/treeviewsidebarpage.cpp diff --git a/src/treeviewsidebarpage.cpp b/src/treeviewsidebarpage.cpp index b1fcc8daa..63689b6eb 100644 --- a/src/treeviewsidebarpage.cpp +++ b/src/treeviewsidebarpage.cpp @@ -78,8 +78,8 @@ TreeViewSidebarPage::TreeViewSidebarPage(DolphinMainWindow* mainWindow, connect(m_treeView, SIGNAL(clicked(const QModelIndex&)), this, SLOT(updateActiveView(const QModelIndex&))); - connect(m_treeView, SIGNAL(doubleClicked(const QModelIndex&)), - this, SLOT(slotDoubleClicked(const QModelIndex&))); + connect(m_treeView, SIGNAL(urlsDropped(const KUrl::List&, const QModelIndex&)), + this, SLOT(dropUrls(const KUrl::List&, const QModelIndex&))); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(m_treeView); @@ -201,6 +201,23 @@ void TreeViewSidebarPage::updateActiveView(const QModelIndex& index) } } +void TreeViewSidebarPage::dropUrls(const KUrl::List& urls, + const QModelIndex& index) +{ + if (index.isValid()) { +#if defined(USE_PROXY_MODEL) + const QModelIndex& dirIndex = m_proxyModel->mapToSource(index); + KFileItem* item = m_dirModel->itemForIndex(dirIndex); +#else + KFileItem* item = m_dirModel->itemForIndex(index); +#endif + Q_ASSERT(item != 0); + if (item->isDir()) { + mainWindow()->dropUrls(urls, item->url()); + } + } +} + void TreeViewSidebarPage::connectToActiveView() { const QWidget* parent = parentWidget();