[Runners] Use icon name

Summary: `QIcon` isn't thread-safe and here we just pass a theme icon name anyway, so we can have the runner UI do the work as needed.

Test Plan: Compiles

Reviewers: #kde_connect, nicolasfella

Reviewed By: #kde_connect, nicolasfella

Subscribers: kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D19158
This commit is contained in:
Nicolas Fella 2019-02-21 11:47:34 +01:00
parent a4509d9640
commit 7970e3d1c4
2 changed files with 2 additions and 4 deletions

View file

@ -20,7 +20,6 @@
#include "findmyphonerunner.h"
#include <QIcon>
#include <QDebug>
#include <KLocalizedString>
@ -63,7 +62,7 @@ void FindMyPhoneRunner::match(Plasma::RunnerContext &context)
Plasma::QueryMatch match(this);
match.setType(Plasma::QueryMatch::PossibleMatch);
match.setId(deviceId);
match.setIcon(QIcon::fromTheme("kdeconnect"));
match.setIconName(QStringLiteral("kdeconnect"));
match.setText(i18n("Find %1", deviceName));
match.setData(deviceId);
context.addMatch(match);

View file

@ -20,7 +20,6 @@
#include "remotecommandsrunner.h"
#include <QIcon>
#include <QDebug>
#include "interfaces/dbusinterfaces.h"
@ -70,7 +69,7 @@ void RemoteCommandsRunner::match(Plasma::RunnerContext &context)
Plasma::QueryMatch match(this);
match.setType(Plasma::QueryMatch::PossibleMatch);
match.setId(it.key());
match.setIcon(QIcon::fromTheme("kdeconnect"));
match.setIconName(QStringLiteral("kdeconnect"));
match.setText(deviceName + ": " + commandName);
match.setSubtext(cont.value(QStringLiteral("command")).toString());
match.setData(deviceId + "$" + it.key());