┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphinmainwindow.cpp12
-rw-r--r--src/dolphinmainwindow.h6
2 files changed, 18 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index e68fab997..d358ad733 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -1139,6 +1139,16 @@ void DolphinMainWindow::handleUrl(const KUrl& url)
}
}
+void DolphinMainWindow::tabDropEvent(int tab, QDropEvent* event)
+{
+ const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
+ if (!urls.isEmpty() && tab != -1) {
+ const ViewTab& viewTab = m_viewTab[tab];
+ const KUrl destPath = viewTab.isPrimaryViewActive ? viewTab.primaryView->url() : viewTab.secondaryView->url();
+ DragAndDropHelper::instance().dropUrls(KFileItem(), destPath, event, m_tabBar);
+ }
+}
+
void DolphinMainWindow::slotCaptionStatFinished(KJob* job)
{
m_captionStatJob = 0;
@@ -1227,6 +1237,8 @@ void DolphinMainWindow::init()
this, SLOT(closeTab(int)));
connect(m_tabBar, SIGNAL(tabMoved(int, int)),
this, SLOT(slotTabMoved(int, int)));
+ connect(m_tabBar, SIGNAL(receivedDropEvent(int, QDropEvent*)),
+ this, SLOT(tabDropEvent(int, QDropEvent*)));
m_tabBar->blockSignals(true); // signals get unblocked after at least 2 tabs are open
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index ca8daa948..6c2089fcf 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -430,6 +430,12 @@ private slots:
void slotCaptionStatFinished(KJob* job);
/**
+ * Is connected to the KTabBar signal receivedDropEvent.
+ * Allows dragging and dropping files onto tabs.
+ */
+ void tabDropEvent(int tab, QDropEvent* event);
+
+ /**
* Is invoked when the write state of a folder has been changed and
* enables/disables the "Create New..." menu entry.
*/