Commit 8d13f678 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Fix deprecated KRunner methods

parent 3f83f8b1
......@@ -34,5 +34,9 @@ target_link_libraries(plasma_runner_marble
KF5::I18n
)
install(TARGETS plasma_runner_marble DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES plasma-runner-marble.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(TARGETS plasma_runner_marble DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/krunner)
if(KF5Runner_VERSION VERSION_LESS 5.72.0)
install(FILES plasma-runner-marble.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
else()
kcoreaddons_desktop_to_json(plasma_runner_marble plasma-runner-marble.desktop)
endif()
......@@ -15,6 +15,11 @@
#include "plasmarunner.h"
#if KRUNNER_VERSION >= QT_VERSION_CHECK(5, 72, 0)
using namespace Marble;
K_EXPORT_PLASMA_RUNNER_WITH_JSON(PlasmaRunner, "plasma-runner-marble.json")
#else
K_EXPORT_PLASMA_RUNNER(marble, Marble::PlasmaRunner)
#endif
#include "main.moc"
......@@ -89,7 +89,7 @@ Icon=marble
Type=Service
X-KDE-ServiceTypes=Plasma/Runner
X-KDE-Library=plasma_runner_marble
X-KDE-Library=kf5/krunner/plasma_runner_marble
X-KDE-PluginInfo-Author=Friedrich W. H. Kossebau
X-KDE-PluginInfo-Email=kossebau@kde.org
......
......@@ -37,12 +37,14 @@ namespace Marble
static const int minContainsMatchLength = 3;
PlasmaRunner::PlasmaRunner(QObject *parent, const QVariantList &args)
#if KRUNNER_VERSION >= QT_VERSION_CHECK(5, 77, 0)
PlasmaRunner::PlasmaRunner(QObject *parent, const KPluginMetaData &pluginMetaData, const QVariantList &args)
: AbstractRunner(parent, pluginMetaData, args)
#else
PlasmaRunner::PlasmaRunner(QObject *parent, const QVariantList &args)
: AbstractRunner(parent, args)
#endif
{
setIgnoredTypes(Plasma::RunnerContext::NetworkLocation |
Plasma::RunnerContext::FileSystem |
Plasma::RunnerContext::Help);
addSyntax(Plasma::RunnerSyntax(QStringLiteral(":q:"), i18n("Shows the coordinates :q: in OpenStreetMap with Marble.")));
addSyntax(Plasma::RunnerSyntax(QStringLiteral(":q:"), i18n("Shows the geo bookmark containing :q: in OpenStreetMap with Marble.")));
}
......
......@@ -19,6 +19,7 @@
// Plasma
#include <KRunner/AbstractRunner>
#include <krunner_version.h>
namespace Marble
......@@ -31,7 +32,11 @@ class PlasmaRunner : public Plasma::AbstractRunner
Q_OBJECT
public:
#if KRUNNER_VERSION >= QT_VERSION_CHECK(5, 77, 0)
PlasmaRunner(QObject *parent, const KPluginMetaData &pluginMetaData, const QVariantList &args);
#else
PlasmaRunner(QObject *parent, const QVariantList &args);
#endif
public: // Plasma::AbstractRunner API
void match(Plasma::RunnerContext &context) override;
......
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