From 77928c01418955ac1bef2527cbcd0acee0f4bdb5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 12 Dec 2009 16:07:25 +0000 Subject: [PATCH] create a mimetype job instead of a generic transfer job, that is confised to death if the url is a directory instead of a file BUG:218097 svn path=/trunk/KDE/kdelibs/; revision=1061657 --- containment.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/containment.cpp b/containment.cpp index eeae1e7c6..8e0bed7d8 100644 --- a/containment.cpp +++ b/containment.cpp @@ -1310,11 +1310,13 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS // It may be a directory or a file, let's stat KIO::JobFlags flags = KIO::HideProgressInfo; - KIO::TransferJob *job = KIO::get(url, KIO::NoReload, flags); - if (dropEvent) + KIO::MimetypeJob *job = KIO::mimetype(url, flags); + if (dropEvent) { dropPoints[job] = dropEvent->pos(); - else + } else { dropPoints[job] = scenePos; + } + QObject::connect(job, SIGNAL(result(KJob*)), q, SLOT(dropJobResult(KJob*))); QObject::connect(job, SIGNAL(mimetype(KIO::Job *, const QString&)), q, SLOT(mimeTypeRetrieved(KIO::Job *, const QString&)));