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

Use QStringLitera

parent 7042a369
......@@ -29,7 +29,7 @@ DummyMigrator::DummyMigrator(const QString &identifier)
QString DummyMigrator::displayName() const
{
return QLatin1String("dummymigrator");
return QStringLiteral("dummymigrator");
}
void DummyMigrator::startWork()
......
......@@ -39,7 +39,7 @@ public:
QString displayName() const Q_DECL_OVERRIDE
{
return QLatin1String("name");
return QStringLiteral("name");
}
void startWork() Q_DECL_OVERRIDE
......
......@@ -45,11 +45,11 @@ namespace
QString messageTypeToString(KMigratorBase::MessageType type)
{
switch (type) {
case KMigratorBase::Success: return QLatin1String("Success");
case KMigratorBase::Skip: return QLatin1String("Skipped");
case KMigratorBase::Info: return QLatin1String("Info ");
case KMigratorBase::Warning: return QLatin1String("WARNING");
case KMigratorBase::Error: return QLatin1String("ERROR ");
case KMigratorBase::Success: return QStringLiteral("Success");
case KMigratorBase::Skip: return QStringLiteral("Skipped");
case KMigratorBase::Info: return QStringLiteral("Info ");
case KMigratorBase::Warning: return QStringLiteral("WARNING");
case KMigratorBase::Error: return QStringLiteral("ERROR ");
}
Q_ASSERT(false);
return QString();
......
......@@ -32,7 +32,7 @@ AkonotesResource::~AkonotesResource()
QString AkonotesResource::itemMimeType() const
{
return QLatin1String("text/x-vnd.akonadi.note");
return QStringLiteral("text/x-vnd.akonadi.note");
}
void AkonotesResource::configure(WId windowId)
......@@ -43,7 +43,7 @@ void AkonotesResource::configure(WId windowId)
QString AkonotesResource::defaultResourceType()
{
return QLatin1String("notes");
return QStringLiteral("notes");
}
AKONADI_RESOURCE_MAIN(AkonotesResource)
......@@ -39,10 +39,10 @@ void DavPrincipalHomeSetsFetchJob::fetchHomeSets(bool homeSetsOnly)
{
QDomDocument document;
QDomElement propfindElement = document.createElementNS(QLatin1String("DAV:"), QStringLiteral("propfind"));
QDomElement propfindElement = document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("propfind"));
document.appendChild(propfindElement);
QDomElement propElement = document.createElementNS(QLatin1String("DAV:"), QStringLiteral("prop"));
QDomElement propElement = document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("prop"));
propfindElement.appendChild(propElement);
const QString homeSet = DavManager::self()->davProtocol(mUrl.protocol())->principalHomeSet();
......@@ -50,8 +50,8 @@ void DavPrincipalHomeSetsFetchJob::fetchHomeSets(bool homeSetsOnly)
propElement.appendChild(document.createElementNS(homeSetNS, homeSet));
if (!homeSetsOnly) {
propElement.appendChild(document.createElementNS(QLatin1String("DAV:"), QStringLiteral("current-user-principal")));
propElement.appendChild(document.createElementNS(QLatin1String("DAV:"), QStringLiteral("principal-URL")));
propElement.appendChild(document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("current-user-principal")));
propElement.appendChild(document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("principal-URL")));
}
KIO::DavJob *job = DavManager::self()->createPropFindJob(mUrl.url(), document, QStringLiteral("0"));
......
......@@ -29,12 +29,12 @@ ImapTestBase::ImapTestBase(QObject *parent)
QString ImapTestBase::defaultUserName() const
{
return QLatin1String("test@kdab.com");
return QStringLiteral("test@kdab.com");
}
QString ImapTestBase::defaultPassword() const
{
return QLatin1String("foobar");
return QStringLiteral("foobar");
}
ImapAccount *ImapTestBase::createDefaultAccount() const
......
......@@ -40,7 +40,7 @@ QString ResourceStateInterface::mailBoxForCollection(const Akonadi::Collection &
/*if ( showWarnings && collection.remoteId() != rootRemoteId())
qCWarning(IMAPRESOURCE_LOG) << "RID mismatch, is " << collection.remoteId() << " expected " << rootRemoteId();
*/
return QLatin1String(""); // see below, this intentionally not just QString()!
return QStringLiteral(""); // see below, this intentionally not just QString()!
}
const QString parentMailbox = mailBoxForCollection(collection.parentCollection());
if (parentMailbox.isNull()) { // invalid, != isEmpty() here!
......
......@@ -309,7 +309,7 @@ void Settings::loadAccount(ImapAccount *account) const
QString Settings::rootRemoteId() const
{
return QLatin1String("imap://") + userName() + QLatin1Char('@') + imapServer() + QLatin1Char('/');
return QStringLiteral("imap://") + userName() + QLatin1Char('@') + imapServer() + QLatin1Char('/');
}
void Settings::renameRootCollection(const QString &newName)
......
......@@ -72,17 +72,17 @@ static QString authenticationModeString(MailTransport::Transport::EnumAuthentica
{
switch (mode) {
case MailTransport::Transport::EnumAuthenticationType::LOGIN:
return QLatin1String("LOGIN");
return QStringLiteral("LOGIN");
case MailTransport::Transport::EnumAuthenticationType::PLAIN:
return QLatin1String("PLAIN");
return QStringLiteral("PLAIN");
case MailTransport::Transport::EnumAuthenticationType::CRAM_MD5:
return QLatin1String("CRAM-MD5");
return QStringLiteral("CRAM-MD5");
case MailTransport::Transport::EnumAuthenticationType::DIGEST_MD5:
return QLatin1String("DIGEST-MD5");
return QStringLiteral("DIGEST-MD5");
case MailTransport::Transport::EnumAuthenticationType::GSSAPI:
return QLatin1String("GSSAPI");
return QStringLiteral("GSSAPI");
case MailTransport::Transport::EnumAuthenticationType::NTLM:
return QLatin1String("NTLM");
return QStringLiteral("NTLM");
case MailTransport::Transport::EnumAuthenticationType::CLEAR:
return i18nc("Authentication method", "Clear text");
case MailTransport::Transport::EnumAuthenticationType::ANONYMOUS:
......
......@@ -428,11 +428,11 @@ QString KolabHelpers::getIcon(Kolab::FolderType type)
case Kolab::EventType:
case Kolab::TaskType:
case Kolab::JournalType:
return QLatin1String("view-calendar");
return QStringLiteral("view-calendar");
case Kolab::ContactType:
return QLatin1String("view-pim-contacts");
return QStringLiteral("view-pim-contacts");
case Kolab::NoteType:
return QLatin1String("view-pim-notes");
return QStringLiteral("view-pim-notes");
case Kolab::MailType:
case Kolab::ConfigurationType:
case Kolab::FreebusyType:
......
......@@ -25,7 +25,7 @@ using namespace OXA;
QDomElement DAVUtils::addDavElement(QDomDocument &document, QDomNode &parentNode, const QString &tag)
{
const QDomElement element = document.createElementNS(QLatin1String("DAV:"), QStringLiteral("D:") + tag);
const QDomElement element = document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("D:") + tag);
parentNode.appendChild(element);
return element;
......@@ -33,7 +33,7 @@ QDomElement DAVUtils::addDavElement(QDomDocument &document, QDomNode &parentNode
QDomElement DAVUtils::addOxElement(QDomDocument &document, QDomNode &parentNode, const QString &tag, const QString &text)
{
QDomElement element = document.createElementNS(QLatin1String("http://www.open-xchange.org"), QStringLiteral("ox:") + tag);
QDomElement element = document.createElementNS(QStringLiteral("http://www.open-xchange.org"), QStringLiteral("ox:") + tag);
if (!text.isEmpty()) {
const QDomText textNode = document.createTextNode(text);
......
......@@ -123,9 +123,9 @@ void *OXA::ObjectUtils::preloadData(const Object &object, KJob *job)
QString OXA::ObjectUtils::davPath(Folder::Module module)
{
switch (module) {
case Folder::Contacts: return QLatin1String("/servlet/webdav.contacts"); break;
case Folder::Calendar: return QLatin1String("/servlet/webdav.calendar"); break;
case Folder::Tasks: return QLatin1String("/servlet/webdav.tasks"); break;
case Folder::Contacts: return QStringLiteral("/servlet/webdav.contacts"); break;
case Folder::Calendar: return QStringLiteral("/servlet/webdav.calendar"); break;
case Folder::Tasks: return QStringLiteral("/servlet/webdav.tasks"); break;
case Folder::Unbound: Q_ASSERT(false); return QString(); break;
}
......
......@@ -155,7 +155,6 @@ void AccountDialog::setupWidgets()
connect(usePipeliningCheck, &QCheckBox::clicked, this, &AccountDialog::slotPipeliningClicked);
// FIXME: Hide widgets which are not supported yet
filterOnServerCheck->hide();
filterOnServerSizeSpin->hide();
......
......@@ -105,21 +105,21 @@ QString POPSession::authenticationToString(int type) const
{
switch (type) {
case MailTransport::Transport::EnumAuthenticationType::LOGIN:
return QLatin1String("LOGIN");
return QStringLiteral("LOGIN");
case MailTransport::Transport::EnumAuthenticationType::PLAIN:
return QLatin1String("PLAIN");
return QStringLiteral("PLAIN");
case MailTransport::Transport::EnumAuthenticationType::CRAM_MD5:
return QLatin1String("CRAM-MD5");
return QStringLiteral("CRAM-MD5");
case MailTransport::Transport::EnumAuthenticationType::DIGEST_MD5:
return QLatin1String("DIGEST-MD5");
return QStringLiteral("DIGEST-MD5");
case MailTransport::Transport::EnumAuthenticationType::GSSAPI:
return QLatin1String("GSSAPI");
return QStringLiteral("GSSAPI");
case MailTransport::Transport::EnumAuthenticationType::NTLM:
return QLatin1String("NTLM");
return QStringLiteral("NTLM");
case MailTransport::Transport::EnumAuthenticationType::CLEAR:
return QLatin1String("USER");
return QStringLiteral("USER");
case MailTransport::Transport::EnumAuthenticationType::APOP:
return QLatin1String("APOP");
return QStringLiteral("APOP");
default:
break;
}
......
......@@ -41,7 +41,6 @@ private Q_SLOTS:
QVERIFY(!attr.myRights());
}
void shouldBuildAttribute()
{
QMap<QByteArray, KIMAP::Acl::Rights> right;
......@@ -197,7 +196,7 @@ private Q_SLOTS:
<< QByteArray("testme@host l %% otheruser@host lr % user@host lr");
QTest::newRow("myrights") << acl << KIMAP::Acl::rightsFromString("lrswipckxtdaen") << QByteArray("otheruser@host lr % user@host lr %% %% lrswipckxtdaen")
<< QByteArray("testme@host l %% otheruser@host lr % user@host lr %% lrswipckxtdaen");
<< QByteArray("testme@host l %% otheruser@host lr % user@host lr %% lrswipckxtdaen");
}
void testSerializeDeserialize()
......
......@@ -158,6 +158,6 @@ void ImapAclAttribute::deserialize(const QByteArray &data)
bool ImapAclAttribute::operator==(const ImapAclAttribute &other) const
{
return (oldRights() == other.oldRights())
&& (rights() == other.rights())
&& (myRights() == other.myRights());
&& (rights() == other.rights())
&& (myRights() == other.myRights());
}
......@@ -182,8 +182,9 @@ bool VCardResource::writeToFile(const QString &fileName)
QVector<KContacts::Addressee> v;
v.reserve(mAddressees.size());
foreach (const KContacts::Addressee &addressee, mAddressees)
foreach (const KContacts::Addressee &addressee, mAddressees) {
v.push_back(addressee);
}
const QByteArray data = mConverter.createVCards(v);
......
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