Move mimeData methods from KUrl::List to a new namespace KUrlMimeData.
Deprecate mimeData methods in KUrl::List and KUrl, port all of kdelibs to KUrlMimeData.
This commit is contained in:
parent
8f6075ac7c
commit
7f31106729
@ -44,6 +44,7 @@
|
|||||||
#include <kmimetype.h>
|
#include <kmimetype.h>
|
||||||
#include <kservicetypetrader.h>
|
#include <kservicetypetrader.h>
|
||||||
#include <kstandarddirs.h>
|
#include <kstandarddirs.h>
|
||||||
|
#include <kurlmimedata.h>
|
||||||
#include <kwindowsystem.h>
|
#include <kwindowsystem.h>
|
||||||
|
|
||||||
#ifndef PLASMA_NO_KIO
|
#ifndef PLASMA_NO_KIO
|
||||||
@ -1152,7 +1153,7 @@ void Containment::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
|
|||||||
//kDebug() << immutability() << Mutable << (immutability() == Mutable);
|
//kDebug() << immutability() << Mutable << (immutability() == Mutable);
|
||||||
event->setAccepted(immutability() == Mutable &&
|
event->setAccepted(immutability() == Mutable &&
|
||||||
(event->mimeData()->hasFormat(static_cast<Corona*>(scene())->appletMimeType()) ||
|
(event->mimeData()->hasFormat(static_cast<Corona*>(scene())->appletMimeType()) ||
|
||||||
KUrl::List::canDecode(event->mimeData())));
|
event->mimeData()->hasUrls()));
|
||||||
|
|
||||||
if (!event->isAccepted()) {
|
if (!event->isAccepted()) {
|
||||||
// check to see if we have an applet that accepts the format.
|
// check to see if we have an applet that accepts the format.
|
||||||
@ -1278,11 +1279,11 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS
|
|||||||
if (dropEvent) {
|
if (dropEvent) {
|
||||||
dropEvent->acceptProposedAction();
|
dropEvent->acceptProposedAction();
|
||||||
}
|
}
|
||||||
} else if (KUrl::List::canDecode(mimeData)) {
|
} else if (mimeData->hasUrls()) {
|
||||||
//TODO: collect the mimeTypes of available script engines and offer
|
//TODO: collect the mimeTypes of available script engines and offer
|
||||||
// to create widgets out of the matching URLs, if any
|
// to create widgets out of the matching URLs, if any
|
||||||
const KUrl::List urls = KUrl::List::fromMimeData(mimeData);
|
const QList<QUrl> urls = KUrlMimeData::urlsFromMimeData(mimeData);
|
||||||
foreach (const KUrl &url, urls) {
|
foreach (const QUrl &url, urls) {
|
||||||
if (AccessManager::supportedProtocols().contains(url.scheme())) {
|
if (AccessManager::supportedProtocols().contains(url.scheme())) {
|
||||||
AccessAppletJob *job = AccessManager::self()->accessRemoteApplet(url);
|
AccessAppletJob *job = AccessManager::self()->accessRemoteApplet(url);
|
||||||
if (dropEvent) {
|
if (dropEvent) {
|
||||||
@ -1299,7 +1300,7 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS
|
|||||||
QString mimeName = mime->name();
|
QString mimeName = mime->name();
|
||||||
QRectF geom(pos, QSize());
|
QRectF geom(pos, QSize());
|
||||||
QVariantList args;
|
QVariantList args;
|
||||||
args << url.url();
|
args << url.toString();
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
kDebug() << "can decode" << mimeName << args;
|
kDebug() << "can decode" << mimeName << args;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user