Commit f511df2e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QLatin1String in join/startswith/endsWith/contains + QString::replace...

Use QLatin1String in join/startswith/endsWith/contains + QString::replace operates on the same object, no need to reassign
parent 6857b7a7
......@@ -148,7 +148,7 @@ void AlarmDialog::load(const KCalendarCore::Alarm::Ptr &alarm)
it != end; ++it) {
add << (*it).fullName();
}
mUi->mEmailAddress->setText(add.join(QStringLiteral(", ")));
mUi->mEmailAddress->setText(add.join(QLatin1String(", ")));
mUi->mEmailText->setPlainText(alarm->mailText());
id = 3;
break;
......
......@@ -165,7 +165,7 @@ void CategoryWidget::hideHeader()
QStringList CategoryWidget::selectedCategories(QString &categoriesStr)
{
mCategoryList = getSelectedCategories(listView());
categoriesStr = mCategoryList.join(QStringLiteral(", "));
categoriesStr = mCategoryList.join(QLatin1String(", "));
return mCategoryList;
}
......
......@@ -148,7 +148,7 @@ void CategorySelectWidget::hideHeader()
QStringList CategorySelectWidget::selectedCategories(QString &categoriesStr)
{
mCategoryList = getSelectedCategoriesFromCategoriesView(listView());
categoriesStr = mCategoryList.join(QStringLiteral(", "));
categoriesStr = mCategoryList.join(QLatin1String(", "));
return mCategoryList;
}
......
......@@ -198,7 +198,7 @@ void IncidenceAttachment::removeSelectedAttachments()
return;
}
QString labelsStr = labels.join(QStringLiteral("<nl/>"));
QString labelsStr = labels.join(QLatin1String("<nl/>"));
if (KMessageBox::questionYesNo(
nullptr,
......@@ -595,13 +595,13 @@ void IncidenceAttachment::addUriAttachment(const QString &uri, const QString &mi
item->setUri(uri);
item->setLabel(label);
if (mimeType.isEmpty()) {
if (uri.startsWith(QStringLiteral("uid:"))) {
if (uri.startsWith(QLatin1String("uid:"))) {
item->setMimeType(QStringLiteral("text/directory"));
} else if (uri.startsWith(QStringLiteral("kmail:"))) {
} else if (uri.startsWith(QLatin1String("kmail:"))) {
item->setMimeType(QStringLiteral("message/rfc822"));
} else if (uri.startsWith(QStringLiteral("urn:x-ical"))) {
} else if (uri.startsWith(QLatin1String("urn:x-ical"))) {
item->setMimeType(QStringLiteral("text/calendar"));
} else if (uri.startsWith(QStringLiteral("news:"))) {
} else if (uri.startsWith(QLatin1String("news:"))) {
item->setMimeType(QStringLiteral("message/news"));
} else {
QMimeDatabase db;
......
......@@ -422,7 +422,7 @@ void IncidenceDateTime::enableTimeEdits()
mUi->mEndTimeEdit->setTime(QTime(1, 0));
}
const bool currentlyVisible = mUi->mTimeZoneLabel->text().contains(QStringLiteral("&lt;&lt;"));
const bool currentlyVisible = mUi->mTimeZoneLabel->text().contains(QLatin1String("&lt;&lt;"));
setTimeZonesVisibility(!wholeDayChecked && mTimezoneCombosWereVisibile);
mTimezoneCombosWereVisibile = currentlyVisible;
if (!wholeDayChecked && !timeZonesAreLocal(currentStartDateTime(), currentEndDateTime())) {
......
......@@ -600,7 +600,7 @@ void IncidenceDialogPrivate::load(const Akonadi::Item &item)
mCalSelector->setDefaultCollection(Akonadi::Collection(item.storageCollectionId()));
}
if (!mCalSelector->mimeTypeFilter().contains(QStringLiteral("text/calendar"))
if (!mCalSelector->mimeTypeFilter().contains(QLatin1String("text/calendar"))
|| !mCalSelector->mimeTypeFilter().contains(incidence->mimeType())) {
mCalSelector->setMimeTypeFilter(QStringList() << incidence->mimeType()
<< QStringLiteral("text/calendar"));
......
......@@ -86,8 +86,8 @@ void IndividualMessageQueueJob::start()
void IndividualMessageQueueJob::startQueueJob(const QStringList &messageTo, const QStringList &to, const QStringList &messageCc, const QStringList &cc)
{
KMime::Message::Ptr msg(message());
msg->to()->fromUnicodeString(messageTo.join(QStringLiteral(", ")), "utf-8");
msg->cc()->fromUnicodeString(messageCc.join(QStringLiteral(", ")), "utf-8");
msg->to()->fromUnicodeString(messageTo.join(QLatin1String(", ")), "utf-8");
msg->cc()->fromUnicodeString(messageCc.join(QLatin1String(", ")), "utf-8");
msg->assemble();
mQueueJob = new MailTransport::MessageQueueJob(this);
......@@ -119,7 +119,7 @@ void IndividualMessageQueueJob::startQueueJob(const QStringList &messageTo, cons
void IndividualMessageQueueJob::startComposerJob(const QStringList &to, const QStringList &cc)
{
mComposerJob
= new OpenComposerJob(this, to.join(QStringLiteral(", ")), cc.join(QStringLiteral(
= new OpenComposerJob(this, to.join(QLatin1String(", ")), cc.join(QStringLiteral(
", ")),
QString(), message(), mIdentity);
connect(mComposerJob, &OpenComposerJob::finished, this,
......
......@@ -65,7 +65,7 @@ public:
bool isValid(const QString &incidenceIdentifier) const override
{
return incidenceIdentifier.startsWith(QStringLiteral("fb-"));
return incidenceIdentifier.startsWith(QLatin1String("fb-"));
}
QString displayName(const KCalendarCore::Incidence::Ptr &incidence) const override
......
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