Commit cbdbbcd3 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Tabs Runner] Add tab URL as mime data for tabs

The Firefox tab dragging mime data is in an internal format and Chrome doesn't even
do proper drags, so let's forget about being able to re-arrange tabs this way.

Instead, just set the tab URL so you at least get some drag and drop benefit.
parent cedb3b66
......@@ -149,7 +149,8 @@ void TabsRunner::match(Plasma::RunnerContext &context)
{QStringLiteral("service"), service},
{QStringLiteral("tabId"), tabId},
{QStringLiteral("audible"), audible},
{QStringLiteral("muted"), muted}
{QStringLiteral("muted"), muted},
{QStringLiteral("url"), url}
};
Plasma::QueryMatch match(this);
......@@ -278,9 +279,12 @@ QDBusMessage TabsRunner::createMessage(const QString &service, const QString &me
QMimeData *TabsRunner::mimeDataForMatch(const Plasma::QueryMatch &match)
{
Q_UNUSED(match);
// TODO return tab url or maybe for firefox a magic "dragging tab off a window" mime?
return nullptr;
const QVariantHash tabData = match.data().toHash();
const QUrl url = tabData.value(QStringLiteral("url")).toUrl();
auto *data = new QMimeData();
data->setUrls({url});
return data;
}
QList<QAction *> TabsRunner::actionsForMatch(const Plasma::QueryMatch &match)
......
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