summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <peter.penz19@gmail.com>2012-01-27 20:52:29 (GMT)
committerPeter Penz <peter.penz19@gmail.com>2012-01-27 21:02:42 (GMT)
commite3fc04a1e4e9b46537f9645dc46f0a971c2457dc (patch)
tree3779eb9b7b3398276b9a6c19c08ff0974da10010
parent5d22b71437b8e978a051d8245b6140f09253639b (diff)
Fix regression: Allow dragging items on a tab
BUG: 292505 FIXED-IN: 4.8.1
-rw-r--r--dolphin/src/dolphinmainwindow.cpp7
-rw-r--r--dolphin/src/views/dolphinview.cpp17
-rw-r--r--dolphin/src/views/dolphinview.h13
3 files changed, 11 insertions, 26 deletions
diff --git a/dolphin/src/dolphinmainwindow.cpp b/dolphin/src/dolphinmainwindow.cpp
index 60fded6..3654ed6 100644
--- a/dolphin/src/dolphinmainwindow.cpp
+++ b/dolphin/src/dolphinmainwindow.cpp
@@ -41,6 +41,7 @@
#include "statusbar/dolphinstatusbar.h"
#include "views/dolphinviewactionhandler.h"
#include "views/dolphinremoteencoding.h"
+#include "views/draganddrophelper.h"
#include "views/viewproperties.h"
#ifndef Q_OS_WIN
@@ -1327,9 +1328,9 @@ 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();
- Q_UNUSED(destPath);
- //DragAndDropHelper::instance().dropUrls(KFileItem(), destPath, event, m_tabBar);
+ const DolphinView* view = viewTab.isPrimaryViewActive ? viewTab.primaryView->view()
+ : viewTab.secondaryView->view();
+ DragAndDropHelper::dropUrls(view->rootItem(), event);
}
}
diff --git a/dolphin/src/views/dolphinview.cpp b/dolphin/src/views/dolphinview.cpp
index 83d8001..539fcaa 100644
--- a/dolphin/src/views/dolphinview.cpp
+++ b/dolphin/src/views/dolphinview.cpp
@@ -863,16 +863,6 @@ void DolphinView::emitSelectionChangedSignal()
emit selectionChanged(selectedItems());
}
-void DolphinView::dropUrls(const KFileItem& destItem,
- const KUrl& destPath,
- QDropEvent* event)
-{
- Q_UNUSED(destItem);
- Q_UNUSED(destPath);
- markPastedUrlsAsSelected(event->mimeData());
- //DragAndDropHelper::instance().dropUrls(destItem, destPath, event, this);
-}
-
void DolphinView::updateSorting(DolphinView::Sorting sorting)
{
ViewProperties props(url());
@@ -969,7 +959,12 @@ bool DolphinView::hasSelection() const
KFileItem DolphinView::rootItem() const
{
- return m_dirLister->rootItem();
+ KFileItem item = m_dirLister->rootItem();
+ if (item.isNull()) {
+ // The directory has not been loaded yet
+ item = KFileItem(KFileItem::Unknown, KFileItem::Unknown, url());
+ }
+ return item;
}
void DolphinView::observeCreatedItem(const KUrl& url)
diff --git a/dolphin/src/views/dolphinview.h b/dolphin/src/views/dolphinview.h
index a6b8fe3..197a410 100644
--- a/dolphin/src/views/dolphinview.h
+++ b/dolphin/src/views/dolphinview.h
@@ -336,9 +336,7 @@ public:
bool hasSelection() const;
/**
- * Returns the root item which represents the current URL. Note that the returned
- * item can be null (KFileItem::isNull() will return true) in case that the directory
- * has not been loaded.
+ * Returns the root item which represents the current URL.
*/
KFileItem rootItem() const;
@@ -581,15 +579,6 @@ private slots:
void emitSelectionChangedSignal();
/**
- * Drops dragged URLs to the destination path \a destPath. If
- * the URLs are dropped above an item inside the destination path,
- * the item is indicated by \a destItem.
- */
- void dropUrls(const KFileItem& destItem,
- const KUrl& destPath,
- QDropEvent* event);
-
- /**
* Updates the view properties of the current URL to the
* sorting given by \a sorting.
*/