Commit b293137e authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[Task Manager] Decode applications URL before dragging

An external application is unlikely to understand them.

Differential Revision: https://phabricator.kde.org/D7639
parent 9646aec0
......@@ -123,7 +123,7 @@ void Backend::setHighlightWindows(bool highlight)
}
}
QUrl tryDecodeApplicationsUrl(const QUrl &launcherUrl)
QUrl Backend::tryDecodeApplicationsUrl(const QUrl &launcherUrl)
{
if (launcherUrl.isValid() && launcherUrl.scheme() == QStringLiteral("applications")) {
const KService::Ptr service = KService::serviceByMenuId(launcherUrl.path());
......
......@@ -87,6 +87,8 @@ class Backend : public QObject
Q_INVOKABLE void cancelHighlightWindows();
static QUrl tryDecodeApplicationsUrl(const QUrl &launcherUrl);
public Q_SLOTS:
void presentWindows(const QVariant &winIds);
void windowsHovered(const QVariant &winIds, bool hovered);
......
......@@ -27,6 +27,8 @@
#include <QPixmap>
#include <QPointer>
#include "backend.h"
DragHelper::DragHelper(QObject* parent) : QObject(parent)
, m_dragIconSize(32)
{
......@@ -72,7 +74,7 @@ void DragHelper::startDragInternal(QQuickItem *item, const QString &mimeType,
QPointer<QQuickItem> grabber = item;
QList<QUrl> urlList;
urlList.append(url);
urlList.append(Backend::tryDecodeApplicationsUrl(url));
QMimeData *dragData = new QMimeData();
dragData->setData(mimeType, mimeData.toByteArray());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment