Update string literals
Since _ls is now deprecated this is removed in favour of L1, I've also taken the oportunity to replace QStringLiteral and QLatin1String with their shortened form while we're at it. There are also a few instances where the string literal type has been switch, the general rule being to use the one that matches the function type or value being compared to avoid conversions.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <KPluginFactory>
|
||||
#include <Purpose/PluginBase>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class NeoChatJob : public Purpose::Job
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -25,11 +27,11 @@ public:
|
||||
|
||||
void start() override
|
||||
{
|
||||
const QJsonArray urlsJson = data().value(QStringLiteral("urls")).toArray();
|
||||
const QString title = data().value(QStringLiteral("title")).toString();
|
||||
const QString message = QStringLiteral("%1 - %2").arg(title, arrayToList(urlsJson).join(QLatin1Char(' ')));
|
||||
const QJsonArray urlsJson = data().value("urls"_L1).toArray();
|
||||
const QString title = data().value("title"_L1).toString();
|
||||
const QString message = u"%1 - %2"_s.arg(title, arrayToList(urlsJson).join(QLatin1Char(' ')));
|
||||
|
||||
auto *job = new KIO::CommandLauncherJob(QStringLiteral("neochat"), {QStringLiteral("--share"), message});
|
||||
auto *job = new KIO::CommandLauncherJob(u"neochat"_s, {u"--share"_s, message});
|
||||
connect(job, &KJob::finished, this, &NeoChatJob::emitResult);
|
||||
job->start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user