From 4eb0886e94a130e631e5bf97b9a634847541b6a5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 8 Jul 2019 16:00:30 +0200 Subject: vsession.*: Use QStringLiteral for most C-Strings Some things like searching feel a bit sluggish; try to get rid of repeated QString creation and destruction. --- src/vsession.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/vsession.h') diff --git a/src/vsession.h b/src/vsession.h index ad81833..609884e 100644 --- a/src/vsession.h +++ b/src/vsession.h @@ -19,37 +19,37 @@ class VSession : public Session { int priority() const; bool isTemplate() const { - return getAttribute("is_template").toInt() != 0; + return getAttribute(QStringLiteral("is_template")).toInt() != 0; } bool isForLocation() const { - return getAttribute("for_location").toInt() != 0; + return getAttribute(QStringLiteral("for_location")).toInt() != 0; } bool canEdit() const { - return getAttribute("allow_edit").toInt() != 0; + return getAttribute(QStringLiteral("allow_edit")).toInt() != 0; } QString virtualizer() const { - return getAttribute(QLatin1String("virtualmachine")); + return getAttribute(QStringLiteral("virtualmachine")); } QString shortDescription() const { - return getAttribute("short_description"); + return getAttribute(QStringLiteral("short_description")); } QString description() const { - return getAttribute("long_description"); + return getAttribute(QStringLiteral("long_description")); } QIcon icon() const; QString os() const { - return getAttribute("os"); + return getAttribute(QStringLiteral("os")); } QString uuid() const { - return getAttribute("uuid"); + return getAttribute(QStringLiteral("uuid")); } SectionType section() const { @@ -66,14 +66,14 @@ class VSession : public Session { QVariant foregroundRole() const; QString getAttribute(const QString& nodeName, - const QString& attribute = "param") const; + const QString& attribute = QStringLiteral("param")) const; QList keywords() const; bool containsKeywords(const QList& keywords) const; QString getNodeText(const QString& nodeName) const; void addNodeWithAttribute(const QString& nodeName, const QString& value, - const QString& attribute = "param", + const QString& attribute = QStringLiteral("param"), bool replace = true); QString toXml() const; -- cgit v1.2.3-55-g7522