From 8bdb01112167d8d83b75353064c3c94a1a1c27a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 5 May 2013 01:31:49 +0200 Subject: Fix konqueror drag and drop within the same window This resolves Bug 1451 --- libkonq/konq_iconviewwidget.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libkonq') diff --git a/libkonq/konq_iconviewwidget.cc b/libkonq/konq_iconviewwidget.cc index 18997a71b..a2d0c6188 100644 --- a/libkonq/konq_iconviewwidget.cc +++ b/libkonq/konq_iconviewwidget.cc @@ -1237,6 +1237,7 @@ void KonqIconViewWidget::contentsMouseMoveEvent( TQMouseEvent *e ) void KonqIconViewWidget::contentsDropEvent( TQDropEvent * ev ) { TQIconViewItem *i = findItem( ev->pos() ); + KURL::List uriList; if ( ev->source() != viewport() && !i && m_rootItem && !m_rootItem->isWritable() ) { @@ -1247,7 +1248,9 @@ void KonqIconViewWidget::contentsDropEvent( TQDropEvent * ev ) // Short-circuit TQIconView if Ctrl is pressed, so that it's possible // to drop a file into its own parent widget to copy it. if ( !i && (ev->action() == TQDropEvent::Copy || ev->action() == TQDropEvent::Link) - && ev->source() && ev->source() == viewport()) + && ev->source() && ev->source() == viewport() + && KURLDrag::decode(ev, uriList) && !uriList.isEmpty() + && uriList.first().upURL().url(1) == url().url(1)) { // First we need to call TQIconView though, to clear the drag shape bool bMovable = itemsMovable(); -- cgit v1.2.1