Changeset View
Changeset View
Standalone View
Standalone View
src/scriptengines/qml/plasmoid/containmentinterface.cpp
Show First 20 Lines • Show All 444 Lines • ▼ Show 20 Line(s) | 444 | { | |||
---|---|---|---|---|---|
445 | if (!mimeData) { | 445 | if (!mimeData) { | ||
446 | return; | 446 | return; | ||
447 | } | 447 | } | ||
448 | 448 | | |||
449 | //const QMimeData *mimeData = data; | 449 | //const QMimeData *mimeData = data; | ||
450 | 450 | | |||
451 | qDebug() << "Arrived mimeData" << mimeData->urls() << mimeData->formats() << "at" << x << ", " << y; | 451 | qDebug() << "Arrived mimeData" << mimeData->urls() << mimeData->formats() << "at" << x << ", " << y; | ||
452 | 452 | | |||
453 | // Catch drops from a Task Manager and convert to usable URL. | ||||
454 | if (!mimeData->hasUrls() && mimeData->hasFormat(QStringLiteral("text/x-orgkdeplasmataskmanager_taskurl"))) { | ||||
455 | QList<QUrl> urls = {QUrl(QString::fromUtf8(mimeData->data(QStringLiteral("text/x-orgkdeplasmataskmanager_taskurl"))))}; | ||||
456 | mimeData->setUrls(urls); | ||||
457 | } | ||||
458 | | ||||
453 | if (mimeData->hasFormat(QStringLiteral("text/x-plasmoidservicename"))) { | 459 | if (mimeData->hasFormat(QStringLiteral("text/x-plasmoidservicename"))) { | ||
454 | QString data = QString::fromUtf8( mimeData->data(QStringLiteral("text/x-plasmoidservicename")) ); | 460 | QString data = QString::fromUtf8( mimeData->data(QStringLiteral("text/x-plasmoidservicename")) ); | ||
455 | const QStringList appletNames = data.split(QLatin1Char('\n'), QString::SkipEmptyParts); | 461 | const QStringList appletNames = data.split(QLatin1Char('\n'), QString::SkipEmptyParts); | ||
456 | foreach (const QString &appletName, appletNames) { | 462 | foreach (const QString &appletName, appletNames) { | ||
457 | qDebug() << "adding" << appletName; | 463 | qDebug() << "adding" << appletName; | ||
458 | 464 | | |||
459 | metaObject()->invokeMethod(this, "createApplet", Qt::QueuedConnection, Q_ARG(QString, appletName), Q_ARG(QVariantList, QVariantList()), Q_ARG(QRectF, QRectF(x, y, -1, -1))); | 465 | metaObject()->invokeMethod(this, "createApplet", Qt::QueuedConnection, Q_ARG(QString, appletName), Q_ARG(QVariantList, QVariantList()), Q_ARG(QRectF, QRectF(x, y, -1, -1))); | ||
460 | } | 466 | } | ||
▲ Show 20 Lines • Show All 772 Lines • Show Last 20 Lines |