When dropping an Amarok file into Dolphin, mimeData->hasUrls() returns true although the number of URLs is 0. I'll have to do further investigations to fix this in a clean way, but in the meantime this patch prevents opening an error dialog box.

CCBUG: 176580

svn path=/trunk/KDE/kdebase/apps/; revision=896517
This commit is contained in:
Peter Penz 2008-12-13 17:32:12 +00:00
parent 7fbc814147
commit 44d2f43a40

View file

@ -101,7 +101,10 @@ void DragAndDropHelper::dropUrls(const KFileItem& destItem,
QDBusConnection::sessionBus().call(message);
} else {
const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
if ((urls.count() == 1) && (urls.first() == destination)) {
const int urlsCount = urls.count();
if (urlsCount == 0) {
// TODO: handle dropping of other data
} else if ((urlsCount == 1) && (urls.first() == destination)) {
emit errorMessage(i18nc("@info:status", "A folder cannot be dropped into itself"));
} else if (dropToItem) {
KonqOperations::doDrop(destItem, destination, event, widget);