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
This commit is contained in:
Marco Martin 2009-12-12 16:07:25 +00:00
parent 177956d55e
commit 77928c0141

View File

@ -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&)));