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 97469d04 authored by Laurent Montel's avatar Laurent Montel 😁

Use QLatin1String

parent bb33a7e8
......@@ -173,11 +173,11 @@ QString ImageScaling::generateNewName()
if (type.isEmpty()) {
type = QStringLiteral("PNG");
}
if (d->mName.endsWith(QStringLiteral(".png"))) {
if (d->mName.endsWith(QLatin1String(".png"))) {
if (type != QLatin1String("PNG")) {
d->mName.replace(QStringLiteral(".png"), QStringLiteral(".jpg"));
}
} else if (d->mName.endsWith(QStringLiteral(".jpg"))) {
} else if (d->mName.endsWith(QLatin1String(".jpg"))) {
if (type != QLatin1String("JPG")) {
d->mName.replace(QStringLiteral(".jpg"), QStringLiteral(".png"));
}
......
......@@ -308,7 +308,7 @@ void AttachmentPropertiesDialog::Private::saveToPart()
mPart->setEncrypted(ui->encrypt->isChecked());
mPart->setInline(ui->autoDisplay->isChecked());
if (ui->mimeType->currentText().startsWith(QStringLiteral("message"))
if (ui->mimeType->currentText().startsWith(QLatin1String("message"))
&& ui->encoding->itemData(ui->encoding->currentIndex()) != KMime::Headers::CE7Bit
&& ui->encoding->itemData(ui->encoding->currentIndex()) != KMime::Headers::CE8Bit) {
qCWarning(MESSAGECORE_LOG) << "Encoding on message/rfc822 must be \"7bit\" or \"8bit\".";
......
......@@ -114,10 +114,10 @@ void ScamDetectionWebEngine::handleScanPage(const QVariant &result)
const QString href = mapVariant.value(QStringLiteral("src")).toString();
const QUrl url(href);
if (!title.isEmpty()) {
if (title.startsWith(QStringLiteral("http:"))
|| title.startsWith(QStringLiteral("https:"))
|| title.startsWith(QStringLiteral("www."))) {
if (title.startsWith(QStringLiteral("www."))) {
if (title.startsWith(QLatin1String("http:"))
|| title.startsWith(QLatin1String("https:"))
|| title.startsWith(QLatin1String("www."))) {
if (title.startsWith(QLatin1String("www."))) {
const QString completUrl = url.scheme() + QLatin1String("://") + title;
if (completUrl != href
&& href != (completUrl + QLatin1Char('/'))) {
......
......@@ -214,7 +214,7 @@ void EditorWatcher::checkEditDone()
// check if it's a mime type that's mostly handled read-only
const bool isReadOnlyMimeType = (readOnlyMimeTypes.contains(mMimeType)
|| mMimeType.startsWith(QStringLiteral("image/")));
|| mMimeType.startsWith(QLatin1String("image/")));
// nobody can edit that fast, we seem to be unable to detect
// when the editor will be closed
......
......@@ -120,7 +120,7 @@ public:
mimeType = MimeTreeParser::Util::mimetype(name);
}
if (mimeType.isValid() && mimeType.name().startsWith(QStringLiteral("multipart/"))) {
if (mimeType.isValid() && mimeType.name().startsWith(QLatin1String("multipart/"))) {
return QIcon::fromTheme(QStringLiteral("folder"));
} else if (!iconName.isEmpty() && iconName != QStringLiteral("unknown")) {
return QIcon::fromTheme(iconName);
......
......@@ -139,7 +139,7 @@ static KMime::Content *partNodeFromXKMailUrl(const QUrl &url, ViewerPrivate *w,
// urlPath format is: /bodypart/<random number>/<part id>/<path>
qCDebug(MESSAGEVIEWER_LOG) << "BodyPartURLHandler: urlPath ==" << urlPath;
if (!urlPath.startsWith(QStringLiteral("/bodypart/"))) {
if (!urlPath.startsWith(QLatin1String("/bodypart/"))) {
return nullptr;
}
......@@ -866,7 +866,7 @@ bool InternalImageURLHandler::handleDrag(const QUrl &url, ViewerPrivate *window)
bool InternalImageURLHandler::willHandleDrag(const QUrl &url, ViewerPrivate *window) const
{
Q_UNUSED(window);
if (url.scheme() == QLatin1String("data") && url.path().startsWith(QStringLiteral("image"))) {
if (url.scheme() == QLatin1String("data") && url.path().startsWith(QLatin1String("image"))) {
return true;
}
......
......@@ -212,7 +212,7 @@ void NodeHelperTest::testCreateTempDir()
NodeHelper helper;
path = helper.createTempDir(QStringLiteral("foo"));
QVERIFY(path.endsWith(QStringLiteral(".index.foo")));
QVERIFY(path.endsWith(QLatin1String(".index.foo")));
QVERIFY(QDir(path).exists());
QVERIFY(QFile(path).permissions() & QFileDevice::WriteUser);
QVERIFY(QFile(path).permissions() & QFileDevice::ExeUser);
......
This diff is collapsed.
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