Commit 2863d164 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Add TryExec property to kget plugin

This way we don't display the kget plugin, unless we have the app installed.
parent 0bfdd89a
Pipeline #109880 passed with stage
in 4 minutes and 11 seconds
......@@ -14,6 +14,7 @@
#include <KPluginFactory>
#include <KPluginLoader>
#include <KPluginMetaData>
#include <KService>
#include <KSharedConfig>
#include <KXMLGUIFactory>
......@@ -104,6 +105,15 @@ QList<Plugin::PluginInfo> Plugin::pluginInfos(const QString &componentName)
continue;
}
const QString guessedService = info.m_absXMLFileName.replace(QLatin1String(".rc"), QLatin1String(".desktop"));
if (!guessedService.isEmpty() && QFileInfo::exists(guessedService)) {
KDesktopFile file(guessedService);
const QString tryExec = file.desktopGroup().readEntry("TryExec");
if (!tryExec.isEmpty() && QStandardPaths::findExecutable(tryExec).isEmpty()) {
continue;
}
}
plugins.append(info);
}
......
[Desktop Entry]
Encoding=UTF-8
Icon=kget
TryExec=kget
X-KDE-Library=konqueror_kget_browser_integration
X-KDE-PluginInfo-Author=KGet Maintainers
X-KDE-PluginInfo-Email=kget@kde.org
......
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