Commit 6d572056 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port away from deprecated KRunner methods

parent 2fce8f7a
Pipeline #36926 passed with stage
in 23 minutes and 39 seconds
......@@ -29,8 +29,6 @@
#include "lib/contactcompleter.h"
#include "lib/resultiterator.h"
static const QStringList sCategories = { i18n("Contacts") };
Q_DECLARE_METATYPE(KContacts::Addressee *)
PIMContactsRunner::PIMContactsRunner(QObject *parent, const QVariantList &args)
......@@ -54,20 +52,6 @@ void PIMContactsRunner::reloadConfiguration()
mQueryAutocompleter = config().readEntry(QStringLiteral("queryAutocompleter"), true);
}
QStringList PIMContactsRunner::categories() const
{
return sCategories;
}
QIcon PIMContactsRunner::categoryIcon(const QString &category) const
{
if (category == sCategories[0]) {
return QIcon::fromTheme(QStringLiteral("view-pim-contacts"));
}
return Plasma::AbstractRunner::categoryIcon(category);
}
void PIMContactsRunner::match(Plasma::RunnerContext &context)
{
const QString queryString = context.query();
......@@ -144,7 +128,7 @@ void PIMContactsRunner::queryContacts(Plasma::RunnerContext &context, const QStr
}
Plasma::QueryMatch match(this);
match.setMatchCategory(sCategories[0]);
match.setMatchCategory(i18n("Contacts"));
match.setRelevance(0.75); // 0.75 is used by most runners, we don't
// want to shadow them
match.setMimeType(KContacts::Addressee::mimeType());
......@@ -213,7 +197,7 @@ void PIMContactsRunner::queryAutocompleter(Plasma::RunnerContext &context, const
Plasma::QueryMatch match(this);
match.setRelevance(0.7); // slightly lower relevance than real addressbook contacts
match.setMimeType(KContacts::Addressee::mimeType());
match.setMatchCategory(sCategories[0]);
match.setMatchCategory(i18n("Contacts"));
match.setSubtext(i18n("Autocompleted from received and sent emails"));
match.setIcon(QIcon::fromTheme(QStringLiteral("user-identity")));
if (result == queryString) {
......
......@@ -22,8 +22,6 @@ public:
void match(Plasma::RunnerContext &context) override;
void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) override;
QStringList categories() const override;
QIcon categoryIcon(const QString &category) const override;
private:
void queryContacts(Plasma::RunnerContext &context, const QString &queryString);
......
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