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

David told me that it's a usercase when QLatin1String is better than QStringLiteral

parent e9064f54
......@@ -50,7 +50,7 @@ DebugWidget::DebugWidget(QWidget *parent)
}
mDebugInterface = new DebugInterface(service, "/debug", QDBusConnection::sessionBus(), this);
QCheckBox *cb = new QCheckBox(i18n("Enable debugger"), this);
cb->setChecked(mDebugInterface->isValid() && mDebugInterface->tracer().value() == QStringLiteral("dbus"));
cb->setChecked(mDebugInterface->isValid() && mDebugInterface->tracer().value() == QLatin1String("dbus"));
connect(cb, &QCheckBox::toggled, this, &DebugWidget::enableDebugger);
layout->addWidget(cb);
......
......@@ -364,7 +364,7 @@ void MainWindow::slotDialogDestroyed(QObject *win)
{
const QSize size = qobject_cast<QWidget *>(win)->size();
const QString name = win->objectName();
if (name == QStringLiteral("settings")) {
if (name == QLatin1String("settings")) {
Settings::setConfigWindowSize(size);
}
}
......
......@@ -226,15 +226,15 @@ void ComposerView::contextMenuEvent(QContextMenuEvent *event)
const bool imageSelected = !d->contextMenuResult.imageUrl().isEmpty();
const QWebElement elm = d->contextMenuResult.element();
const bool tableCellSelected = (elm.tagName().toLower() == QStringLiteral("td"));
const bool tableSelected = (elm.tagName().toLower() == QStringLiteral("table") ||
const bool tableCellSelected = (elm.tagName().toLower() == QLatin1String("td"));
const bool tableSelected = (elm.tagName().toLower() == QLatin1String("table") ||
tableCellSelected);
const bool listSelected = (elm.tagName().toLower() == QStringLiteral("ol") ||
elm.tagName().toLower() == QStringLiteral("ul") ||
elm.tagName().toLower() == QStringLiteral("li"));
const bool listSelected = (elm.tagName().toLower() == QLatin1String("ol") ||
elm.tagName().toLower() == QLatin1String("ul") ||
elm.tagName().toLower() == QLatin1String("li"));
const bool anchorSelected = (elm.tagName().toLower() == QStringLiteral("a"));
const bool anchorSelected = (elm.tagName().toLower() == QLatin1String("a"));
qCDebug(COMPOSEREDITORNG_LOG) << " elm.tagName().toLower() " << elm.tagName().toLower();
......
......@@ -36,10 +36,10 @@ OperaAddressBook::OperaAddressBook(const QString &filename, ImportWizard *parent
KContacts::Addressee *contact = 0;
while (!stream.atEnd()) {
QString line = stream.readLine();
if (line == QStringLiteral("#CONTACT")) {
if (line == QLatin1String("#CONTACT")) {
appendContact(contact);
foundContact = true;
} else if (line == QStringLiteral("#FOLDER")) {
} else if (line == QLatin1String("#FOLDER")) {
appendContact(contact);
foundContact = false;
//TODO
......
......@@ -80,7 +80,7 @@ void SylpheedAddressBook::readAddressBook(const QString &filename)
}
const QString tag = e.tagName();
if (tag == QStringLiteral("person")) {
if (tag == QLatin1String("person")) {
KContacts::Addressee contact;
//uid="333304265" first-name="dd" last-name="ccc" nick-name="" cn="laurent"
QString uidPerson;
......@@ -103,11 +103,11 @@ void SylpheedAddressBook::readAddressBook(const QString &filename)
QStringList uidAddress;
for (QDomElement addressElement = e.firstChildElement(); !addressElement.isNull(); addressElement = addressElement.nextSiblingElement()) {
const QString addressTag = addressElement.tagName();
if (addressTag == QStringLiteral("address-list")) {
if (addressTag == QLatin1String("address-list")) {
QStringList emails;
for (QDomElement addresslist = addressElement.firstChildElement(); !addresslist.isNull(); addresslist = addresslist.nextSiblingElement()) {
const QString tagAddressList = addresslist.tagName();
if (tagAddressList == QStringLiteral("address")) {
if (tagAddressList == QLatin1String("address")) {
if (addresslist.hasAttribute(QStringLiteral("email"))) {
emails << addresslist.attribute(QStringLiteral("email"));
} else if (addresslist.hasAttribute(QStringLiteral("alias"))) {
......@@ -123,10 +123,10 @@ void SylpheedAddressBook::readAddressBook(const QString &filename)
contact.setEmails(emails);
}
} else if (addressTag == QStringLiteral("attribute-list")) {
} else if (addressTag == QLatin1String("attribute-list")) {
for (QDomElement attributelist = addressElement.firstChildElement(); !attributelist.isNull(); attributelist = attributelist.nextSiblingElement()) {
const QString tagAttributeList = attributelist.tagName();
if (tagAttributeList == QStringLiteral("attribute")) {
if (tagAttributeList == QLatin1String("attribute")) {
if (attributelist.hasAttribute(QStringLiteral("name"))) {
const QString name = attributelist.attribute(QStringLiteral("name"));
const QString value = attributelist.text();
......@@ -148,7 +148,7 @@ void SylpheedAddressBook::readAddressBook(const QString &filename)
}
addImportNote(contact, QStringLiteral("Sylpheed"));
createContact(contact);
} else if (tag == QStringLiteral("group")) {
} else if (tag == QLatin1String("group")) {
QString name;
if (e.hasAttribute(QStringLiteral("name"))) {
name = e.attribute(QStringLiteral("name"));
......@@ -157,10 +157,10 @@ void SylpheedAddressBook::readAddressBook(const QString &filename)
//TODO: create Group
for (QDomElement groupElement = e.firstChildElement(); !groupElement.isNull(); groupElement = groupElement.nextSiblingElement()) {
const QString groupTag = groupElement.tagName();
if (groupTag == QStringLiteral("member-list")) {
if (groupTag == QLatin1String("member-list")) {
for (QDomElement memberlist = groupElement.firstChildElement(); !memberlist.isNull(); memberlist = memberlist.nextSiblingElement()) {
const QString tagMemberList = memberlist.tagName();
if (tagMemberList == QStringLiteral("member")) {
if (tagMemberList == QLatin1String("member")) {
QString pid;
QString eid;
if (memberlist.hasAttribute(QStringLiteral("pid"))) {
......
......@@ -159,7 +159,7 @@ void ThunderbirdSettings::readExtensionsSettings()
const QString conversionFormatStr(QStringLiteral("extensions.AutoResizeImage.conversionFormat"));
if (mHashConfig.contains(conversionFormatStr)) {
QString conversionFormat = mHashConfig.value(conversionFormatStr).toString();
if (conversionFormat == QStringLiteral("png")) {
if (conversionFormat == QLatin1String("png")) {
conversionFormat = QStringLiteral("PNG");
} else {
conversionFormat = QStringLiteral("JPG");
......@@ -302,9 +302,9 @@ void ThunderbirdSettings::readLdapSettings()
ldap.ldapUrl = QUrl(mHashConfig.value(ldapUri).toString());
ldap.port = ldap.ldapUrl.port();
if (ldap.ldapUrl.scheme() == QStringLiteral("ldaps")) {
if (ldap.ldapUrl.scheme() == QLatin1String("ldaps")) {
ldap.useSSL = true;
} else if (ldap.ldapUrl.scheme() == QStringLiteral("ldap")) {
} else if (ldap.ldapUrl.scheme() == QLatin1String("ldap")) {
ldap.useSSL = false;
} else {
qCDebug(IMPORTWIZARD_LOG) << " Security not implemented :" << ldap.ldapUrl.scheme();
......@@ -499,7 +499,7 @@ void ThunderbirdSettings::readAccount()
loginAtStartup = mHashConfig.value(loginAtStartupStr).toBool();
}
bool found = false;
if (type == QStringLiteral("imap")) {
if (type == QLatin1String("imap")) {
QMap<QString, QVariant> settings;
settings.insert(QStringLiteral("ImapServer"), host);
settings.insert(QStringLiteral("UserName"), userName);
......@@ -565,7 +565,7 @@ void ThunderbirdSettings::readAccount()
addCheckMailOnStartup(agentIdentifyName, loginAtStartup);
//Not find a method to disable it in thunderbird
addToManualCheck(agentIdentifyName, true);
} else if (type == QStringLiteral("pop3")) {
} else if (type == QLatin1String("pop3")) {
QMap<QString, QVariant> settings;
settings.insert(QStringLiteral("Host"), host);
settings.insert(QStringLiteral("Login"), userName);
......@@ -629,17 +629,17 @@ void ThunderbirdSettings::readAccount()
addCheckMailOnStartup(agentIdentifyName, loginAtStartup);
//Not find a method to disable it in thunderbird
addToManualCheck(agentIdentifyName, true);
} else if (type == QStringLiteral("none")) {
} else if (type == QLatin1String("none")) {
//FIXME look at if we can implement it
qCDebug(IMPORTWIZARD_LOG) << " account type none!";
} else if (type == QStringLiteral("movemail")) {
} else if (type == QLatin1String("movemail")) {
qCDebug(IMPORTWIZARD_LOG) << " movemail accound found and not implemented in importthunderbird";
//TODO
} else if (type == QStringLiteral("rss")) {
} else if (type == QLatin1String("rss")) {
//TODO when akregator2 will merge in kdepim
qCDebug(IMPORTWIZARD_LOG) << " rss resource needs to be implemented";
continue;
} else if (type == QStringLiteral("nntp")) {
} else if (type == QLatin1String("nntp")) {
//TODO add config directly to knode
//TODO when knode will merge in kdepim
qCDebug(IMPORTWIZARD_LOG) << " nntp resource need to be implemented";
......@@ -884,9 +884,9 @@ void ThunderbirdSettings::insertIntoMap(const QString &line)
//Store as String
mHashConfig.insert(key, valueStr);
} else {
if (valueStr == QStringLiteral("true")) {
if (valueStr == QLatin1String("true")) {
mHashConfig.insert(key, true);
} else if (valueStr == QStringLiteral("false")) {
} else if (valueStr == QLatin1String("false")) {
mHashConfig.insert(key, false);
} else {
//Store as integer
......
......@@ -114,9 +114,9 @@ void TrojitaSettings::readTransport()
const QString smtpMethod = settings->value(QStringLiteral("msa.method")).toString();
if (!smtpMethod.isEmpty()) {
MailTransport::Transport *mt = createTransport();
if (smtpMethod == QStringLiteral("IMAP-SENDMAIL")) {
if (smtpMethod == QLatin1String("IMAP-SENDMAIL")) {
//see http://tools.ietf.org/html/draft-kundrat-imap-submit-01
} else if (smtpMethod == QStringLiteral("SMTP") || smtpMethod == QStringLiteral("SSMTP")) {
} else if (smtpMethod == QLatin1String("SMTP") || smtpMethod == QLatin1String("SSMTP")) {
if (settings->contains(QStringLiteral("msa.smtp.host"))) {
mt->setHost(settings->value(QStringLiteral("msa.smtp.host")).toString());
}
......@@ -140,7 +140,7 @@ void TrojitaSettings::readTransport()
}
}
mt->setType(MailTransport::Transport::EnumType::SMTP);
} else if (smtpMethod == QStringLiteral("sendmail")) {
} else if (smtpMethod == QLatin1String("sendmail")) {
mt->setType(MailTransport::Transport::EnumType::Sendmail);
if (settings->contains(QStringLiteral("msa.sendmail"))) {
mt->setHost(settings->value(QStringLiteral("msa.sendmail")).toString());
......
......@@ -87,7 +87,7 @@ void OpenComposerJob::timeout()
void OpenComposerJob::slotServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
{
Q_UNUSED(oldOwner);
if (name == QStringLiteral("org.kde.kmail") && !newOwner.isEmpty()) {
if (name == QLatin1String("org.kde.kmail") && !newOwner.isEmpty()) {
processMail();
}
}
......
......@@ -43,11 +43,11 @@ void MergeContactsDialogTest::shouldHaveDefaultValue()
for (int i = 0; i < stackedWidget->count(); ++i) {
QWidget *w = stackedWidget->widget(i);
const QString objName = w->objectName();
const bool hasGoodNamePage = (objName == QStringLiteral("notenoughcontactselected") ||
objName == QStringLiteral("nocontactselected") ||
objName == QStringLiteral("manualmergeresultwidget") ||
objName == QStringLiteral("selectioninformation") ||
objName == QStringLiteral("mergecontactinfowidget"));
const bool hasGoodNamePage = (objName == QLatin1String("notenoughcontactselected") ||
objName == QLatin1String("nocontactselected") ||
objName == QLatin1String("manualmergeresultwidget") ||
objName == QLatin1String("selectioninformation") ||
objName == QLatin1String("mergecontactinfowidget"));
QVERIFY(hasGoodNamePage);
}
......
......@@ -53,7 +53,7 @@ void MergeContactSelectInformationScrollAreaTest::shouldHaveDefaultValue()
for (int i = 0; i < stackedwidget->count(); ++i) {
QWidget *w = stackedwidget->widget(i);
const QString objName = w->objectName();
bool hasCorrectName = (objName == QStringLiteral("mergedcontactwidget")) || (objName == QStringLiteral("selectwidget"));
bool hasCorrectName = (objName == QLatin1String("mergedcontactwidget")) || (objName == QStringLiteral("selectwidget"));
QVERIFY(hasCorrectName);
}
QCOMPARE(stackedwidget->currentWidget()->objectName(), QStringLiteral("selectwidget"));
......
......@@ -93,7 +93,7 @@ void MergeContactWidgetTest::shouldHaveDefaultValueOnCreation()
for (int i = 0; i < splitter->count(); ++i) {
const QString objName = splitter->widget(i)->objectName();
const bool hasName = (objName == QStringLiteral("selectcontactwidget")) || (objName == QStringLiteral("mergecontactinfowidget"));
const bool hasName = (objName == QLatin1String("selectcontactwidget")) || (objName == QLatin1String("mergecontactinfowidget"));
QVERIFY(hasName);
}
}
......
......@@ -39,12 +39,12 @@ void SearchAndMergeContactDuplicateContactDialogTest::shouldHaveDefaultValueOnCr
for (int i = 0; i < stackedWidget->count(); ++i) {
QWidget *w = stackedWidget->widget(i);
const QString objName = w->objectName();
const bool hasGoodNamePage = (objName == QStringLiteral("mergecontact") ||
objName == QStringLiteral("nocontactselected") ||
objName == QStringLiteral("nocontactduplicatesfound") ||
objName == QStringLiteral("noenoughcontactselected") ||
objName == QStringLiteral("mergecontactresult") ||
objName == QStringLiteral("selectioninformation"));
const bool hasGoodNamePage = (objName == QLatin1String("mergecontact") ||
objName == QLatin1String("nocontactselected") ||
objName == QLatin1String("nocontactduplicatesfound") ||
objName == QLatin1String("noenoughcontactselected") ||
objName == QLatin1String("mergecontactresult") ||
objName == QLatin1String("selectioninformation"));
QVERIFY(hasGoodNamePage);
}
......
......@@ -27,23 +27,23 @@
XXPort *XXPortFactory::createXXPort(const QString &identifier, QWidget *parentWidget) const
{
if (identifier == QStringLiteral("vcard21") || identifier == QStringLiteral("vcard30") || identifier == QStringLiteral("vcard40")) {
if (identifier == QLatin1String("vcard21") || identifier == QLatin1String("vcard30") || identifier == QLatin1String("vcard40")) {
XXPort *xxport = new VCardXXPort(parentWidget);
if (identifier == QStringLiteral("vcard21")) {
if (identifier == QLatin1String("vcard21")) {
xxport->setOption(QStringLiteral("version"), QStringLiteral("v21"));
} else if (identifier == QStringLiteral("vcard30")) {
} else if (identifier == QLatin1String("vcard30")) {
xxport->setOption(QStringLiteral("version"), QStringLiteral("v30"));
} else if (identifier == QStringLiteral("vcard40")) {
} else if (identifier == QLatin1String("vcard40")) {
xxport->setOption(QStringLiteral("version"), QStringLiteral("v40"));
}
return xxport;
} else if (identifier == QStringLiteral("csv")) {
} else if (identifier == QLatin1String("csv")) {
return new CsvXXPort(parentWidget);
} else if (identifier == QStringLiteral("ldif")) {
} else if (identifier == QLatin1String("ldif")) {
return new LDIFXXPort(parentWidget);
} else if (identifier == QStringLiteral("ldap")) {
} else if (identifier == QLatin1String("ldap")) {
return new LDAPXXPort(parentWidget);
} else if (identifier == QStringLiteral("gmx")) {
} else if (identifier == QLatin1String("gmx")) {
return new GMXXXPort(parentWidget);
} else {
return Q_NULLPTR;
......
......@@ -186,7 +186,7 @@ void XXPortManager::slotExport(const QString &identifier)
return;
}
const bool selectExportType = (identifier == QStringLiteral("vcard21") || identifier == QStringLiteral("vcard30") || identifier == QStringLiteral("vcard40"));
const bool selectExportType = (identifier == QLatin1String("vcard21") || identifier == QLatin1String("vcard30") || identifier == QLatin1String("vcard40"));
QPointer<ContactSelectionDialog> dlg =
new ContactSelectionDialog(mSelectionModel, selectExportType, mParentWidget);
dlg->setMessageText(i18n("Which contact do you want to export?"));
......
......@@ -457,25 +457,25 @@ QString GrantleeContactFormatter::toHtml(HtmlForm form) const
if (description.value(QStringLiteral("key")).toString() == key) {
key = description.value(QStringLiteral("title")).toString();
const QString descriptionType = description.value(QStringLiteral("type")).toString();
if (descriptionType == QStringLiteral("boolean")) {
if (value == QStringLiteral("true")) {
if (descriptionType == QLatin1String("boolean")) {
if (value == QLatin1String("true")) {
value = i18nc("Boolean value", "yes");
} else {
value = i18nc("Boolean value", "no");
}
} else if (descriptionType == QStringLiteral("date")) {
} else if (descriptionType == QLatin1String("date")) {
const QDate date = QDate::fromString(value, Qt::ISODate);
value = QLocale().toString(date, QLocale::ShortFormat);
} else if (descriptionType == QStringLiteral("time")) {
} else if (descriptionType == QLatin1String("time")) {
const QTime time = QTime::fromString(value, Qt::ISODate);
value = KLocale::global()->formatTime(time);
} else if (descriptionType == QStringLiteral("datetime")) {
} else if (descriptionType == QLatin1String("datetime")) {
const QDateTime dateTime = QDateTime::fromString(value, Qt::ISODate);
value = QLocale().toString(dateTime, QLocale::ShortFormat);
} else if (descriptionType == QStringLiteral("url")) {
} else if (descriptionType == QLatin1String("url")) {
value = KStringHandler::tagUrls(value.toHtmlEscaped());
addUrl = true;
}
......
......@@ -31,45 +31,45 @@ void GrantleeContactUtils::insertVariableToQVariantHash(QVariantHash &contactI18
QString GrantleeContactUtils::variableI18n(const QString &variable)
{
if (variable == QStringLiteral("birthdayi18n")) {
if (variable == QLatin1String("birthdayi18n")) {
return i18n("Birthday");
} else if (variable == QStringLiteral("anniversaryi18n")) {
} else if (variable == QLatin1String("anniversaryi18n")) {
return i18nc("The wedding anniversary of a contact", "Anniversary");
} else if (variable == QStringLiteral("emailsi18n")) {
} else if (variable == QLatin1String("emailsi18n")) {
return i18n("Emails");
} else if (variable == QStringLiteral("websitei18n")) {
} else if (variable == QLatin1String("websitei18n")) {
return i18n("Website");
} else if (variable == QStringLiteral("blogUrli18n")) {
} else if (variable == QLatin1String("blogUrli18n")) {
return i18n("Blog Feed");
} else if (variable == QStringLiteral("addressBookNamei18n")) {
} else if (variable == QLatin1String("addressBookNamei18n")) {
return i18n("Address Book");
} else if (variable == QStringLiteral("notei18n")) {
} else if (variable == QLatin1String("notei18n")) {
return i18n("Note");
} else if (variable == QStringLiteral("departmenti18n")) {
} else if (variable == QLatin1String("departmenti18n")) {
return i18n("Department");
} else if (variable == QStringLiteral("Professioni18n")) {
} else if (variable == QLatin1String("Professioni18n")) {
return i18n("Profession");
} else if (variable == QStringLiteral("officei18n")) {
} else if (variable == QLatin1String("officei18n")) {
return i18n("Office");
} else if (variable == QStringLiteral("manageri18n")) {
} else if (variable == QLatin1String("manageri18n")) {
return i18n("Manager's Name");
} else if (variable == QStringLiteral("assistanti18n")) {
} else if (variable == QLatin1String("assistanti18n")) {
return i18n("Assistant's Name");
} else if (variable == QStringLiteral("spousei18n")) {
} else if (variable == QLatin1String("spousei18n")) {
return i18n("Partner's Name");
} else if (variable == QStringLiteral("imAddressi18n")) {
} else if (variable == QLatin1String("imAddressi18n")) {
return i18n("IM Address");
} else if (variable == QStringLiteral("latitudei18n")) {
} else if (variable == QLatin1String("latitudei18n")) {
return i18n("Latitude");
} else if (variable == QStringLiteral("longitudei18n")) {
} else if (variable == QLatin1String("longitudei18n")) {
return i18n("Longitude");
} else if (variable == QStringLiteral("organizationi18n")) {
} else if (variable == QLatin1String("organizationi18n")) {
return i18n("Organization");
} else if (variable == QStringLiteral("namei18n")) {
} else if (variable == QLatin1String("namei18n")) {
return i18n("Name");
} else if (variable == QStringLiteral("titlei18n")) {
} else if (variable == QLatin1String("titlei18n")) {
return i18n("Title");
} else if (variable == QStringLiteral("nextcontacti18n")) {
} else if (variable == QLatin1String("nextcontacti18n")) {
return i18n("Contact");
} else {
return variable;
......
......@@ -114,9 +114,9 @@ void AkonadiResourceCreator::agentInstanceCreated(KJob* j)
// Set the default alarm type for a directory resource config dialog
mAgentInstance = job->instance();
QString type = mAgentInstance.type().identifier();
if (type == QStringLiteral("akonadi_kalarm_dir_resource"))
if (type == QLatin1String("akonadi_kalarm_dir_resource"))
setResourceAlarmType<OrgKdeAkonadiKAlarmDirSettingsInterface>();
else if (type == QStringLiteral("akonadi_kalarm_resource"))
else if (type == QLatin1String("akonadi_kalarm_resource"))
setResourceAlarmType<OrgKdeAkonadiKAlarmSettingsInterface>();
// Display the resource config dialog, but first ensure we get
......
......@@ -37,7 +37,7 @@ QCheckBox* FileDialog::mAppendCheck = Q_NULLPTR;
QString FileDialog::getSaveFileName(const KUrl& dir, const QString& filter, QWidget* parent, const QString& caption, bool* append)
{
bool defaultDir = dir.isEmpty();
bool specialDir = !defaultDir && dir.scheme() == QStringLiteral("kfiledialog");
bool specialDir = !defaultDir && dir.scheme() == QLatin1String("kfiledialog");
// Use AutoQPointer to guard against crash on application exit while
// the dialogue is still open. It prevents double deletion (both on
// deletion of parent, and on return from this function).
......
......@@ -921,12 +921,12 @@ void ComposerPage::CharsetTab::slotVerifyCharset(QString &charset)
// KCharsets::codecForName("us-ascii") returns "iso-8859-1" (cf. Bug #49812)
// therefore we have to treat this case specially
if (charset.toLower() == QStringLiteral("us-ascii")) {
if (charset.toLower() == QLatin1String("us-ascii")) {
charset = QStringLiteral("us-ascii");
return;
}
if (charset.toLower() == QStringLiteral("locale")) {
if (charset.toLower() == QLatin1String("locale")) {
charset = QStringLiteral("%1 (locale)")
.arg(QString::fromLatin1(kmkernel->networkCodec()->name()).toLower());
return;
......
......@@ -48,7 +48,7 @@ PotentialPhishingEmailWarning::~PotentialPhishingEmailWarning()
void PotentialPhishingEmailWarning::slotShowDetails(const QString &link)
{
if (link == QStringLiteral("phishingdetails")) {
if (link == QLatin1String("phishingdetails")) {
QPointer<PotentialPhishingDetailDialog> dlg = new PotentialPhishingDetailDialog(this);
dlg->fillList(mPotentialPhishingEmails);
dlg->exec();
......
......@@ -58,11 +58,11 @@ void SaveAsFileJob::start()
QTextDocumentWriter writer;
const QString filename = dlg->selectedFiles().at(0);
writer.setFileName(filename);
if (dlg->selectedNameFilter() == QStringLiteral("text/plain") || filename.endsWith(QLatin1String(".txt"))) {
if (dlg->selectedNameFilter() == QLatin1String("text/plain") || filename.endsWith(QLatin1String(".txt"))) {
writer.setFormat("plaintext");
} else if (dlg->selectedNameFilter() == QStringLiteral("text/html") || filename.endsWith(QLatin1String(".html"))) {
} else if (dlg->selectedNameFilter() == QLatin1String("text/html") || filename.endsWith(QLatin1String(".html"))) {
writer.setFormat("HTML");
} else if (dlg->selectedNameFilter() == QStringLiteral("application/vnd.oasis.opendocument.text") || filename.endsWith(QLatin1String(".odf"))) {
} else if (dlg->selectedNameFilter() == QLatin1String("application/vnd.oasis.opendocument.text") || filename.endsWith(QLatin1String(".odf"))) {
writer.setFormat("ODF");
} else {
writer.setFormat("plaintext");
......
......@@ -175,7 +175,7 @@ KMailPlugin::~KMailPlugin()
bool KMailPlugin::createDBUSInterface(const QString &serviceType)
{
if (serviceType == QStringLiteral("DBUS/Mailer")) {
if (serviceType == QLatin1String("DBUS/Mailer")) {
if (part()) {
return true;
}
......
......@@ -43,8 +43,8 @@ void MailMergeWidgetTest::shouldHaveDefaultValueOnCreation()
for (int i = 0; i < stackedwidget->count(); ++i) {
const QString objectName = stackedwidget->widget(i)->objectName();
bool hasName = (objectName == QStringLiteral("addressbookwidget") ||
objectName == QStringLiteral("csvwidget"));
bool hasName = (objectName == QLatin1String("addressbookwidget") ||
objectName == QLatin1String("csvwidget"));
QVERIFY(hasName);
}
PimCommon::SimpleStringListEditor *listEditor = mailmerge.findChild<PimCommon::SimpleStringListEditor *>(QStringLiteral("attachment-list"));
......
......@@ -562,7 +562,7 @@ void MessageActions::addMailingListAction(const QString &item, const QUrl &url)
{
QString protocol = url.scheme().toLower();
QString prettyUrl = url.toDisplayString();
if (protocol == QStringLiteral("mailto")) {
if (protocol == QLatin1String("mailto")) {
protocol = i18n("email");
prettyUrl.remove(0, 7); // length( "mailto:" )
} else if (protocol.startsWith(QStringLiteral("http"))) {
......
......@@ -450,7 +450,7 @@ void AkonadiCollectionView::updateMenu()
const QString identifier = QString::number(collection.id());
const QColor defaultColor = KOPrefs::instance()->resourceColor(identifier);
enableAction = enableAction && defaultColor.isValid();
if (collection.remoteId() == QStringLiteral("akonadi_birthdays_resource")) {
if (collection.remoteId() == QLatin1String("akonadi_birthdays_resource")) {
enableAction = false;
mAssignColor->setEnabled(enableAction);
}
......
......@@ -155,7 +155,7 @@ void JournalPlugin::slotSyncJournal()
bool JournalPlugin::createDBUSInterface(const QString &serviceType)
{
if (serviceType == QStringLiteral("DBUS/Organizer") || serviceType == QStringLiteral("DBUS/Calendar")) {
if (serviceType == QLatin1String("DBUS/Organizer") || serviceType == QLatin1String("DBUS/Calendar")) {
if (part()) {
return true;
}
......
......@@ -169,7 +169,7 @@ void KOrganizerPlugin::slotSyncEvents()
bool KOrganizerPlugin::createDBUSInterface(const QString &serviceType)
{
if (serviceType == QStringLiteral("DBUS/Organizer") || serviceType == QStringLiteral("DBUS/Calendar")) {
if (serviceType == QLatin1String("DBUS/Organizer") || serviceType == QLatin1String("DBUS/Calendar")) {
if (part()) {
return true;
}
......
......@@ -169,7 +169,7 @@ void TodoPlugin::slotSyncTodos()
bool TodoPlugin::createDBUSInterface(const QString &serviceType)
{
if (serviceType == QStringLiteral("DBUS/Organizer") || serviceType == QStringLiteral("DBUS/Calendar")) {
if (serviceType == QLatin1String("DBUS/Organizer") || serviceType == QLatin1String("DBUS/Calendar")) {
if (part()) {
return true;
}
......