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

USe QLatin1String here

parent f1bafd1a
......@@ -187,7 +187,7 @@ bool AttachPropertyDialog::saveProperty(QTreeWidget *lv, KTNEFPropertySet *pSet,
} else {
QString tag = item->text(2);
int key = tag.midRef(5).toInt();
QVariant prop = (tag.startsWith(QStringLiteral("attr_"))
QVariant prop = (tag.startsWith(QLatin1String("attr_"))
? pSet->attribute(key)
: pSet->property(key));
QString filename = QFileDialog::getSaveFileName(parent, QString(), tag, QString());
......
......@@ -266,8 +266,8 @@ void CollectionMailingListPage::fillMLFromWidgets()
QStringList newList; // the correct string list
QStringList::ConstIterator end = oldList.constEnd();
for (QStringList::ConstIterator it = oldList.constBegin(); it != end; ++it) {
if (!(*it).startsWith(QStringLiteral("http:")) && !(*it).startsWith(QStringLiteral("https:"))
&& !(*it).startsWith(QStringLiteral("mailto:")) && ((*it).contains(QLatin1Char('@')))) {
if (!(*it).startsWith(QLatin1String("http:")) && !(*it).startsWith(QLatin1String("https:"))
&& !(*it).startsWith(QLatin1String("mailto:")) && ((*it).contains(QLatin1Char('@')))) {
listChanged = true;
newList << QStringLiteral("mailto:") + *it;
} else {
......
......@@ -270,7 +270,7 @@ void AccountsPageReceivingTab::slotShowMailCheckMenu(const QString &ident, const
IncludeInManualChecks = group.readEntry("IncludeInManualChecks", true);
// Keep sync with kmkernel, don't forget to change there.
OfflineOnShutdown = group.readEntry("OfflineOnShutdown", ident.startsWith(QStringLiteral("akonadi_pop3_resource")) ? true : false);
OfflineOnShutdown = group.readEntry("OfflineOnShutdown", ident.startsWith(QLatin1String("akonadi_pop3_resource")) ? true : false);
CheckOnStartup = group.readEntry("CheckOnStartup", false);
QSharedPointer<RetrievalOptions> opts(new RetrievalOptions(IncludeInManualChecks, OfflineOnShutdown, CheckOnStartup));
......
......@@ -276,7 +276,7 @@ void XFaceConfigurator::slotUpdateXFace()
QString str = mTextEdit->editor()->toPlainText();
if (!str.isEmpty()) {
if (str.startsWith(QStringLiteral("x-face:"), Qt::CaseInsensitive)) {
if (str.startsWith(QLatin1String("x-face:"), Qt::CaseInsensitive)) {
str = str.remove(QStringLiteral("x-face:"), Qt::CaseInsensitive);
mTextEdit->editor()->setPlainText(str);
}
......
......@@ -52,11 +52,11 @@ void SaveAsFileJob::start()
QTextDocumentWriter writer;
const QString filename = dlg->selectedFiles().at(0);
writer.setFileName(filename);
if (dlg->selectedNameFilter() == QLatin1String("text/plain") || filename.endsWith(QStringLiteral(".txt"))) {
if (dlg->selectedNameFilter() == QLatin1String("text/plain") || filename.endsWith(QLatin1String(".txt"))) {
writer.setFormat("plaintext");
} else if (dlg->selectedNameFilter() == QLatin1String("text/html") || filename.endsWith(QStringLiteral(".html"))) {
} else if (dlg->selectedNameFilter() == QLatin1String("text/html") || filename.endsWith(QLatin1String(".html"))) {
writer.setFormat("HTML");
} else if (dlg->selectedNameFilter() == QLatin1String("application/vnd.oasis.opendocument.text") || filename.endsWith(QStringLiteral(".odf"))) {
} else if (dlg->selectedNameFilter() == QLatin1String("application/vnd.oasis.opendocument.text") || filename.endsWith(QLatin1String(".odf"))) {
writer.setFormat("ODF");
} else {
writer.setFormat("plaintext");
......
......@@ -793,7 +793,7 @@ void KMOpenMsgCommand::slotResult(KJob *job)
return;
}
int startOfMessage = 0;
if (mMsgString.startsWith(QStringLiteral("From "))) {
if (mMsgString.startsWith(QLatin1String("From "))) {
startOfMessage = mMsgString.indexOf(QLatin1Char('\n'));
if (startOfMessage == -1) {
doesNotContainMessage();
......
......@@ -385,7 +385,7 @@ bool KMKernel::handleCommandLine(bool noArgsOpensReader, const QStringList &args
// only read additional command line arguments if kmail/kontact is
// not called with "-session foo"
for (const QString &arg : parser.positionalArguments()) {
if (arg.startsWith(QStringLiteral("mailto:"), Qt::CaseInsensitive)) {
if (arg.startsWith(QLatin1String("mailto:"), Qt::CaseInsensitive)) {
const QUrl urlDecoded(QUrl::fromPercentEncoding(arg.toUtf8()));
QMap<QString, QString> values = MessageCore::StringUtil::parseMailtoUrl(urlDecoded);
for (auto it = values.cbegin(), end = values.cend(); it != end; ++it) {
......@@ -1655,7 +1655,7 @@ void KMKernel::stopAgentInstance()
KConfigGroup group(KMKernel::config(), resourceGroupPattern.arg(identifier));
// Keep sync in ConfigureDialog, don't forget to change there.
if (group.readEntry("OfflineOnShutdown", identifier.startsWith(QStringLiteral("akonadi_pop3_resource")) ? true : false)) {
if (group.readEntry("OfflineOnShutdown", identifier.startsWith(QLatin1String("akonadi_pop3_resource")) ? true : false)) {
type.setIsOnline(false);
}
}
......
......@@ -608,7 +608,7 @@ void MessageActions::addMailingListAction(const QString &item, const QUrl &url)
if (protocol == QLatin1String("mailto")) {
protocol = i18n("email");
prettyUrl.remove(0, 7); // length( "mailto:" )
} else if (protocol.startsWith(QStringLiteral("http"))) {
} else if (protocol.startsWith(QLatin1String("http"))) {
protocol = i18n("web");
}
// item is a mailing list url description passed from the updateActions method above.
......
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