From 0bf22ff9b78d415a76e4ca786e9e4b8b53f759db Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sun, 17 Oct 2021 07:11:16 +0200 Subject: [PATCH] Port away from deprecated AbstarctRunner::actions method This was deprecated, because having string based key-actions values does not fit the usecases we have. Consequently we should check if the runner has any QAction children, this works if the runner created the QActions manually or if the actions are registered in the abstract runner. Also we can drop the ugly hack. --- applets/kicker/plugin/runnermatchesmodel.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/applets/kicker/plugin/runnermatchesmodel.cpp b/applets/kicker/plugin/runnermatchesmodel.cpp index 99eff9b56..8bcd91d7d 100644 --- a/applets/kicker/plugin/runnermatchesmodel.cpp +++ b/applets/kicker/plugin/runnermatchesmodel.cpp @@ -65,18 +65,7 @@ QVariant RunnerMatchesModel::data(const QModelIndex &index, int role) const } } } else if (role == Kicker::HasActionListRole) { - // Hack to expose the protected Plasma::AbstractRunner::actions() method. - class MyRunner : public Plasma::AbstractRunner - { - public: - using Plasma::AbstractRunner::actions; - }; - - MyRunner *runner = static_cast(match.runner()); - - Q_ASSERT(runner); - - return match.runner()->id() == QLatin1String("services") || !runner->actions().isEmpty(); + return match.runner()->id() == QLatin1String("services") || !match.runner()->findChildren().isEmpty(); } else if (role == Kicker::ActionListRole) { QVariantList actionList; const QList actions = m_runnerManager->actionsForMatch(match);