cleanup string creation

This commit is contained in:
Patrick von Reth 2015-07-03 11:58:43 +02:00
parent 09620f66f0
commit 95cc073b5e
4 changed files with 7 additions and 7 deletions

View File

@ -69,7 +69,7 @@ private:
{
QStringList out;
for (const QString &extention : pluginExtentions()) {
out << QString(QLatin1String("libsnore_*.%1")).arg(extention);
out << QLatin1String("libsnore_*.") + extention;
}
return out;
}
@ -78,7 +78,7 @@ private:
{
QStringList out;
for (const QString &extention : pluginExtentions()) {
out << QString(QLatin1String("libsnore_%1_*.%2")).arg(SnorePlugin::typeToString(type).toLower(), extention);
out << QLatin1String("libsnore_") + SnorePlugin::typeToString(type).toLower() + QLatin1String("_*.") + extention;
}
return out;
}

View File

@ -145,7 +145,7 @@ QString SnoreToast::appId(const Application &application)
appID = application.constHints().value("windows_app_id").toString();
}
if (appID.isEmpty()) {
appID = QString(QLatin1String("%1.%2.SnoreToast")).arg(qApp->organizationName(), qApp->applicationName()).remove(QLatin1Char(' '));
appID = (qApp->organizationName() + QLatin1Char(".") + qApp->applicationName() + QLatin1String(".SnoreToast")).remove(QLatin1Char(' '));
}
return appID;
}

View File

@ -84,7 +84,7 @@ void PushoverFrontend::login(const QString &email, const QString &password, cons
QNetworkRequest request(QUrl(QLatin1String("https://api.pushover.net/1/users/login.json")));
request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant(QLatin1String("application/x-www-form-urlencoded")));
QNetworkReply *reply = m_manager.post(request, QString(QLatin1String("email=%1&password=%2")).arg(email, password).toUtf8().constData());
QNetworkReply *reply = m_manager.post(request, (QLatin1String("email=") + email + QLatin1String("&password=") + password).toUtf8().constData());
connect(reply, &QNetworkReply::finished, [reply, deviceName, this]() {
snoreDebug(SNORE_DEBUG) << reply->error();

View File

@ -108,9 +108,9 @@ void SnarlNetworkFrontend::handleMessages()
if (noti.isValid()) {
noti.addActiveIn(this);
SnoreCore::instance().broadcastNotification(noti);
write(client, QString(QLatin1String("%1/%2\r\n")).arg(out, QString::number(noti.id())));
write(client, out + QLatin1Char("/") + QString::number(noti.id()) + QLatin1String("\r\n"));
} else {
write(client, QString(QLatin1String("%1\r\n")).arg(out));
write(client, out + QLatin1String("\r\n"));
}
}
}
@ -120,7 +120,7 @@ void SnarlNetworkFrontend::callback(Notification &sn, const QString msg)
if (sn.hints().containsPrivateValue(this, "clientSocket")) {
QTcpSocket *client = sn.hints().privateValue(this, "clientSocket").value<QPointer<QTcpSocket>>();
if (client) {
write(client, QString(QLatin1String("%1%2\r\n")).arg(msg, QString::number(sn.id())));
write(client, msg + QString::number(sn.id()) + QLatin1String("\r\n"));
}
}
}