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);
}
}
+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();