Commit 72cc25b8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QLatin1String overload for QString::operator ==/!=

parent 40610915
......@@ -97,11 +97,11 @@ EwsAttachment::EwsAttachment(QXmlStreamReader &reader)
}
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("ItemAttachment")) {
if (readerName == QLatin1String("ItemAttachment")) {
d->mType = ItemAttachment;
} else if (readerName == QStringLiteral("FileAttachment")) {
} else if (readerName == QLatin1String("FileAttachment")) {
d->mType = FileAttachment;
} else if (readerName == QStringLiteral("ReferenceAttachment")) {
} else if (readerName == QLatin1String("ReferenceAttachment")) {
d->mType = ReferenceAttachment;
} else {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Unknown attachment type %1").arg(readerName.toString());
......@@ -126,7 +126,7 @@ EwsAttachment::EwsAttachment(QXmlStreamReader &reader)
}
const QString elmName = reader.name().toString();
if (elmName == QStringLiteral("AttachmentId")) {
if (elmName == QLatin1String("AttachmentId")) {
QXmlStreamAttributes attrs = reader.attributes();
if (!attrs.hasAttribute(QStringLiteral("Id"))) {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - missing Id in AttachmentId element.")
......@@ -138,41 +138,41 @@ EwsAttachment::EwsAttachment(QXmlStreamReader &reader)
d->mValidFields.setBit(EwsAttachmentPrivate::Id);
}
reader.skipCurrentElement();
} else if (elmName == QStringLiteral("Name")) {
} else if (elmName == QLatin1String("Name")) {
d->mName = readXmlElementValue<QString>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::Name, ok);
} else if (elmName == QStringLiteral("ContentType")) {
} else if (elmName == QLatin1String("ContentType")) {
d->mContentType = readXmlElementValue<QString>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::ContentType, ok);
} else if (elmName == QStringLiteral("ContentId")) {
} else if (elmName == QLatin1String("ContentId")) {
d->mContentId = readXmlElementValue<QString>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::ContentId, ok);
} else if (elmName == QStringLiteral("ContentLocation")) {
} else if (elmName == QLatin1String("ContentLocation")) {
d->mContentLocation = readXmlElementValue<QString>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::ContentLocation, ok);
} else if (elmName == QStringLiteral("AttachmentOriginalUrl")) {
} else if (elmName == QLatin1String("AttachmentOriginalUrl")) {
// Ignore
reader.skipCurrentElement();
} else if (elmName == QStringLiteral("Size")) {
} else if (elmName == QLatin1String("Size")) {
d->mSize = readXmlElementValue<long>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::Size, ok);
} else if (elmName == QStringLiteral("LastModifiedTime")) {
} else if (elmName == QLatin1String("LastModifiedTime")) {
d->mLastModifiedTime = readXmlElementValue<QDateTime>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::LastModifiedTime, ok);
} else if (elmName == QStringLiteral("IsInline")) {
} else if (elmName == QLatin1String("IsInline")) {
d->mIsInline = readXmlElementValue<bool>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::IsInline, ok);
} else if (d->mType == FileAttachment && elmName == QStringLiteral("IsContactPhoto")) {
} else if (d->mType == FileAttachment && elmName == QLatin1String("IsContactPhoto")) {
d->mIsContactPhoto = readXmlElementValue<bool>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::IsContactPhoto, ok);
} else if (d->mType == FileAttachment && elmName == QStringLiteral("Content")) {
} else if (d->mType == FileAttachment && elmName == QLatin1String("Content")) {
d->mContent = readXmlElementValue<QByteArray>(reader, ok, QStringLiteral("Attachment"));
d->mValidFields.setBit(EwsAttachmentPrivate::Content, ok);
} else if (d->mType == ItemAttachment && (elmName == QStringLiteral("Item") || elmName == QStringLiteral("Message")
|| elmName == QStringLiteral("CalendarItem") || elmName == QStringLiteral("Contact")
|| elmName == QStringLiteral("MeetingMessage") || elmName == QStringLiteral("MeetingRequest")
|| elmName == QStringLiteral("MeetingResponse") || elmName == QStringLiteral("MeetingCancellation")
|| elmName == QStringLiteral("Task"))) {
} else if (d->mType == ItemAttachment && (elmName == QLatin1String("Item") || elmName == QStringLiteral("Message")
|| elmName == QLatin1String("CalendarItem") || elmName == QStringLiteral("Contact")
|| elmName == QLatin1String("MeetingMessage") || elmName == QStringLiteral("MeetingRequest")
|| elmName == QLatin1String("MeetingResponse") || elmName == QStringLiteral("MeetingCancellation")
|| elmName == QLatin1String("Task"))) {
d->mItem = EwsItem(reader);
if (!d->mItem.isValid()) {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - invalid %2 element.")
......
......@@ -71,14 +71,14 @@ EwsAttendee::EwsAttendee(QXmlStreamReader &reader)
}
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("Mailbox")) {
if (readerName == QLatin1String("Mailbox")) {
d->mMailbox = EwsMailbox(reader);
if (!d->mMailbox.isValid()) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read EWS request - invalid attendee %1 element.")
.arg(readerName.toString());
return;
}
} else if (readerName == QStringLiteral("ResponseType")) {
} else if (readerName == QLatin1String("ResponseType")) {
bool ok;
d->mResponse = decodeEnumString<EwsEventResponseType>(reader.readElementText(),
responseTypeNames, responseTypeNameCount, &ok);
......@@ -87,7 +87,7 @@ EwsAttendee::EwsAttendee(QXmlStreamReader &reader)
.arg(readerName.toString());
return;
}
} else if (readerName == QStringLiteral("LastResponseTime")) {
} else if (readerName == QLatin1String("LastResponseTime")) {
// Unsupported - ignore
//qCWarningNC(EWSCLIENT_LOG) << QStringLiteral("Unsupported mailbox element %1").arg(reader.name().toString());
reader.skipCurrentElement();
......
......@@ -104,7 +104,7 @@ EwsCreateFolderRequest::Response::Response(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("Folders")) {
if (reader.name() == QLatin1String("Folders")) {
if (reader.readNextStartElement()) {
EwsFolder folder(reader);
if (!folder.isValid()) {
......
......@@ -129,7 +129,7 @@ EwsCreateItemRequest::Response::Response(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("Items")) {
if (reader.name() == QLatin1String("Items")) {
if (reader.readNextStartElement()) {
EwsItem item(reader);
if (!item.isValid()) {
......
......@@ -69,9 +69,9 @@ bool EwsEffectiveRightsPrivate::readRight(QXmlStreamReader &reader, Right right)
}
const QString text = reader.readElementText();
if (text == QStringLiteral("true")) {
if (text == QLatin1String("true")) {
mRights.setBit(right);
} else if (text == QStringLiteral("false")) {
} else if (text == QLatin1String("false")) {
mRights.clearBit(right);
} else {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - invalid %2 element value: %3.")
......@@ -97,31 +97,31 @@ EwsEffectiveRights::EwsEffectiveRights(QXmlStreamReader &reader)
return;
}
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("CreateAssociated")) {
if (readerName == QLatin1String("CreateAssociated")) {
if (!d->readRight(reader, EwsEffectiveRightsPrivate::CreateAssociated)) {
return;
}
} else if (readerName == QStringLiteral("CreateContents")) {
} else if (readerName == QLatin1String("CreateContents")) {
if (!d->readRight(reader, EwsEffectiveRightsPrivate::CreateContents)) {
return;
}
} else if (readerName == QStringLiteral("CreateHierarchy")) {
} else if (readerName == QLatin1String("CreateHierarchy")) {
if (!d->readRight(reader, EwsEffectiveRightsPrivate::CreateHierarchy)) {
return;
}
} else if (readerName == QStringLiteral("Delete")) {
} else if (readerName == QLatin1String("Delete")) {
if (!d->readRight(reader, EwsEffectiveRightsPrivate::Delete)) {
return;
}
} else if (readerName == QStringLiteral("Modify")) {
} else if (readerName == QLatin1String("Modify")) {
if (!d->readRight(reader, EwsEffectiveRightsPrivate::Modify)) {
return;
}
} else if (readerName == QStringLiteral("Read")) {
} else if (readerName == QLatin1String("Read")) {
if (!d->readRight(reader, EwsEffectiveRightsPrivate::Read)) {
return;
}
} else if (readerName == QStringLiteral("ViewPrivateItems")) {
} else if (readerName == QLatin1String("ViewPrivateItems")) {
if (!d->readRight(reader, EwsEffectiveRightsPrivate::ViewPrivateItems)) {
return;
}
......
......@@ -100,7 +100,7 @@ EwsEventRequestBase::Response::Response(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("Notification")) {
if (reader.name() == QLatin1String("Notification")) {
Notification nfy(reader);
if (!nfy.isValid()) {
setErrorMsg(QStringLiteral("Failed to process notification."));
......@@ -108,9 +108,9 @@ EwsEventRequestBase::Response::Response(QXmlStreamReader &reader)
return;
}
mNotifications.append(nfy);
} else if (reader.name() == QStringLiteral("Notifications")) {
} else if (reader.name() == QLatin1String("Notifications")) {
while (reader.readNextStartElement()) {
if (reader.name() == QStringLiteral("Notification")) {
if (reader.name() == QLatin1String("Notification")) {
Notification nfy(reader);
if (!nfy.isValid()) {
setErrorMsg(QStringLiteral("Failed to process notification."));
......@@ -122,7 +122,7 @@ EwsEventRequestBase::Response::Response(QXmlStreamReader &reader)
setErrorMsg(QStringLiteral("Failed to read EWS request - expected Notification inside Notifications"));
}
}
} else if (reader.name() == QStringLiteral("ConnectionStatus")) {
} else if (reader.name() == QLatin1String("ConnectionStatus")) {
reader.skipCurrentElement();
} else if (!readResponseElement(reader)) {
setErrorMsg(QStringLiteral("Failed to read EWS request - invalid response element '%1'")
......@@ -199,21 +199,21 @@ EwsEventRequestBase::Event::Event(QXmlStreamReader &reader)
EventReader ewsreader(staticReader);
QStringRef elmName = reader.name();
if (elmName == QStringLiteral("CopiedEvent")) {
if (elmName == QLatin1String("CopiedEvent")) {
mType = EwsCopiedEvent;
} else if (elmName == QStringLiteral("CreatedEvent")) {
} else if (elmName == QLatin1String("CreatedEvent")) {
mType = EwsCreatedEvent;
} else if (elmName == QStringLiteral("DeletedEvent")) {
} else if (elmName == QLatin1String("DeletedEvent")) {
mType = EwsDeletedEvent;
} else if (elmName == QStringLiteral("ModifiedEvent")) {
} else if (elmName == QLatin1String("ModifiedEvent")) {
mType = EwsModifiedEvent;
} else if (elmName == QStringLiteral("MovedEvent")) {
} else if (elmName == QLatin1String("MovedEvent")) {
mType = EwsMovedEvent;
} else if (elmName == QStringLiteral("NewMailEvent")) {
} else if (elmName == QLatin1String("NewMailEvent")) {
mType = EwsNewMailEvent;
} else if (elmName == QStringLiteral("StatusEvent")) {
} else if (elmName == QLatin1String("StatusEvent")) {
mType = EwsStatusEvent;
} else if (elmName == QStringLiteral("FreeBusyChangedEvent")) {
} else if (elmName == QLatin1String("FreeBusyChangedEvent")) {
mType = EwsFreeBusyChangedEvent;
} else {
qCWarning(EWSCLI_LOG) << QStringLiteral("Unknown notification event type: %1")
......
......@@ -119,7 +119,7 @@ EwsFindFolderResponse::EwsFindFolderResponse(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("RootFolder")) {
if (reader.name() == QLatin1String("RootFolder")) {
if (!parseRootFolder(reader)) {
return;
}
......@@ -200,11 +200,11 @@ EwsFolder *EwsFindFolderResponse::readFolder(QXmlStreamReader &reader)
{
EwsFolder *folder = nullptr;
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("Folder")
|| readerName == QStringLiteral("CalendarFolder")
|| readerName == QStringLiteral("ContactsFolder")
|| readerName == QStringLiteral("TasksFolder")
|| readerName == QStringLiteral("SearchFolder")) {
if (readerName == QLatin1String("Folder")
|| readerName == QLatin1String("CalendarFolder")
|| readerName == QLatin1String("ContactsFolder")
|| readerName == QLatin1String("TasksFolder")
|| readerName == QLatin1String("SearchFolder")) {
folder = new EwsFolder(reader);
if (!folder->isValid()) {
setErrorMsg(QStringLiteral("Failed to read EWS request - invalid %1 element.")
......
......@@ -173,7 +173,7 @@ EwsFindItemResponse::EwsFindItemResponse(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("RootFolder")) {
if (reader.name() == QLatin1String("RootFolder")) {
if (!parseRootFolder(reader)) {
return;
}
......@@ -203,7 +203,7 @@ bool EwsFindItemResponse::parseRootFolder(QXmlStreamReader &reader)
return setErrorMsg(QStringLiteral("Failed to read EWS request - failed to read %1 attribute.")
.arg(QStringLiteral("TotalItemsInView")));
}
mIncludesLastItem = attrs.value(QStringLiteral("IncludesLastItemInRange")) == QStringLiteral("true");
mIncludesLastItem = attrs.value(QStringLiteral("IncludesLastItemInRange")) == QLatin1String("true");
if (attrs.hasAttribute(QStringLiteral("IndexedPagingOffset"))) {
mNextOffset = attrs.value(QStringLiteral("IndexedPagingOffset")).toInt(&ok);
......@@ -269,16 +269,16 @@ EwsItem *EwsFindItemResponse::readItem(QXmlStreamReader &reader)
{
EwsItem *item = nullptr;
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("Item")
|| readerName == QStringLiteral("Message")
|| readerName == QStringLiteral("CalendarItem")
|| readerName == QStringLiteral("Contact")
|| readerName == QStringLiteral("DistributionList")
|| readerName == QStringLiteral("MeetingMessage")
|| readerName == QStringLiteral("MeetingRequest")
|| readerName == QStringLiteral("MeetingResponse")
|| readerName == QStringLiteral("MeetingCancellation")
|| readerName == QStringLiteral("Task")) {
if (readerName == QLatin1String("Item")
|| readerName == QLatin1String("Message")
|| readerName == QLatin1String("CalendarItem")
|| readerName == QLatin1String("Contact")
|| readerName == QLatin1String("DistributionList")
|| readerName == QLatin1String("MeetingMessage")
|| readerName == QLatin1String("MeetingRequest")
|| readerName == QLatin1String("MeetingResponse")
|| readerName == QLatin1String("MeetingCancellation")
|| readerName == QLatin1String("Task")) {
qCDebug(EWSCLI_LOG).noquote() << QStringLiteral("Processing %1").arg(readerName.toString());
item = new EwsItem(reader);
if (!item->isValid()) {
......
......@@ -118,7 +118,7 @@ EwsGetFolderRequest::Response::Response(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("Folders")) {
if (reader.name() == QLatin1String("Folders")) {
if (responseClass() == EwsResponseError) {
// Skip empty folders element
reader.skipCurrentElement();
......
......@@ -115,7 +115,7 @@ EwsGetItemRequest::Response::Response(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("Items")) {
if (reader.name() == QLatin1String("Items")) {
if (!parseItems(reader)) {
return;
}
......
......@@ -152,9 +152,9 @@ bool EwsItemPrivate::bodyReader(QXmlStreamReader &reader, QVariant &val)
return false;
}
bool isHtml;
if (bodyType == QStringLiteral("HTML")) {
if (bodyType == QLatin1String("HTML")) {
isHtml = true;
} else if (bodyType == QStringLiteral("Text")) {
} else if (bodyType == QLatin1String("Text")) {
isHtml = false;
} else {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Failed to read Body element- unknown body type");
......@@ -182,7 +182,7 @@ bool EwsItemPrivate::messageHeadersReader(QXmlStreamReader &reader, QVariant &va
return false;
}
if (reader.name() == QStringLiteral("InternetMessageHeader")) {
if (reader.name() == QLatin1String("InternetMessageHeader")) {
QStringRef nameRef = reader.attributes().value(QStringLiteral("HeaderName"));
if (nameRef.isNull()) {
qCWarningNC(EWSCLI_LOG) << QStringLiteral("Missing HeaderName attribute in InternetMessageHeader element.");
......@@ -337,7 +337,7 @@ bool EwsItemPrivate::categoriesReader(QXmlStreamReader &reader, QVariant &val)
return false;
}
if (reader.name() == QStringLiteral("String")) {
if (reader.name() == QLatin1String("String")) {
categories.append(reader.readElementText());
if (reader.error() != QXmlStreamReader::NoError) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read EWS request - invalid %1 element.")
......@@ -421,35 +421,35 @@ EwsItem::EwsItem(QXmlStreamReader &reader)
// Check what item type are we
const QStringRef elmName = reader.name();
if (elmName == QStringLiteral("Item")) {
if (elmName == QLatin1String("Item")) {
d->mType = EwsItemTypeItem;
const QStringRef subtype = reader.attributes().value(QStringLiteral("xsi:type"));
if (!subtype.isEmpty()) {
auto tokens = subtype.split(QLatin1Char(':'));
const QStringRef type = tokens.size() == 1 ? tokens[0] : tokens[1];
if (type == QStringLiteral("AbchPersonItemType")) {
if (type == QLatin1String("AbchPersonItemType")) {
d->mType = EwsItemTypeAbchPerson;
}
}
} else if (elmName == QStringLiteral("Message")) {
} else if (elmName == QLatin1String("Message")) {
d->mType = EwsItemTypeMessage;
} else if (elmName == QStringLiteral("CalendarItem")) {
} else if (elmName == QLatin1String("CalendarItem")) {
d->mType = EwsItemTypeCalendarItem;
} else if (elmName == QStringLiteral("Contact")) {
} else if (elmName == QLatin1String("Contact")) {
d->mType = EwsItemTypeContact;
} else if (elmName == QStringLiteral("DistributionList")) {
} else if (elmName == QLatin1String("DistributionList")) {
d->mType = EwsItemTypeDistributionList;
} else if (elmName == QStringLiteral("MeetingMessage")) {
} else if (elmName == QLatin1String("MeetingMessage")) {
d->mType = EwsItemTypeMeetingMessage;
} else if (elmName == QStringLiteral("MeetingRequest")) {
} else if (elmName == QLatin1String("MeetingRequest")) {
d->mType = EwsItemTypeMeetingRequest;
} else if (elmName == QStringLiteral("MeetingResponse")) {
} else if (elmName == QLatin1String("MeetingResponse")) {
d->mType = EwsItemTypeMeetingResponse;
} else if (elmName == QStringLiteral("MeetingCancellation")) {
} else if (elmName == QLatin1String("MeetingCancellation")) {
d->mType = EwsItemTypeMeetingCancellation;
} else if (elmName == QStringLiteral("PostItem")) {
} else if (elmName == QLatin1String("PostItem")) {
d->mType = EwsItemTypePostItem;
} else if (elmName == QStringLiteral("Task")) {
} else if (elmName == QLatin1String("Task")) {
d->mType = EwsItemTypeTask;
}
......
......@@ -71,17 +71,17 @@ bool EwsItemBasePrivate::extendedPropertyReader(QXmlStreamReader &reader, QVaria
return false;
}
if (reader.name() == QStringLiteral("FieldURI")
|| reader.name() == QStringLiteral("IndexedFieldURI")
|| reader.name() == QStringLiteral("ExtendedFieldURI")) {
if (reader.name() == QLatin1String("FieldURI")
|| reader.name() == QLatin1String("IndexedFieldURI")
|| reader.name() == QLatin1String("ExtendedFieldURI")) {
if (!prop.read(reader)) {
reader.skipCurrentElement();
return false;
}
reader.skipCurrentElement();
} else if (reader.name() == QStringLiteral("Value")) {
} else if (reader.name() == QLatin1String("Value")) {
value = reader.readElementText();
} else if (reader.name() == QStringLiteral("Values")) {
} else if (reader.name() == QLatin1String("Values")) {
QStringList values;
while (reader.readNextStartElement()) {
if (reader.namespaceUri() != ewsTypeNsUri) {
......@@ -92,7 +92,7 @@ bool EwsItemBasePrivate::extendedPropertyReader(QXmlStreamReader &reader, QVaria
return false;
}
if (reader.name() == QStringLiteral("Value")) {
if (reader.name() == QLatin1String("Value")) {
values.append(reader.readElementText());
}
}
......
......@@ -57,21 +57,21 @@ EwsMailbox::EwsMailbox(QXmlStreamReader &reader)
return;
}
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("Name")) {
if (readerName == QLatin1String("Name")) {
d->mName = reader.readElementText();
if (reader.error() != QXmlStreamReader::NoError) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read EWS request - invalid mailbox Name element.");
return;
}
} else if (readerName == QStringLiteral("EmailAddress")) {
} else if (readerName == QLatin1String("EmailAddress")) {
d->mEmail = reader.readElementText();
if (reader.error() != QXmlStreamReader::NoError) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read EWS request - invalid mailbox EmailAddress element.");
return;
}
} else if (readerName == QStringLiteral("RoutingType")
|| readerName == QStringLiteral("MailboxType")
|| readerName == QStringLiteral("ItemId")) {
} else if (readerName == QLatin1String("RoutingType")
|| readerName == QLatin1String("MailboxType")
|| readerName == QLatin1String("ItemId")) {
// Unsupported - ignore
//qCWarningNC(EWSCLIENT_LOG) << QStringLiteral("Unsupported mailbox element %1").arg(reader.name().toString());
reader.skipCurrentElement();
......
......@@ -103,7 +103,7 @@ EwsMoveFolderRequest::Response::Response(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("Folders")) {
if (reader.name() == QLatin1String("Folders")) {
if (reader.readNextStartElement()) {
EwsFolder folder(reader);
if (!folder.isValid()) {
......
......@@ -102,7 +102,7 @@ EwsMoveItemRequest::Response::Response(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("Items")) {
if (reader.name() == QLatin1String("Items")) {
if (reader.readNextStartElement()) {
EwsItem item(reader);
if (!item.isValid()) {
......
......@@ -60,24 +60,24 @@ EwsOccurrence::EwsOccurrence(QXmlStreamReader &reader)
return;
}
if (reader.name() == QStringLiteral("ItemId")) {
if (reader.name() == QLatin1String("ItemId")) {
d->mItemId = EwsId(reader);
reader.skipCurrentElement();
} else if (reader.name() == QStringLiteral("Start")) {
} else if (reader.name() == QLatin1String("Start")) {
d->mStart = QDateTime::fromString(reader.readElementText(), Qt::ISODate);
if (reader.error() != QXmlStreamReader::NoError || !d->mStart.isValid()) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - invalid %2 element.")
.arg(QStringLiteral("Occurrence")).arg(QStringLiteral("Start"));
return;
}
} else if (reader.name() == QStringLiteral("End")) {
} else if (reader.name() == QLatin1String("End")) {
d->mEnd = QDateTime::fromString(reader.readElementText(), Qt::ISODate);
if (reader.error() != QXmlStreamReader::NoError || !d->mStart.isValid()) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - invalid %2 element.")
.arg(QStringLiteral("Occurrence")).arg(QStringLiteral("End"));
return;
}
} else if (reader.name() == QStringLiteral("OriginalStart")) {
} else if (reader.name() == QLatin1String("OriginalStart")) {
d->mStart = QDateTime::fromString(reader.readElementText(), Qt::ISODate);
if (reader.error() != QXmlStreamReader::NoError || !d->mStart.isValid()) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read %1 element - invalid %2 element.")
......
......@@ -170,9 +170,9 @@ bool EwsPoxAutodiscoverRequest::readResponse(QXmlStreamReader &reader)
return setErrorMsg(QStringLiteral("Failed to read POX response - invalid namespace"));
}
if (reader.name() == QStringLiteral("User")) {
if (reader.name() == QLatin1String("User")) {
reader.skipCurrentElement();
} else if (reader.name() == QStringLiteral("Account")) {
} else if (reader.name() == QLatin1String("Account")) {
if (!readAccount(reader)) {
return false;
}
......@@ -191,25 +191,25 @@ bool EwsPoxAutodiscoverRequest::readAccount(QXmlStreamReader &reader)
return setErrorMsg(QStringLiteral("Failed to read POX response - invalid namespace"));
}
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("Action")) {
if (readerName == QLatin1String("Action")) {
QString action = reader.readElementText();
if (action == QStringLiteral("settings")) {
if (action == QLatin1String("settings")) {
mAction = Settings;
} else if (action == QStringLiteral("redirectUrl")) {
} else if (action == QLatin1String("redirectUrl")) {
mAction = RedirectUrl;
} else if (action == QStringLiteral("redirectAddr")) {
} else if (action == QLatin1String("redirectAddr")) {
mAction = RedirectAddr;
} else {
return setErrorMsg(QStringLiteral("Failed to read POX response - unknown action '%1'")
.arg(action));
}
} else if (readerName == QStringLiteral("RedirectUrl")) {
} else if (readerName == QLatin1String("RedirectUrl")) {
mRedirectUrl = reader.readElementText();
} else if (readerName == QStringLiteral("RedirectAddr")) {
} else if (readerName == QLatin1String("RedirectAddr")) {
mRedirectAddr = reader.readElementText();
} else if (readerName == QStringLiteral("RedirectAddr")) {
} else if (readerName == QLatin1String("RedirectAddr")) {
mRedirectAddr = reader.readElementText();
} else if (readerName == QStringLiteral("Protocol")) {
} else if (readerName == QLatin1String("Protocol")) {
if (!readProtocol(reader)) {
return false;
}
......@@ -230,21 +230,21 @@ bool EwsPoxAutodiscoverRequest::readProtocol(QXmlStreamReader &reader)
}
const QStringRef readerName = reader.name();
if (readerName == QStringLiteral("Type")) {
if (readerName == QLatin1String("Type")) {