Commit eda917eb authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Simplify runners using new method

parent fe86cf62
......@@ -127,19 +127,13 @@ void ConverterRunner::match(Plasma::RunnerContext &context)
}
match.setData(outputValue.number());
match.setRelevance(1.0 - std::abs(std::log10(outputValue.number())) / 50.0);
match.setActions(actionList);
matches.append(match);
}
context.addMatches(matches);
}
QList<QAction *> ConverterRunner::actionsForMatch(const Plasma::QueryMatch &match)
{
Q_UNUSED(match)
return actionList;
}
void ConverterRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match)
{
Q_UNUSED(context)
......
......@@ -41,7 +41,6 @@ public:
~ConverterRunner() override;
void match(Plasma::RunnerContext &context) override;
QList<QAction *> actionsForMatch(const Plasma::QueryMatch &match) override;
void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override;
private:
......
......@@ -245,6 +245,7 @@ void SpellCheckRunner::match(Plasma::RunnerContext &context)
match.setType(Plasma::QueryMatch::InformationalMatch);
match.setIconName(QStringLiteral("data-error"));
match.setText(i18n("No dictionary found, please install hspell"));
match.setActions(m_actions);
context.addMatch(match);
}
}
......@@ -256,13 +257,6 @@ void SpellCheckRunner::run(const Plasma::RunnerContext &context, const Plasma::Q
QGuiApplication::clipboard()->setText(match.data().toString());
}
QList<QAction *> SpellCheckRunner::actionsForMatch(const Plasma::QueryMatch &match)
{
Q_UNUSED(match)
return m_actions;
}
QMimeData * SpellCheckRunner::mimeDataForMatch(const Plasma::QueryMatch &match)
{
QMimeData *result = new QMimeData();
......
......@@ -43,7 +43,6 @@ public:
protected Q_SLOTS:
void init() override;
QList<QAction *> actionsForMatch(const Plasma::QueryMatch &match) override;
QMimeData * mimeDataForMatch(const Plasma::QueryMatch &match) override;
void loadData();
......
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