Commit 7be74116 authored by Laurent Montel's avatar Laurent Montel 😁

USe more QStringLiteral

parent c38cb204
......@@ -407,16 +407,16 @@ bool Contact::loadNameAttribute( QDomElement& element )
void Contact::saveNameAttribute( QDomElement& element ) const
{
QDomElement e = element.ownerDocument().createElement( "name" );
QDomElement e = element.ownerDocument().createElement( QStringLiteral("name") );
element.appendChild( e );
writeString( e, "given-name", givenName() );
writeString( e, "middle-names", middleNames() );
writeString( e, "last-name", lastName() );
writeString( e, "full-name", fullName() );
writeString( e, "initials", initials() );
writeString( e, "prefix", prefix() );
writeString( e, "suffix", suffix() );
writeString( e, QStringLiteral("given-name"), givenName() );
writeString( e, QStringLiteral("middle-names"), middleNames() );
writeString( e, QStringLiteral("last-name"), lastName() );
writeString( e, QStringLiteral("full-name"), fullName() );
writeString( e, QStringLiteral("initials"), initials() );
writeString( e, QStringLiteral("prefix"), prefix() );
writeString( e, QStringLiteral("suffix"), suffix() );
}
bool Contact::loadPhoneAttribute( QDomElement& element )
......@@ -468,9 +468,9 @@ void Contact::saveEmailAttributes( QDomElement& element ) const
void Contact::loadCustomAttributes( QDomElement& element )
{
Custom custom;
custom.app = element.attribute( "app" );
custom.name = element.attribute( "name" );
custom.value = element.attribute( "value" );
custom.app = element.attribute( QStringLiteral("app") );
custom.name = element.attribute( QStringLiteral("name") );
custom.value = element.attribute( QStringLiteral("value") );
mCustomList.append( custom );
}
......@@ -483,11 +483,11 @@ void Contact::saveCustomAttributes( QDomElement& element ) const
writeString( element, (*it).name, (*it).value );
} else {
// Let's use attributes so that other tag-preserving-code doesn't need sub-elements
QDomElement e = element.ownerDocument().createElement( "x-custom" );
QDomElement e = element.ownerDocument().createElement( QStringLiteral("x-custom") );
element.appendChild( e );
e.setAttribute( "app", (*it).app );
e.setAttribute( "name", (*it).name );
e.setAttribute( "value", (*it).value );
e.setAttribute( QStringLiteral("app"), (*it).app );
e.setAttribute( QStringLiteral("name"), (*it).name );
e.setAttribute( QStringLiteral("value"), (*it).value );
}
}
}
......
......@@ -170,7 +170,7 @@ QString DistributionList::saveXML() const
{
QDomDocument document = domTree();
QDomElement element = document.createElement( QLatin1String("distribution-list") );
element.setAttribute( "version", "1.0" );
element.setAttribute( QStringLiteral("version"), QStringLiteral("1.0") );
saveAttributes( element );
document.appendChild( element );
return document.toString();
......
......@@ -355,7 +355,7 @@ void Incidence::loadRecurrence( const QDomElement& element )
else if ( tagName == QLatin1String("month") )
mRecurrence.month = e.text();
else if ( tagName == QLatin1String("range") ) {
mRecurrence.rangeType = e.attribute( "type" );
mRecurrence.rangeType = e.attribute( QStringLiteral("type") );
mRecurrence.range = e.text();
} else if ( tagName == QLatin1String("exclusion") ) {
mRecurrence.exclusions.append( stringToDate( e.text() ) );
......
......@@ -419,7 +419,7 @@ QDomDocument KolabBase::domTree()
QDomDocument document;
QString p = QStringLiteral("version=\"1.0\" encoding=\"UTF-8\"");
document.appendChild(document.createProcessingInstruction( "xml", p ) );
document.appendChild(document.createProcessingInstruction( QStringLiteral("xml"), p ) );
return document;
}
......
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