Commit 8956123d authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 513af1aa
......@@ -97,7 +97,7 @@ QString KolabResource::defaultName() const
QByteArray KolabResource::clientId() const
{
return "Kontact Kolab Resource 5/KOLAB";
return QByteArrayLiteral("Kontact Kolab Resource 5/KOLAB");
}
QDialog *KolabResource::createConfigureDialog(WId windowId)
......
......@@ -429,10 +429,10 @@ static QString emailTypesToStringList(int emailTypes)
static int emailTypesFromStringlist(const QString &types)
{
int emailTypes = Kolab::Email::NoType;
if (types.contains("home")) {
if (types.contains(QStringLiteral("home"))) {
emailTypes |= Kolab::Email::Home;
}
if (types.contains("work")) {
if (types.contains(QStringLiteral("work"))) {
emailTypes |= Kolab::Email::Work;
}
return emailTypes;
......@@ -491,7 +491,7 @@ KContacts::Addressee toKABC(const Kolab::Contact &contact)
if (preferredEmail.isEmpty()) {
Error() << "f/b url is set but no email address available, skipping";
} else {
addressee.insertCustom("KOLAB", "FreebusyUrl", fromStdString(contact.freeBusyUrl()));
addressee.insertCustom(QStringLiteral("KOLAB"), QStringLiteral("FreebusyUrl"), fromStdString(contact.freeBusyUrl()));
}
}
......@@ -511,7 +511,7 @@ KContacts::Addressee toKABC(const Kolab::Contact &contact)
addressee.setUrl(url);
foreach (const Kolab::Url &u, contact.urls()) {
if (u.type() == Kolab::Url::Blog) {
addressee.insertCustom("KADDRESSBOOK", "BlogFeed", fromStdString(u.url()));
addressee.insertCustom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("BlogFeed"), fromStdString(u.url()));
}
}
}
......
......@@ -45,7 +45,7 @@ namespace Kolab {
#define KOLAB_VERSION_V2 QStringLiteral("2.0")
#define KOLAB_VERSION_V3 QStringLiteral("3.0")
#define KOLAB_OBJECT_FILENAME "kolab.xml"
#define KOLAB_OBJECT_FILENAME QStringLiteral("kolab.xml")
#define MIME_TYPE_XCAL "application/calendar+xml"
#define MIME_TYPE_XCARD "application/vcard+xml"
......
......@@ -176,7 +176,7 @@ KOLAB_EXPORT QString generateMemberUrl(const RelationMember &member)
return QStringLiteral("urn:uuid:%1").arg(member.gid);
}
QUrl url;
url.setScheme("imap");
url.setScheme(QStringLiteral("imap"));
QList<QByteArray> path;
path << "/";
if (!member.user.isEmpty()) {
......
......@@ -37,8 +37,9 @@
using namespace KolabV2;
static const char *s_unhandledTagAppName = "KOLABUNHANDLED"; // no hyphens in appnames!
namespace {
inline QString unhandledTagAppName() { return QStringLiteral("KOLABUNHANDLED"); } // no hyphens in appnames!
}
// saving (contactgroup->xml)
DistributionList::DistributionList(const KContacts::ContactGroup *contactGroup)
{
......@@ -130,7 +131,7 @@ bool DistributionList::saveAttributes(QDomElement &element) const
{
// Save the base class elements
KolabBase::saveAttributes(element);
writeString(element, "display-name", name());
writeString(element, QStringLiteral("display-name"), name());
saveDistrListMembers(element);
return true;
......@@ -156,7 +157,7 @@ bool DistributionList::loadXML(const QDomDocument &document)
// Unhandled tag - save for later storage
//qDebug() <<"Saving unhandled tag" << e.tagName();
Custom c;
c.app = s_unhandledTagAppName;
c.app = unhandledTagAppName();
c.name = e.tagName();
c.value = e.text();
mCustomList.append(c);
......
......@@ -508,7 +508,7 @@ bool Incidence::loadAttribute(QDomElement &element)
} else {
setPriority(p);
}
} else if (tagName == "x-kcal-priority") { //for backwards compat
} else if (tagName == QLatin1String("x-kcal-priority")) { //for backwards compat
bool ok;
int p = element.text().toInt(&ok);
if (!ok || p < 0 || p > 9) {
......
......@@ -228,7 +228,7 @@ void Note::saveTo(const KCalCore::Journal::Ptr &journal)
colorToString(backgroundColor()));
}
journal->setCustomProperty("KNotes", "RichText",
richText() ? "true" : "false");
richText() ? QLatin1String("true") : QLatin1String("false"));
}
QString Note::productID() const
......
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