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

Use QLatin1String here

parent 04bd6a7b
......@@ -74,8 +74,8 @@ bool SieveActionDeleteHeader::parseValue(QXmlStreamReader &element, QWidget *w,
const QStringRef tagName = element.name();
if (tagName == QLatin1String("test")) {
QString nameValue;
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
nameValue = element.attributes().value(QStringLiteral("name")).toString();
if (element.attributes().hasAttribute(QLatin1String("name"))) {
nameValue = element.attributes().value(QLatin1String("name")).toString();
}
const bool isNegative = (nameValue == QLatin1String("not"));
bool result = parseValue(element, w, error, isNegative);
......
......@@ -396,8 +396,8 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct
if (onlyActions) {
const QStringRef tagName = element.name();
if (tagName == QLatin1String("action")) {
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
const QString actionName = element.attributes().value(QStringLiteral("name")).toString();
if (element.attributes().hasAttribute(QLatin1String("name"))) {
const QString actionName = element.attributes().value(QLatin1String("name")).toString();
SieveActionWidget *w = qobject_cast<SieveActionWidget *>(widgets().constLast());
if (w->isConfigurated()) {
addWidgetAfterThisWidget(widgets().constLast());
......@@ -420,8 +420,8 @@ void SieveActionWidgetLister::loadScript(QXmlStreamReader &element, bool onlyAct
while (element.readNextStartElement()) {
const QStringRef tagName = element.name();
if (tagName == QLatin1String("action") || tagName == QLatin1String("control") /*for break action*/) {
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
const QString actionName = element.attributes().value(QStringLiteral("name")).toString();
if (element.attributes().hasAttribute(QLatin1String("name"))) {
const QString actionName = element.attributes().value(QLatin1String("name")).toString();
if (tagName == QLatin1String("control") && actionName == QLatin1String("if")) {
qCDebug(LIBKSIEVE_LOG) << "We found an loop if in a loop if. Not supported";
error += i18n("We detected a loop if in a loop if. It's not supported") + QLatin1Char('\n');
......
......@@ -83,8 +83,8 @@ bool SieveConditionSize::setParamWidgetValue(QXmlStreamReader &element, QWidget
}
} else if (tagName == QLatin1String("num")) {
QString numIdentifier;
if (element.attributes().hasAttribute(QStringLiteral("quantifier"))) {
numIdentifier = element.attributes().value(QStringLiteral("quantifier")).toString();
if (element.attributes().hasAttribute(QLatin1String("quantifier"))) {
numIdentifier = element.attributes().value(QLatin1String("quantifier")).toString();
}
const qlonglong tagValue = element.readElementText().toLongLong();
SelectSizeWidget *sizeWidget = w->findChild<SelectSizeWidget *>(QStringLiteral("sizewidget"));
......
......@@ -345,8 +345,8 @@ void SieveConditionWidgetLister::loadTest(QXmlStreamReader &element, bool notCon
if (notCondition) {
element.readNextStartElement();
}
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
const QString conditionName = element.attributes().value(QStringLiteral("name")).toString();
if (element.attributes().hasAttribute(QLatin1String("name"))) {
const QString conditionName = element.attributes().value(QLatin1String("name")).toString();
SieveConditionWidget *w = qobject_cast<SieveConditionWidget *>(widgets().constLast());
w->setCondition(conditionName, element, notCondition, error);
}
......@@ -370,8 +370,8 @@ void SieveConditionWidgetLister::loadScript(QXmlStreamReader &element, bool uniq
while (element.readNextStartElement()) {
const QStringRef testTagName = element.name();
if (testTagName == QLatin1String("test")) {
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
QString conditionName = element.attributes().value(QStringLiteral("name")).toString();
if (element.attributes().hasAttribute(QLatin1String("name"))) {
QString conditionName = element.attributes().value(QLatin1String("name")).toString();
if (firstCondition) {
firstCondition = false;
} else {
......@@ -381,8 +381,8 @@ void SieveConditionWidgetLister::loadScript(QXmlStreamReader &element, bool uniq
if (conditionName == QLatin1String("not")) {
notCondition = true;
element.readNextStartElement();
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
conditionName = element.attributes().value(QStringLiteral("name")).toString();
if (element.attributes().hasAttribute(QLatin1String("name"))) {
conditionName = element.attributes().value(QLatin1String("name")).toString();
}
w->setCondition(conditionName, element, notCondition, error);
element.skipCurrentElement();
......
......@@ -265,8 +265,8 @@ void SieveScriptBlockWidget::loadScript(QXmlStreamReader &element, bool onlyActi
const QStringRef tagName = element.name();
if (tagName == QLatin1String("test")) {
bool notCondition = false;
if (element.attributes().hasAttribute(QStringLiteral("name"))) {
const QString typeCondition = element.attributes().value(QStringLiteral("name")).toString();
if (element.attributes().hasAttribute(QLatin1String("name"))) {
const QString typeCondition = element.attributes().value(QLatin1String("name")).toString();
if (typeCondition == QLatin1String("anyof")) {
mMatchCondition = OrCondition;
} else if (typeCondition == QLatin1String("allof")) {
......
......@@ -414,8 +414,8 @@ void SieveScriptListBox::loadBlock(QXmlStreamReader &n, SieveScriptPage *current
if (typeBlock == TypeBlockAction) {
currentPage = nullptr;
}
if (n.attributes().hasAttribute(QStringLiteral("name"))) {
const QString controlType = n.attributes().value(QStringLiteral("name")).toString();
if (n.attributes().hasAttribute(QLatin1String("name"))) {
const QString controlType = n.attributes().value(QLatin1String("name")).toString();
//qCDebug(LIBKSIEVE_LOG)<<" controlType"<<controlType;
if (controlType == QLatin1String("if")) {
typeBlock = TypeBlockIf;
......@@ -491,8 +491,8 @@ void SieveScriptListBox::loadBlock(QXmlStreamReader &n, SieveScriptPage *current
//qDebug() << " COMMENT " << comment;
} else if (tagName == QLatin1String("action")) {
previousElementWasAComment = false;
if (n.attributes().hasAttribute(QStringLiteral("name"))) {
const QString actionName = n.attributes().value(QStringLiteral("name")).toString();
if (n.attributes().hasAttribute(QLatin1String("name"))) {
const QString actionName = n.attributes().value(QLatin1String("name")).toString();
if (actionName == QLatin1String("include")) {
if (!currentPage || (typeBlock == TypeBlockIf) || (typeBlock == TypeBlockElse) || (typeBlock == TypeBlockElsif)) {
currentPage = createNewScript(scriptName.isEmpty() ? createUniqName() : scriptName, comment);
......
......@@ -125,8 +125,8 @@ QStringList ParseUserScriptJob::extractActiveScript(const QString &doc)
while (mStreamReader->readNextStartElement()) {
const QStringRef tagname = mStreamReader->name();
if (tagname == QLatin1String("action")) {
if (mStreamReader->attributes().hasAttribute(QStringLiteral("name"))) {
const QString actionName = mStreamReader->attributes().value(QStringLiteral("name")).toString();
if (mStreamReader->attributes().hasAttribute(QLatin1String("name"))) {
const QString actionName = mStreamReader->attributes().value(QLatin1String("name")).toString();
if (actionName == QLatin1String("include")) {
//Load includes
const QString str = loadInclude();
......
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