Commit 9a0ab367 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

systemsettingsrunner: Fix drag and drop for KCMs using embedded json metadata

parent bd5304db
Pipeline #191565 passed with stage
in 1 minute and 28 seconds
......@@ -87,10 +87,17 @@ void SystemsettingsRunner::run(const Plasma::RunnerContext &context, const Plasm
QMimeData *SystemsettingsRunner::mimeDataForMatch(const Plasma::QueryMatch &match)
{
const auto value = match.data().value<KPluginMetaData>();
if (value.isValid() && value.metaDataFileName().endsWith(QLatin1String(".desktop"))) {
auto *data = new QMimeData();
data->setUrls(QList<QUrl>{QUrl::fromLocalFile(value.metaDataFileName())});
return data;
if (value.isValid()) {
if (value.metaDataFileName().endsWith(QLatin1String(".desktop"))) {
auto *data = new QMimeData();
data->setUrls(QList<QUrl>{QUrl::fromLocalFile(value.metaDataFileName())});
return data;
}
if (KService::Ptr ptr = KService::serviceByStorageId(value.pluginId() + QLatin1String(".desktop"))) {
auto *data = new QMimeData();
data->setUrls(QList<QUrl>{QUrl::fromLocalFile(ptr->entryPath())});
return data;
}
}
return nullptr;
}
......
Supports Markdown
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