From d9f5e191a6bd32a4dc15b3a3eb34795cda7697dd Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 30 Oct 2007 19:44:55 +0000 Subject: * fixed drag & drop issue in column view (dropping on files was not possible -> handled as viewport now) * only show the hover-drop-indicator on directories (dropping on file-items is handled like dropping on the viewport) * simplified signature of drop signal (source widget not required anymore) svn path=/trunk/KDE/kdebase/apps/; revision=731129 --- src/dolphinview.cpp | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'src/dolphinview.cpp') diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index c280b40d0..004b158ed 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -103,8 +103,8 @@ DolphinView::DolphinView(QWidget* parent, connect(m_controller, SIGNAL(requestContextMenu(const QPoint&)), this, SLOT(openContextMenu(const QPoint&))); - connect(m_controller, SIGNAL(urlsDropped(const KUrl::List&, const KUrl&, const KFileItem&, QWidget*)), - this, SLOT(dropUrls(const KUrl::List&, const KUrl&, const KFileItem&, QWidget*))); + connect(m_controller, SIGNAL(urlsDropped(const KUrl::List&, const KUrl&, const KFileItem&)), + this, SLOT(dropUrls(const KUrl::List&, const KUrl&, const KFileItem&))); connect(m_controller, SIGNAL(sortingChanged(DolphinView::Sorting)), this, SLOT(updateSorting(DolphinView::Sorting))); connect(m_controller, SIGNAL(sortOrderChanged(Qt::SortOrder)), @@ -730,24 +730,14 @@ void DolphinView::openContextMenu(const QPoint& pos) void DolphinView::dropUrls(const KUrl::List& urls, const KUrl& destPath, - const KFileItem& destItem, - QWidget* source) -{ - bool dropAboveDir = false; - if (!destItem.isNull()) { - dropAboveDir = destItem.isDir(); - if (!dropAboveDir) { - // the dropping is done above a file - return; - } - } else if (source == itemView()) { - // the dropping is done into the same viewport where the dragging - // has been started - return; + const KFileItem& destItem) +{ + const KUrl& destination = !destItem.isNull() && destItem.isDir() ? + destItem.url() : destPath; + const KUrl sourceDir = KUrl(urls.first().directory()); + if (sourceDir != destination) { + dropUrls(urls, destination); } - - const KUrl& destination = dropAboveDir ? destItem.url() : destPath; - dropUrls(urls, destination); } void DolphinView::dropUrls(const KUrl::List& urls, -- cgit v1.3