Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit fd023467 authored by Laurent Montel's avatar Laurent Montel 😁

Use QLatin1String

parent 27f080ff
......@@ -661,7 +661,7 @@ AppearancePageHeadersTab::AppearancePageHeadersTab(QWidget *parent)
for (int i = 0; i < numDateDisplayConfig; ++i) {
const char *label = dateDisplayConfig[i].displayName;
QString buttonLabel;
if (QString::fromLatin1(label).contains(QStringLiteral("%1"))) {
if (QString::fromLatin1(label).contains(QLatin1String("%1"))) {
buttonLabel = i18n(label, DateFormatter::formatCurrentDate(dateDisplayConfig[i].dateDisplay));
} else {
buttonLabel = i18n(label);
......
......@@ -723,8 +723,8 @@ void KMKernel::setAccountStatus(bool goOnline)
const QString identifier(type.identifier());
if (PimCommon::Util::isImapResource(identifier)
|| identifier.contains(POP3_RESOURCE_IDENTIFIER)
|| identifier.contains(QStringLiteral("akonadi_maildispatcher_agent"))
|| type.type().capabilities().contains(QStringLiteral("NeedsNetwork"))) {
|| identifier.contains(QLatin1String("akonadi_maildispatcher_agent"))
|| type.type().capabilities().contains(QLatin1String("NeedsNetwork"))) {
type.setIsOnline(goOnline);
}
}
......
......@@ -289,13 +289,13 @@ QString KMReaderWin::newFeaturesMD5()
void KMReaderWin::displaySplashPage(const QString &templateName, const QVariantHash &_data)
{
QVariantHash data = _data;
if (!data.contains(QStringLiteral("icon"))) {
if (!data.contains(QLatin1String("icon"))) {
data[QStringLiteral("icon")] = QStringLiteral("kmail");
}
if (!data.contains(QStringLiteral("name"))) {
if (!data.contains(QLatin1String("name"))) {
data[QStringLiteral("name")] = i18n("KMail");
}
if (!data.contains(QStringLiteral("subtitle"))) {
if (!data.contains(QLatin1String("subtitle"))) {
data[QStringLiteral("subtitle")] = i18n("The KDE Mail Client");
}
......@@ -784,10 +784,10 @@ void KMReaderWin::updateHtmlActions()
} else {
const QStringList customs = mSearchedAddress.customs();
for (const QString &custom : customs) {
if (custom.contains(QStringLiteral("MailPreferedFormatting"))) {
if (custom.contains(QLatin1String("MailPreferedFormatting"))) {
const QString value = mSearchedAddress.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("MailPreferedFormatting"));
mViewAsHtml->setChecked(value == QLatin1String("HTML"));
} else if (custom.contains(QStringLiteral("MailAllowToRemoteContent"))) {
} else if (custom.contains(QLatin1String("MailAllowToRemoteContent"))) {
const QString value = mSearchedAddress.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("MailAllowToRemoteContent"));
mLoadExternalReference->setChecked((value == QLatin1String("TRUE")));
}
......
......@@ -127,7 +127,7 @@ static QString toolTip(const Akonadi::Item &item)
int KMSearchMessageModel::columnCount(const QModelIndex &parent) const
{
if (collection().isValid()
&& !collection().contentMimeTypes().contains(QStringLiteral("message/rfc822"))
&& !collection().contentMimeTypes().contains(QLatin1String("message/rfc822"))
&& collection().contentMimeTypes() != QStringList(QStringLiteral("inode/directory"))) {
return 1;
}
......@@ -158,7 +158,7 @@ QVariant KMSearchMessageModel::data(const QModelIndex &index, int role) const
return QVariant();
}
if (!collection().contentMimeTypes().contains(QStringLiteral("message/rfc822"))) {
if (!collection().contentMimeTypes().contains(QLatin1String("message/rfc822"))) {
if (role == Qt::DisplayRole) {
return i18nc("@label", "This model can only handle email folders. The current collection holds mimetypes: %1",
collection().contentMimeTypes().join(QLatin1Char(',')));
......@@ -224,7 +224,7 @@ QVariant KMSearchMessageModel::data(const QModelIndex &index, int role) const
QVariant KMSearchMessageModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (collection().isValid()
&& !collection().contentMimeTypes().contains(QStringLiteral("message/rfc822"))
&& !collection().contentMimeTypes().contains(QLatin1String("message/rfc822"))
&& collection().contentMimeTypes() != QStringList(QStringLiteral("inode/directory"))) {
return QVariant();
}
......
......@@ -931,13 +931,13 @@ Akonadi::Collection::List SearchWindow::searchCollectionsRecursive(const Akonadi
for (const Akonadi::Collection &col : cols) {
const QModelIndex colIdx = Akonadi::EntityTreeModel::modelIndexForCollection(etm, col);
if (col.statistics().count() > -1) {
if (col.cachePolicy().localParts().contains(QStringLiteral("RFC822"))) {
if (col.cachePolicy().localParts().contains(QLatin1String("RFC822"))) {
result.push_back(col);
}
} else {
const Akonadi::Collection collection = etm->data(colIdx, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
if (!collection.hasAttribute<Akonadi::EntityHiddenAttribute>()
&& collection.cachePolicy().localParts().contains(QStringLiteral("RFC822"))) {
&& collection.cachePolicy().localParts().contains(QLatin1String("RFC822"))) {
result.push_back(collection);
}
}
......@@ -949,7 +949,7 @@ Akonadi::Collection::List SearchWindow::searchCollectionsRecursive(const Akonadi
for (int i = 0; i < childrenCount; ++i) {
const QModelIndex idx = etm->index(i, 0, colIdx);
const Akonadi::Collection child = etm->data(idx, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
if (child.cachePolicy().localParts().contains(QStringLiteral("RFC822"))) {
if (child.cachePolicy().localParts().contains(QLatin1String("RFC822"))) {
subCols.push_back(child);
}
}
......
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