From: Peter Penz Date: Sat, 13 Dec 2008 17:32:12 +0000 (+0000) Subject: When dropping an Amarok file into Dolphin, mimeData->hasUrls() returns true although... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/44d2f43a4047a0dbb3396dff53de2e36df3049f7 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 --- diff --git a/src/draganddrophelper.cpp b/src/draganddrophelper.cpp index 00e4bd728..30804c2c1 100644 --- a/src/draganddrophelper.cpp +++ b/src/draganddrophelper.cpp @@ -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);